JUCE-7.0.12-0-g4f43011b96 JUCE-7.0.12-0-g4f43011b96
JUCE — C++ application framework with suport for VST, VST3, LV2 audio plug-ins

« « « Anklang Documentation
Loading...
Searching...
No Matches
Public Member Functions | List of all members
juce::DynamicLibrary Class Reference

Handles the opening and closing of DLLs. More...

#include "juce_DynamicLibrary.h"

Public Member Functions

 DynamicLibrary ()=default
 Creates an unopened DynamicLibrary object.
 
 DynamicLibrary (const String &name)
 
 DynamicLibrary (DynamicLibrary &&other) noexcept
 Move constructor.
 
 ~DynamicLibrary ()
 Destructor.
 
bool open (const String &name)
 Opens a DLL.
 
void close ()
 Releases the currently-open DLL, or has no effect if none was open.
 
voidgetFunction (const String &functionName) noexcept
 Tries to find a named function in the currently-open DLL, and returns a pointer to it.
 
voidgetNativeHandle () const noexcept
 Returns the platform-specific native library handle.
 

Detailed Description

Handles the opening and closing of DLLs.

This class can be used to open a DLL and get some function pointers from it. Since the DLL is freed when this object is deleted, it's handy for managing library lifetimes using RAII.

@tags{Core}

Definition at line 35 of file juce_DynamicLibrary.h.

Constructor & Destructor Documentation

◆ DynamicLibrary() [1/3]

juce::DynamicLibrary::DynamicLibrary ( )
default

Creates an unopened DynamicLibrary object.

Call open() to actually open one.

◆ DynamicLibrary() [2/3]

juce::DynamicLibrary::DynamicLibrary ( const String name)

Definition at line 45 of file juce_DynamicLibrary.h.

◆ DynamicLibrary() [3/3]

juce::DynamicLibrary::DynamicLibrary ( DynamicLibrary &&  other)
noexcept

Move constructor.

Definition at line 48 of file juce_DynamicLibrary.h.

◆ ~DynamicLibrary()

juce::DynamicLibrary::~DynamicLibrary ( )

Destructor.

If a library is currently open, it will be closed when this object is destroyed.

Definition at line 56 of file juce_DynamicLibrary.h.

Member Function Documentation

◆ close()

void juce::DynamicLibrary::close ( )

Releases the currently-open DLL, or has no effect if none was open.

Definition at line 1068 of file juce_SharedCode_posix.h.

◆ getFunction()

void * juce::DynamicLibrary::getFunction ( const String functionName)
noexcept

Tries to find a named function in the currently-open DLL, and returns a pointer to it.

If no library is open, or if the function isn't found, this will return a null pointer.

Definition at line 1077 of file juce_SharedCode_posix.h.

◆ getNativeHandle()

void * juce::DynamicLibrary::getNativeHandle ( ) const
noexcept

Returns the platform-specific native library handle.

You'll need to cast this to whatever is appropriate for the OS that's in use.

Definition at line 78 of file juce_DynamicLibrary.h.

◆ open()

bool juce::DynamicLibrary::open ( const String name)

Opens a DLL.

The name and the method by which it gets found is of course platform-specific, and may or may not include a path, depending on the OS. If a library is already open when this method is called, it will first close the library before attempting to load the new one.

Returns
true if the library was successfully found and opened.

Definition at line 1061 of file juce_SharedCode_posix.h.


The documentation for this class was generated from the following files: