libpromeki main
PROfessional MEdia toolKIt
 
Loading...
Searching...
No Matches
System Class Reference

Provides system-level utility functions. More...

#include <system.h>

Static Public Member Functions

static String hostname ()
 Returns the hostname of the machine.
 
static constexpr bool isLittleEndian ()
 Returns true if the host byte order is little-endian.
 
static constexpr bool isBigEndian ()
 Returns true if the host byte order is big-endian.
 
template<typename T >
static void swapEndian (T &value)
 Reverses the byte order of an arithmetic value in place.
 
template<typename T , bool ValueIsBigEndian>
static void makeNativeEndian (T &value)
 Converts a value to native endian if its byte order differs.
 
static String demangleSymbol (const char *symbol, bool useCache=true)
 Demangles a C++ symbol name into a human-readable form.
 

Detailed Description

Provides system-level utility functions.

Static utility class for querying host information, byte-order helpers, and C++ symbol demangling.

Member Function Documentation

◆ demangleSymbol()

static String System::demangleSymbol ( const char symbol,
bool  useCache = true 
)
static

Demangles a C++ symbol name into a human-readable form.

Parameters
symbolThe mangled symbol name.
useCacheIf true, cache the result for faster repeated lookups.
Returns
The demangled symbol name as a String.

◆ hostname()

static String System::hostname ( )
static

Returns the hostname of the machine.

Returns
The hostname as a String.

◆ isBigEndian()

static constexpr bool System::isBigEndian ( )
inlinestaticconstexpr

Returns true if the host byte order is big-endian.

Returns
true if big-endian, false otherwise.

◆ isLittleEndian()

static constexpr bool System::isLittleEndian ( )
inlinestaticconstexpr

Returns true if the host byte order is little-endian.

Returns
true if little-endian, false otherwise.

◆ makeNativeEndian()

template<typename T , bool ValueIsBigEndian>
static void System::makeNativeEndian ( T value)
inlinestatic

Converts a value to native endian if its byte order differs.

Template Parameters
TAn arithmetic type.
ValueIsBigEndiantrue if the value is stored in big-endian order.
Parameters
valueThe value to convert in place.

◆ swapEndian()

template<typename T >
static void System::swapEndian ( T value)
inlinestatic

Reverses the byte order of an arithmetic value in place.

Template Parameters
TAn arithmetic type (integer or floating-point).
Parameters
valueThe value whose bytes will be swapped.

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