CommonLib
Loading...
Searching...
No Matches
hedgedev::csl::diag::this_process Namespace Reference

Functions

std::filesystem::path GetExecutableRoot ()
bool IsNeighbour (const std::filesystem::path &in_rPath)
template<typename TString = std::wstring>
std::vector< TString > GetCommandLineArguments ()
std::filesystem::path GetExecutablePath ()
std::filesystem::path GetModulePathFromAddress (const void *in_pAddr)
std::filesystem::path GetWorkingDirectory ()
std::vector< StackFrameGetStackTrace (const void *in_pContext, const size_t in_maxFrames)
bool HasAddress (const void *in_pAddr)
template<typename TString = std::wstring_view>
bool Restart (const std::vector< TString > &in_rArgs)
bool Restart ()

Function Documentation

◆ GetCommandLineArguments()

template<typename TString = std::wstring>
std::vector< TString > hedgedev::csl::diag::this_process::GetCommandLineArguments ( )
inline

Gets the command line arguments that were passed into this process at launch.

◆ GetExecutablePath()

std::filesystem::path hedgedev::csl::diag::this_process::GetExecutablePath ( )
inline

Gets the path to the executable this process started from.

◆ GetExecutableRoot()

std::filesystem::path hedgedev::csl::diag::this_process::GetExecutableRoot ( )
inline

Gets the path to the directory containing executable this process started from.

◆ GetModulePathFromAddress()

std::filesystem::path hedgedev::csl::diag::this_process::GetModulePathFromAddress ( const void * in_pAddr)
inline

Gets the path to the module containing the specified address.

Parameters
in_pAddrThe address to search for.

◆ GetStackTrace()

std::vector< StackFrame > hedgedev::csl::diag::this_process::GetStackTrace ( const void * in_pContext,
const size_t in_maxFrames = 0 )
inline

Gets a stack trace.

Parameters
in_pContextA pointer to a CPU context structure.
in_maxFramesThe maximum number of stack frames to capture.
Returns
A collection of stack frames.

◆ GetWorkingDirectory()

std::filesystem::path hedgedev::csl::diag::this_process::GetWorkingDirectory ( )
inline

Gets the working directory of this process.

◆ HasAddress()

bool hedgedev::csl::diag::this_process::HasAddress ( const void * in_pAddr)
inline

Checks if this process is the owner of the specified address.

Parameters
in_pAddrThe address to search for.

◆ IsNeighbour()

bool hedgedev::csl::diag::this_process::IsNeighbour ( const std::filesystem::path & in_rPath)
inline

Checks if a path is in the same directory as the executable this process started from.

Parameters
in_rPathThe path to check.
Returns
true if both paths are in the same directory. Otherwise, false.

◆ Restart() [1/2]

bool hedgedev::csl::diag::this_process::Restart ( )
inline

Restarts this process.

Returns
true if this process was terminated successfully. Otherwise, false.

◆ Restart() [2/2]

template<typename TString = std::wstring_view>
bool hedgedev::csl::diag::this_process::Restart ( const std::vector< TString > & in_rArgs)
inline

Restarts this process.

Parameters
in_rArgsThe command line arguments to pass into the new process.
Returns
true if this process was terminated successfully. Otherwise, false.