ADTF
|
System or platform specific functions. More...
Classes | |
class | cAdapterInfo |
Helper class to store ethernet adapter infos, see cSystem::GetEthernetAdapterInfo. More... | |
class | IAdapterInfoCallback |
Callback for cSystem::GetEthernetAdapterInfo() More... | |
Static Public Member Functions | |
static tUInt32 | GetLastSystemError () |
Returns the last system error. More... | |
static cString | GetLastErrorString (const tUInt32 ui32Error) |
Returns a descriptive string of the last error. More... | |
static cString | GetEnvVariable (const cString &strName, const cString &strDefaultValue="") |
This function fetches values from the system's environment configuration. More... | |
static tResult | SetEnvVariable (const cString &strName, const cString &strValue) |
This function creates a system's environment variable for the current execution. More... | |
static cString | GetUserName () |
This function gets the user name currently logged on. More... | |
static cString | GetComputerName () |
This function gets the name of the local computer. More... | |
static tInt32 | Execute (const cFilename &strExeFile, const cString &strArgs="", const cFilename &strWorkingPath="", const tBool bModal=tFalse, cString *pOutput=nullptr, const cFilename oStdErrForward="") |
Starts an executable and optionally wait for the application to close down. More... | |
static tResult | ChildExecute (tUInt64 *pChildProcessId, const cFilename &strExeFile, const cString &strArgs="") |
Starts a child process. More... | |
static tResult | ChildWait (tUInt64 nChildProcessId, tTimeStamp tmTimeOut=-1) |
Wait until a child process exits. More... | |
static tResult | ChildTerminate (tUInt64 nChildProcessId) |
Terminates a child process. More... | |
static tUInt32 | OpenDocument (tHandle hWndParent, const cFilename &strFilename, const cString &strWorkingPath="", tBool bModal=tFalse, tBool bMessage=tFalse) |
Opens a document with the registered standard application. More... | |
static tUInt32 | OpenFolder (tHandle hWndParent, const cFilename &strFilename, tHandle &hProcessHandle, tBool bModal=tFalse) |
Opens an Explorer window that points to the specified folder. More... | |
static tTimeStamp | GetTime () |
On Windows platform method will return elapsed time in microseconds since the system was started. More... | |
static tVoid | Sleep (tTimeStamp tmMicroseconds) |
The calling thread will sleep for the specified amount of time. More... | |
static tResult | GetMACAddress (cString &strMACAddress) |
Returns the MAC Address of the first networking interface. More... | |
static tInt | GetProcessorCount () |
Returns the count of processors. More... | |
static tInt32 | GetCurrentThreadId () |
Returns the current thread id. More... | |
static tUInt64 | GetCurrentProcessId () |
Returns the current process id. More... | |
static tUInt64 | GetVirtualUserMemoryTotal () |
Returns the total amount of virtual memory for User-mode applications. More... | |
static tUInt64 | GetVirtualUserMemoryUsed () |
Returns the amount of virtual user memory currently used (process) More... | |
static tUInt64 | GetVirtualMemoryTotal () |
Returns the total amount of virtual memory. More... | |
static tUInt64 | GetVirtualMemoryUsed () |
Returns the amount of virtual memory currently used (system global) More... | |
static tUInt64 | GetVirtualMemoryUsedByMe () |
Returns the amount of virtual memory currently used by the calling process. More... | |
static tUInt64 | GetPhysicalMemoryTotal () |
Returns the total amount of physical memory. More... | |
static tUInt64 | GetPhysicalMemoryUsed (tBool bIncludeCaches=tFalse) |
Returns the amount of physical memory currently used (system global) More... | |
static tUInt64 | GetPhysicalMemoryUsedByMe () |
Returns the amount of physical memory currently used by the calling process. More... | |
static tResult | GetMallocInfo (tUInt64 &nMallocTotal, tUInt64 &nMallocFree, tUInt64 &nMallocUsed) |
Returns information about the status of malloc memory handling. More... | |
static tResult | HasIfaceWithMAC (const cString &strMACAddress) |
Checks whether he host as an interface with a specific MAC address. More... | |
static tBool | QueryDriveSpace (const cString &strDriveLetter, tUInt64 &uint64FreeSize) |
This Function retrieves the free disk space in bytes for the specified location (win32). More... | |
static tResult | SwapEndian (tUInt8 *pui8Value) |
Swaps the bytes of a 8 Bit value in place. More... | |
static tResult | SwapEndian (tInt8 *pi8Value) |
Swaps the bytes of a 8 Bit value in place. More... | |
static tResult | SwapEndian (tUInt16 *pui16Value) |
Swaps the bytes of a 16 Bit value in place. More... | |
static tResult | SwapEndian (tInt16 *pi16Value) |
Swaps the bytes of a 16 Bit value in place. More... | |
static tResult | SwapEndian (tUInt32 *pui32Value) |
Swaps the bytes of a 32 Bit value in place. More... | |
static tResult | SwapEndian (tInt32 *pi32Value) |
Swaps the bytes of a 32 Bit value in place. More... | |
static tResult | SwapEndian (tUInt64 *pui64Value) |
Swaps the bytes of a 64 Bit value in place. More... | |
static tResult | SwapEndian (tInt64 *pi64Value) |
Swaps the bytes of a 64 Bit value in place. More... | |
static tResult | HostToNetwork (tUInt16 *pui16Value) |
Swaps the bytes of a 16 Bit value from host to network byte order. More... | |
static tResult | HostToNetwork (tUInt32 *pui32Value) |
Swaps the bytes of a 32 Bit value from host to network byte order. More... | |
static tResult | HostToNetwork (tUInt64 *pui64Value) |
Swaps the bytes of a 64 Bit value from host to network byte order. More... | |
static tResult | NetworkToHost (tUInt16 *pui16Value) |
Swaps the bytes of a 16 Bit value from network to host byte order. More... | |
static tResult | NetworkToHost (tUInt32 *pui32Value) |
Swaps the bytes of a 32 Bit value from network to host byte order. More... | |
static tResult | NetworkToHost (tUInt64 *pui64Value) |
Swaps the bytes of a 64 Bit value from network to host byte order. More... | |
static tResult | SendMail (const cString &strOriginator, const cString &strOriginatorName, const cString &strRecipient, const cString &strRecipientName, const cString &strSubject, const cString &strText, const cString &strFilePath) |
Sends an email (win32). More... | |
static tResult | GetEthernetAdapterInfo (IAdapterInfoCallback *pAdapterInfo) |
Returns all detected ethernet adapters. More... | |
System or platform specific functions.
Definition at line 21 of file builds/digitalwerk/solutions/adtf_content/adtf_base/adtf_core/src/libraries/a_utils/include/a_utils/sys/system.h.
|
static |
Starts a child process.
[out] | pChildProcessId | The process id of the child process. |
[in] | strExeFile | The executable that should be launched. |
[in] | strArgs | Addidional arguments. |
Terminates a child process.
[in] | nChildProcessId | The process id of the child process. |
|
static |
Wait until a child process exits.
Note that after the process has exited, this method can only be called once.
[in] | nChildProcessId | The process id of the child process. |
[in] | tmTimeOut | Timeout in microseconds: -1 -> no timeout, 0 -> return immediately. |
|
static |
Starts an executable and optionally wait for the application to close down.
strExeFile | [in] Path to executable. |
strArgs | [in] Arguments to be passed to the executable. |
strWorkingPath | [in] Working path. If empty uses current working directory. |
bModal | [in] Bool that specifies if the function should wait for the application to close down. |
pOutput | [out] Optional: all output to stdout will be stored here. |
oStdErrForward | [in] This option will Forward the stderr to the given file (if set to "&1" it is forwarded to pOutput) |
|
static |
This function gets the name of the local computer.
|
static |
Returns the current process id.
|
static |
Returns the current thread id.
|
static |
This function fetches values from the system's environment configuration.
strName | [in] Name of environment variable to be fetched. |
strDefaultValue | [in] Value that is returned if the environment variable doesn't exist. |
|
static |
Returns all detected ethernet adapters.
[in,out] | pAdapterInfo | Callback for retrieval of all adapter information. |
Returns a descriptive string of the last error.
ui32Error | [in] An error code to be translated |
|
static |
Returns the last system error.
Returns the MAC Address of the first networking interface.
strMACAddress | [out] The destination string. |
|
static |
Returns information about the status of malloc memory handling.
[out] | nMallocTotal | The total amount of memory requested from the OS. |
[out] | nMallocFree | The unused portion of the requested memory. |
[out] | nMallocUsed | The used portion of the requested memory, this number tells how much memory your program uses. |
|
static |
Returns the total amount of physical memory.
Returns the amount of physical memory currently used (system global)
[in] | bIncludeCaches | Whether or not to include system caches and buffers into the calculation (This has no effect on Windows). |
|
static |
Returns the amount of physical memory currently used by the calling process.
|
static |
Returns the count of processors.
|
static |
On Windows platform method will return elapsed time in microseconds since the system was started.
On Linux platform method will return time in microseconds since some unspecified starting point.
|
static |
This function gets the user name currently logged on.
|
static |
Returns the total amount of virtual memory.
|
static |
Returns the amount of virtual memory currently used (system global)
|
static |
Returns the amount of virtual memory currently used by the calling process.
|
static |
Returns the total amount of virtual memory for User-mode applications.
|
static |
Returns the amount of virtual user memory currently used (process)
Checks whether he host as an interface with a specific MAC address.
strMACAddress | [in] The MAC address |
Swaps the bytes of a 16 Bit value from host to network byte order.
pui16Value | [inout] The value. |
Swaps the bytes of a 32 Bit value from host to network byte order.
pui32Value | [inout] The value. |
Swaps the bytes of a 64 Bit value from host to network byte order.
pui64Value | [inout] The value. |
Swaps the bytes of a 16 Bit value from network to host byte order.
pui16Value | [inout] The value. |
Swaps the bytes of a 32 Bit value from network to host byte order.
pui32Value | [inout] The value. |
Swaps the bytes of a 64 Bit value from network to host byte order.
pui64Value | [inout] The value. |
|
static |
Opens a document with the registered standard application.
REMARK: On Linux this command will call "kfmclient", "gnome-open", "gvfs-open" or "xdg-open" with the document name. Make sure one of these programs is installed on the system to make cSystem::OpenDocument work.
hWndParent | [in] Parent window for application (win32). Can be nullptr. |
strFilename | [in] Path to document. |
strWorkingPath | [in] Working path. |
bModal | [in] Bool that specifies if the function should wait for the application to close down. |
bMessage | [in] If true messages will be displayed |
|
static |
Opens an Explorer window that points to the specified folder.
This works only on windows. With Linux this method has no functionality and returns always with 0xFFFFFFFF
hWndParent | [in] Parent window for Exporer. |
strFilename | [in] Path to folder. |
hProcessHandle | [out] Process handle. |
bModal | [in] if true then the new window will be opened modal |
This Function retrieves the free disk space in bytes for the specified location (win32).
There is no functionality with linux and returns always with tFalse
strDriveLetter | [in] Specifies the root directory of the disk. A trailing backslash is required. |
uint64FreeSize | [out] free bytes |
|
static |
Sends an email (win32).
Under Linux this method has no functionality and returns always with ERR_NOT_SUPPORTED
strOriginator | [in] The senders mail address. |
strOriginatorName | [in] The senders name. |
strRecipient | [in] The recipients mali address. |
strRecipientName | [in] The recipients name. |
strSubject | [in] The subject of the message. |
strText | [in] The message content. |
strFilePath | [in] An attachment file. |
This function creates a system's environment variable for the current execution.
[in] | strName | Name of environment variable to set. |
[in] | strValue | Value to set. |
|
static |
The calling thread will sleep for the specified amount of time.
tmMicroseconds | [in] The time to sleep in microsenconds. |
Swaps the bytes of a 16 Bit value in place.
pi16Value | [inout] The value. |
Swaps the bytes of a 32 Bit value in place.
pi32Value | [inout] The value. |
Swaps the bytes of a 64 Bit value in place.
pi64Value | [inout] The value. |
Swaps the bytes of a 8 Bit value in place.
pi8Value | [inout] The value. |
Swaps the bytes of a 16 Bit value in place.
pui16Value | [inout] The value. |
Swaps the bytes of a 32 Bit value in place.
pui32Value | [inout] The value. |
Swaps the bytes of a 64 Bit value in place.
pui64Value | [inout] The value. |