|
uint32_t | SystemTools::Shared::getUID () |
| Gets the user ID of the current process.
|
|
uint32_t | SystemTools::Shared::getPID () |
| Gets the process ID of the current process.
|
|
uint32_t | SystemTools::Shared::getParentPID () |
| Gets the parent process ID of the current process.
|
|
std::string | SystemTools::Shared::getCurrentUserName () |
| Gets the current user's name.
|
|
std::string | SystemTools::Shared::getFilePathForPID (uint32_t pid) |
| Gets the file path for a given process ID.
|
|
std::string | SystemTools::Shared::getCurrentProcessFullPath () |
| Gets the full path of the current process.
|
|
std::string | SystemTools::Shared::getCurrentCommandLineContent () |
| Gets the command line content of the current process.
|
|
std::string | SystemTools::Shared::getProcessName (uint32_t pid) |
| Gets the name of a process given its process ID.
|
|
std::string | SystemTools::Shared::invokeCommandLineCommand (const std::string &cmdString, int *returnStatus=nullptr) |
| Invokes a command line command and returns its output.
|
|
std::string | SystemTools::Shared::getKernelVersion () |
| Gets the kernel version of the operating system.
|
|
uint8_t | SystemTools::Shared::getCPUNumber () |
| Gets the number of CPU cores.
|
|
uint64_t | SystemTools::Shared::getSystemFreeMemory () |
| Gets the amount of free memory in the system.
|
|
void | SystemTools::Shared::openURLWithDefaultBrowser (const std::string &url) |
| Opens a URL with the default web browser.
|
|
std::string | SystemTools::File::getHomeDirectory () |
| Gets the home directory of the current user.
|
|
bool | SystemTools::File::checkCommandExists (const std::string &command) |
| Checks if a command exists in the system.
|
|
std::vector< struct timespec > | SystemTools::File::getAccessChangeModifyTimeOfFile (const std::string &file) |
| Gets the access, change, and modify times of a file.
|
|
bool | SystemTools::File::touchFile (const std::string &file, std::optional< struct timespec > targetTimeOrNow) |
| Updates the access and modification times of a file.
|
|
std::string | SystemTools::File::getFileOwner (const std::string &filePath) |
| Gets the owner of a file.
|
|
std::vector< uint8_t > | SystemTools::File::readContentFromFile (const std::string &file) |
| Reads the content of a file into a vector of bytes.
|
|
std::string | SystemTools::File::readContentFromFileAsString (const std::string &file) |
| Reads the content of a file into a string.
|
|
std::vector< std::string > | SystemTools::File::readContentFromFileLineByLine (const std::string &filePath) |
| Reads the content of a file line by line.
|
|
void | SystemTools::File::writeContent2File (const std::string &file, const uint8_t *buffer, size_t bufferLength) |
| Writes a buffer of bytes to a file.
|
|
void | SystemTools::File::writeContent2File (const std::string &file, const std::string &content) |
| Writes a string to a file.
|
|
bool | SystemTools::File::removeFile (const std::string &filePath) |
| Removes a file.
|
|
std::vector< fs::path > | SystemTools::File::listFilesWithExtension (fs::path folderPath, std::string prefix="", std::string surfix="") |
| Lists files in a directory with a specific prefix and suffix.
|
|
std::vector< fs::path > | SystemTools::File::listFilesRecursivelyWithExtension (fs::path folderPath, std::string prefix="", std::string surfix="") |
| Recursively lists files in a directory with a specific prefix and suffix.
|
|
template<typename ParseType > |
ParseType | SystemTools::File::readValueFromFilePath (const std::string &path) |
| Reads a value from a file path.
|
|
template<typename ParseType > |
int | SystemTools::File::writeValue2FilePath (const std::string &path, const ParseType &value, const std::string &formatStr="{}") |
| Writes a value to a file path.
|
|
bool | SystemTools::Net::hasInternetConnection () |
| Checks if there is an internet connection.
|
|
std::tuple< bool, std::string, std::optional< TimePoint_System_Millisecond > > | SystemTools::Net::checkInternetConnectionAndGetGMTTime (bool forceRefresh=false) |
| Checks internet connection and gets GMT time.
|
|
std::vector< uint8_t > | SystemTools::Net::curlDownloadNoBody (const std::string &url, uint32_t timeout_ms=0, long *httpResponseCode=nullptr) |
| Downloads data from a URL without the body.
|
|
std::vector< uint8_t > | SystemTools::Net::curlDownload (const std::string &url, uint32_t timeout_ms=0, long *httpResponseCode=nullptr) |
| Downloads data from a URL.
|
|
std::string | SystemTools::Net::curlDownloadContentAsString (const std::string &url, uint32_t timeout_ms=0, long *httpResponseCode=nullptr) |
| Downloads content from a URL as a string.
|
|
int | SystemTools::Net::udpSendData (const std::string &sessionName, const uint8_t *data, uint32_t bufferLength, const std::string &targetIP, uint16_t targetPoint, std::optional< uint16_t > sourcePort=std::nullopt) |
| Sends data over UDP.
|
|
template<typename DataType > |
DataType | SystemTools::Math::uniformRandomNumberWithinRange (DataType min, DataType max) |
| Generates a uniform random number within a specified range.
|
|
std::string | SystemTools::Persistence::boostPropertyTree2JSON (const pt::ptree &tree, bool prettyOutput=true) |
| Converts a Boost property tree to a JSON string.
|
|
pt::ptree | SystemTools::Persistence::jSON2BoostPropertyTree (const std::string &jsonContent) |
| Converts a JSON string to a Boost property tree.
|
|
std::string | SystemTools::Persistence::boostPropertyTree2INI (const pt::ptree &tree, bool prettyOutput=true) |
| Converts a Boost property tree to an INI string.
|
|
pt::ptree | SystemTools::Persistence::INI2BoostPropertyTree (const std::string &iniContent) |
| Converts an INI string to a Boost property tree.
|
|
std::string | SystemTools::Thread::getThreadName (uint64_t threadId) |
| Gets the name of a thread given its ID.
|
|
void | SystemTools::Thread::setThreadName (uint64_t threadId, const std::string &threadName) |
| Sets the name of a thread given its ID.
|
|
std::string | SystemTools::Thread::getCurrentThreadName () |
| Gets the name of the current thread.
|
|
void | SystemTools::Thread::setName4CurrentThread (const std::string &threadName) |
| Sets the name of the current thread.
|
|
uint64_t | SystemTools::Thread::getCurrentThreadId () |
| Gets the ID of the current thread.
|
|
std::string | SystemTools::Misc::getCPUGovernor () |
| Gets the current CPU governor.
|
|
bool | SystemTools::Misc::isPackageInstalled (const std::string &packageName) |
| Checks if a package is installed.
|
|