ImFusion SDK 4.3
ImFusion::Platform Namespace Reference

Selection of platform-specific functions. More...

Detailed Description

Selection of platform-specific functions.

See also
ImFusionCorePlatform

Classes

class  DynamicLib
 Provides access to functions of a shared library. More...
 
struct  MemoryInfo
 Structure storing information about the available main memory as reported Platform::memoryInfo(). More...
 

Functions

std::string stacktrace ()
 Generates a platform-dependent call stack of the current execution environment.
 
void signalDebugTrap ()
 Generates a platform-dependent trap signal that can be caught by an attached debugger to interrupt the program.
 
MemoryInfo memoryInfo ()
 Returns the currently available system memory and the total amount of memory.
 
Filesystem::Path executablePath ()
 Returns the absolute path to the current executable (including the name of the executable)
 
Filesystem::Path libraryPath (const std::string &libName)
 Returns the absolute path to the given library (including the full name of the library).
 

Helper functions for platform-specific Unicode conversion

std::string narrow (const char *s, int64_t)
 
const std::stringnarrow (const std::string &s)
 
std::string widen (const char *s, int64_t)
 
const std::stringwiden (const std::string &s)
 

Handling of Environment Variables

std::string getEnvironmentVariable (const std::string &variableName, const std::string &defaultValue, bool reset=false)
 Reads an environment variable passed to the program at launch.
 
void setEnvironmentVariable (const std::string &variableName, const std::string &newValue)
 Writes an environment variable.
 

Handling of crashes

void installCrashHandler ()
 Install OS-specific hooks to catch and handle critical signals/exceptions.
 
void resetCrashHandler ()
 Remove crash hooks again.
 

Changing the byte order (endianness)

void swapEndianness (uint16_t *buffer, int64_t numElements)
 Reverses the order of bytes in the given buffer of 16-bit integers.
 
void swapEndianness (uint32_t *buffer, int64_t numElements)
 Reverses the order of bytes in the given buffer of 32-bit integers.
 
void swapEndianness (uint64_t *buffer, int64_t numElements)
 Reverses the order of bytes in the given buffer of 64-bit integers.
 
template<typename T>
void swapEndianness (T *buffer, int64_t numElements)
 Reverses the order of bytes in the given buffer of integers.
 

Type names

std::optional< std::stringdemangleTypeName (const std::type_info &typeInfo)
 Returns the demangled name of the type represented by the given type_info object.
 
template<typename T>
std::optional< std::stringdemangleTypeName ()
 Returns the demangled name of the type T.
 
Search Tab / S to search, Esc to close