RSTools 3.1.0
Versatile C++20 utility library
Loading...
Searching...
No Matches
SystemInfo.hpp File Reference
#include <cstddef>
#include <cstdint>
#include <string>
#include <string_view>

Go to the source code of this file.

Namespaces

namespace  RST
 Root namespace of RSTools.
 
namespace  RST::System
 Portable access to system information, environment variables, files and paths.
 

Functions

CPU
std::size_t RST::System::getCpuCores () noexcept
 Number of logical cores, at least 1.
 
std::string RST::System::getCpuName ()
 CPU model name, or an empty string if unknown.
 
constexpr std::string_view RST::System::getArchitecture () noexcept
 Architecture the program was built for: x86_64, x86, arm64, arm, riscv, wasm or unknown.
 
Memory

Sizes in bytes, or 0 if unavailable.

std::uint64_t RST::System::getTotalRAM () noexcept
 
std::uint64_t RST::System::getAvailableRAM () noexcept
 
std::uint64_t RST::System::getProcessMemoryUsage () noexcept
 Physical memory used by this process.
 
std::uint64_t RST::System::getPeakProcessMemoryUsage () noexcept
 Highest physical memory used by this process so far.
 
Operating system
std::string RST::System::getOSName ()
 Operating system family, such as Linux or Windows 64-bit.
 
std::string RST::System::getHostName ()
 Network name of this computer, or an empty string on failure.
 
Disk

Sizes in bytes of the file system holding path, or 0 on failure.

std::uint64_t RST::System::getTotalDiskSpace (const std::string &path="/")
 
std::uint64_t RST::System::getAvailableDiskSpace (const std::string &path="/")