|
bit7z 4.1.0
A C++ library for interfacing with the 7-zip shared libs.
|
The Bit7zLibraryLoader class provides deferred and optional loading of the 7-zip shared library. More...
#include <bit7z/bit7zlibraryloader.hpp>
Public Member Functions | |
| Bit7zLibraryLoader () noexcept | |
| Constructs an empty Bit7zLibraryLoader without loading any library. | |
| Bit7zLibraryLoader (const tstring &libraryPath) | |
| Constructs a Bit7zLibraryLoader and immediately loads the specified 7-zip shared library. | |
| ~Bit7zLibraryLoader () | |
| Destructs the Bit7zLibraryLoader, unloading the library if it was loaded. | |
| auto | isLoaded () const noexcept -> bool |
| Checks whether a 7-zip shared library is currently loaded. | |
| auto | library () const -> const Bit7zLibrary & |
| Returns a reference to the loaded Bit7zLibrary. | |
| void | load (const tstring &libraryPath) |
| Loads the specified 7-zip shared library. | |
| void | load (const tstring &libraryPath, std::error_code &ec) noexcept |
| Loads the specified 7-zip shared library (non-throwing overload). | |
| operator const Bit7zLibrary & () const | |
| Implicitly converts to the loaded Bit7zLibrary reference. | |
| auto | operator-> () const -> const Bit7zLibrary * |
| Provides pointer-like access to the loaded Bit7zLibrary. | |
| void | unload () noexcept |
| Unloads the currently loaded library, if any. | |
The Bit7zLibraryLoader class provides deferred and optional loading of the 7-zip shared library.
Unlike Bit7zLibrary, which loads the shared library in its constructor, Bit7zLibraryLoader allows constructing an empty loader and loading the library at a later time. It also supports unloading and reloading the library, as well as non-throwing error handling.
Once loaded, the underlying Bit7zLibrary can be accessed via the library() method, the arrow operator, or implicit conversion.
|
noexcept |
Constructs an empty Bit7zLibraryLoader without loading any library.
|
explicit |
Constructs a Bit7zLibraryLoader and immediately loads the specified 7-zip shared library.
| libraryPath | the path to the 7-zip shared library to be loaded. |
| ~Bit7zLibraryLoader | ( | ) |
Destructs the Bit7zLibraryLoader, unloading the library if it was loaded.
|
noexcept |
Checks whether a 7-zip shared library is currently loaded.
| auto library | ( | ) | const -> const Bit7zLibrary & |
Returns a reference to the loaded Bit7zLibrary.
| BitException | if no library is currently loaded. |
| void load | ( | const tstring & | libraryPath | ) |
Loads the specified 7-zip shared library.
If a library is already loaded, it is unloaded first.
| libraryPath | the path to the 7-zip shared library to be loaded. |
|
noexcept |
Loads the specified 7-zip shared library (non-throwing overload).
If a library is already loaded, it is unloaded first.
| libraryPath | the path to the 7-zip shared library to be loaded. |
| ec | an output error code indicating the result of the operation. |
| operator const Bit7zLibrary & | ( | ) | const |
Implicitly converts to the loaded Bit7zLibrary reference.
This allows passing a Bit7zLibraryLoader directly where a Bit7zLibrary reference is expected.
| BitException | if no library is currently loaded. |
| auto operator-> | ( | ) | const -> const Bit7zLibrary * |
Provides pointer-like access to the loaded Bit7zLibrary.
| BitException | if no library is currently loaded. |
|
noexcept |
Unloads the currently loaded library, if any.