VoltMod
C++23 framework for CS2 server plugins
Loading...
Searching...
No Matches
VoltMod::SharedLibrary Class Reference

#include <SharedLibrary.hpp>

Public Member Functions

 SharedLibrary ()=default
 
 ~SharedLibrary ()
 
 SharedLibrary (SharedLibrary &&other) noexcept
 
SharedLibrary & operator= (SharedLibrary &&other) noexcept
 
 SharedLibrary (const SharedLibrary &)=delete
 
SharedLibrary & operator= (const SharedLibrary &)=delete
 
Result< void * > Symbol (const char *name) const
 

Static Public Member Functions

static Result< SharedLibrary > Open (const std::filesystem::path &path)
 

Detailed Description

A shared library the host opened, closed at scope end. Move-only: two owners would close it twice.

Definition at line 10 of file SharedLibrary.hpp.

Constructor & Destructor Documentation

◆ SharedLibrary() [1/3]

VoltMod::SharedLibrary::SharedLibrary ( )
default

Referenced by Open().

◆ ~SharedLibrary()

VoltMod::SharedLibrary::~SharedLibrary ( )

Definition at line 67 of file SharedLibrary.cpp.

◆ SharedLibrary() [2/3]

VoltMod::SharedLibrary::SharedLibrary ( SharedLibrary &&  other)
noexcept

Definition at line 72 of file SharedLibrary.cpp.

◆ SharedLibrary() [3/3]

VoltMod::SharedLibrary::SharedLibrary ( const SharedLibrary &  )
delete

Member Function Documentation

◆ Open()

Result< SharedLibrary > VoltMod::SharedLibrary::Open ( const std::filesystem::path &  path)
static

Load path. The error carries the operating system's own message.

Definition at line 84 of file SharedLibrary.cpp.

References VoltMod::Error::Failed(), VoltMod::LastError(), VoltMod::OpenLibrary(), VoltMod::ReadFile(), and SharedLibrary().

◆ operator=() [1/2]

SharedLibrary & VoltMod::SharedLibrary::operator= ( const SharedLibrary &  )
delete

◆ operator=() [2/2]

SharedLibrary & VoltMod::SharedLibrary::operator= ( SharedLibrary &&  other)
noexcept

Definition at line 74 of file SharedLibrary.cpp.

References VoltMod::Close, and VoltMod::ReadFile().

◆ Symbol()

Result< void * > VoltMod::SharedLibrary::Symbol ( const char *  name) const

The address name exports, or an error naming it.

Definition at line 95 of file SharedLibrary.cpp.

References VoltMod::FindExport(), VoltMod::LastError(), VoltMod::Error::NotFound(), VoltMod::Error::NotReady(), and VoltMod::ReadFile().


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