You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

41 lines
783 B

#pragma once
namespace vlc
{
struct VLC_LIBRARY_API Library
{
using LibraryHandle = void*;
LibraryHandle _handle = nullptr;
Library() = default;
~Library();
Library(const Library&) = delete;
Library& operator = (const Library&) = delete;
Library(Library&& src)
{
std::swap(_handle, src._handle);
}
Library& operator = (Library&& src)
{
std::swap(_handle, src._handle);
return *this;
}
explicit operator bool() const
{
return _handle != nullptr;
}
bool load(const char* name, bool auto_ext = true);
void* symbol(const char* name);
template<typename F> F get(const char* name)
{
return reinterpret_cast<F>(symbol(name));
}
};
}