Loading...
Searching...
No Matches
juce_DynamicLibrary.h
/*
==============================================================================
This file is part of the JUCE library.
Copyright (c) 2022 - Raw Material Software Limited
JUCE is an open source library subject to commercial or open-source
licensing.
The code included in this file is provided under the terms of the ISC license
http://www.isc.org/downloads/software-support-policy/isc-license. Permission
To use, copy, modify, and/or distribute this software for any purpose with or
without fee is hereby granted provided that the above copyright notice and
this permission notice appear in all copies.
JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
DISCLAIMED.
==============================================================================
*/
namespace juce
{
class JUCE_API DynamicLibrary
{
public:
DynamicLibrary() = default;
DynamicLibrary (const String& name) { open (name); }
DynamicLibrary (DynamicLibrary&& other) noexcept
{
std::swap (handle, other.handle);
}
~DynamicLibrary() { close(); }
bool open (const String& name);
void close();
void* getFunction (const String& functionName) noexcept;
void* getNativeHandle() const noexcept { return handle; }
private:
void* handle = nullptr;
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (DynamicLibrary)
};
} // namespace juce
juce::DynamicLibrary
Definition juce_DynamicLibrary.h:36
juce::DynamicLibrary::getFunction
void * getFunction(const String &functionName) noexcept
juce::DynamicLibrary::DynamicLibrary
DynamicLibrary(DynamicLibrary &&other) noexcept
Definition juce_DynamicLibrary.h:48
juce::DynamicLibrary::~DynamicLibrary
~DynamicLibrary()
Definition juce_DynamicLibrary.h:56
juce::DynamicLibrary::getNativeHandle
void * getNativeHandle() const noexcept
Definition juce_DynamicLibrary.h:78
juce::DynamicLibrary::open
bool open(const String &name)
juce::DynamicLibrary::DynamicLibrary
DynamicLibrary()=default
juce::DynamicLibrary::close
void close()
juce::String
Definition juce_String.h:53