Nix (Dev) 3.5.10
dev - 3.5.10 - 1af9301
Loading...
Searching...
No Matches
CSystem Class Reference

#include <CSystem.hpp>

Static Public Member Functions

static void changeLanguage (const std::string &codeLanguage, const std::string &codeMessages, const std::string &codeMonetary, const std::string &codeNumeric)
 This function permit the user to change application's language.
 
static bool commandPassword (const std::string &txtTitle, uint32_t timeOut, std::string *password)
 Shows a password entry dialog.
 
static bool commandQuestion (const std::string &txtQuestion)
 Make a question on the screen.
 
static int32_t commandWithCodeError (const std::string &command)
 Execute a system's command.
 
static void logger (const std::string &environment, const char *strFormat,...) __attribute__((format(printf
 Create logs with the set of arguments provided.
 
static void static void reboot ()
 Begin a reboot process.
 
static void sleepMilliseconds (uint64_t milliseconds)
 Generate a milliseconds sleep.
 
static void shutdown ()
 Begin a shutdown process.
 
static void getCpuInfo (std::string *stepping, std::string *model, std::string *family, std::string *processorType, std::string *extendedModel, std::string *extendedFamily)
 Returns the CPU information.
 
static std::string getCPUSerial ()
 Returns the CPU serial.
 
static std::string getVolumeSerial ()
 Gets the volume serial. If it is not possible to get one, it provides "nvme0n1" as the default.
 
static bool ping (const std::string &ipAddress, float timeOutInSec)
 Ping the given IP address using the internal ping command.
 
static bool startService (std::string_view serviceName)
 
static bool stopService (std::string_view serviceName)
 
static bool enableService (const std::string serviceName)
 
static bool isServiceRunning (std::string_view serviceName)
 Checks if a service is running.
 
static void changeGmt (std::string_view gmt)
 Change the GMT area to the one given.
 

Member Function Documentation

◆ changeGmt()

void CSystem::changeGmt ( std::string_view gmt)
static

Change the GMT area to the one given.

Parameters
gmtThe new GMT area

◆ changeLanguage()

void CSystem::changeLanguage ( const std::string & codeLanguage,
const std::string & codeMessages,
const std::string & codeMonetary,
const std::string & codeNumeric )
static

This function permit the user to change application's language.

Parameters
codeLanguageLanguage locale code
codeMessagesMessages locale code
codeMonetaryMonetary locale code
codeNumericNumeric locale code

◆ commandPassword()

bool CSystem::commandPassword ( const std::string & txtTitle,
uint32_t timeOut,
std::string * password )
static

Shows a password entry dialog.

Parameters
txtTitleDialog's title
timeOutTime the dialog is active
passwordOutput param with the user's password
Returns
TRUE if user has entry a password, otherwise return FALSE

◆ commandQuestion()

bool CSystem::commandQuestion ( const std::string & txtQuestion)
static

Make a question on the screen.

Parameters
txtQuestionString with the question
Returns
TRUE if the user pressed OK, otherwise return FALSE

◆ commandWithCodeError()

int32_t CSystem::commandWithCodeError ( const std::string & command)
static

Execute a system's command.

Parameters
commandString which contains the command to be executed
Returns
CodeError of the execution

◆ enableService()

bool CSystem::enableService ( const std::string serviceName)
static

◆ getCpuInfo()

void CSystem::getCpuInfo ( std::string * stepping,
std::string * model,
std::string * family,
std::string * processorType,
std::string * extendedModel,
std::string * extendedFamily )
static

Returns the CPU information.

Parameters
steppingThe string pointer where to save the stepping info
modelThe string pointer where to save the model info
familyThe string pointer where to save the family info
processorTypeThe string pointer where to save the processor type
extendedModelThe string pointer where to save the extended model info
extendedFamilyThe string pointer where to save the extended family info

◆ getCPUSerial()

std::string CSystem::getCPUSerial ( )
static

Returns the CPU serial.

Returns
CPU serial

◆ getVolumeSerial()

std::string CSystem::getVolumeSerial ( )
static

Gets the volume serial. If it is not possible to get one, it provides "nvme0n1" as the default.

Returns
std::string The serial

◆ isServiceRunning()

bool CSystem::isServiceRunning ( std::string_view serviceName)
static

Checks if a service is running.

Parameters
serviceNameName of the service to check
Returns
TRUE if the service is actually running, otherwise return FALSE

◆ logger()

void CSystem::logger ( const std::string & environment,
const char * strFormat,
... )
static

Create logs with the set of arguments provided.

Parameters
environmentThe prepended string to every message
strFormatFormat to follow
...The set of arguments whence create the logs

◆ ping()

bool CSystem::ping ( const std::string & ipAddress,
float timeOutInSec )
static

Ping the given IP address using the internal ping command.

Parameters
ipAddressString with the IP address to ping
timeOutInSecTime in seconds to wait for the response
Returns
TRUE if the ping was successful, otherwise return FALSE

◆ reboot()

void CSystem::reboot ( )
static

Begin a reboot process.

◆ shutdown()

void CSystem::shutdown ( )
static

Begin a shutdown process.

◆ sleepMilliseconds()

void CSystem::sleepMilliseconds ( uint64_t milliseconds)
static

Generate a milliseconds sleep.

Parameters
millisecondsTime in milliseconds to sleep

◆ startService()

bool CSystem::startService ( std::string_view serviceName)
static

◆ stopService()

bool CSystem::stopService ( std::string_view serviceName)
static

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