Nazara Engine  0.4
A fast, complete, cross-platform API designed for game development
Nz::DynLib Class Reference

Core class that represents a dynamic library loader. More...

Public Member Functions

 DynLib ()
 Constructs a DynLib object by default.
 
 DynLib (const DynLib &)=delete
 
 DynLib (DynLib &&) noexcept=default
 
 ~DynLib ()
 Destructs the object and calls Unload. More...
 
String GetLastError () const
 Gets the last error. More...
 
DynLibFunc GetSymbol (const String &symbol) const
 Gets the symbol for the name. More...
 
bool IsLoaded () const
 Checks whether the library is loaded. More...
 
bool Load (const String &libraryPath)
 Loads the library with that path. More...
 
void Unload ()
 Unloads the library.
 
DynLiboperator= (const DynLib &)=delete
 
DynLiboperator= (DynLib &&lib) noexcept=default
 

Detailed Description

Core class that represents a dynamic library loader.

Constructor & Destructor Documentation

◆ ~DynLib()

Nz::DynLib::~DynLib ( )

Destructs the object and calls Unload.

See also
Unload

Member Function Documentation

◆ GetLastError()

String Nz::DynLib::GetLastError ( ) const

Gets the last error.

Returns
Last error

◆ GetSymbol()

DynLibFunc Nz::DynLib::GetSymbol ( const String symbol) const

Gets the symbol for the name.

Returns
Function which is the symbol of the function name
Remarks
Produces a NazaraError if library is not loaded with NAZARA_CORE_SAFE defined

◆ IsLoaded()

bool Nz::DynLib::IsLoaded ( ) const

Checks whether the library is loaded.

Returns
true if loaded

◆ Load()

bool Nz::DynLib::Load ( const String libraryPath)

Loads the library with that path.

Returns
true if loading is successful
Parameters
libraryPathPath of the library
Remarks
Produces a NazaraError if library is could not be loaded

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