ICF 3.0.5.47
Technical documentation of ICF Libraries
istd::CSystem Class Reference

Implementation of global system helpers. More...

#include <CSystem.h>

Collaboration diagram for istd::CSystem:

Classes

struct  FileDriveDescriptor
 
struct  FileDriveInfo
 

Public Types

typedef QMap< QString, QString > EnvironmentVariables
 

Static Public Member Functions

static QString GetOperationSystemName ()
 Get the name of the operation system currently used.
 
static bool ConvertToFileName (const QString &fileNameString, QString &fileName, const QString replacingChar=QString())
 Make a valid file name from a string.
 
static QString GetNormalizedPath (const QString &path)
 Get normalized path with enrolled system variables.
 
static QString GetVariableValue (const QString &varName, bool envVars=true, bool embeddedVars=true)
 Get value of system variables.
 
static QString GetEnrolledPath (const QString &path, bool envVars=true, bool embeddedVars=true)
 Get path with enrolled system variables.
 
static EnvironmentVariables GetEnvironmentVariables ()
 Get list of environment valiables related to the current process.
 
static void SetTempDirectoryPath (const QString &tempPath)
 Set path for for temporary data to the current process.
 
static bool CopyDirectory (const QString &srcPath, const QString &dstPath)
 Copy files and directories from one folder to another.
 
static bool RemoveDirectory (const QString &directoryPath)
 Remove a given directory with all contents.
 
static bool FileCopy (const QString &source, const QString &result, bool overWrite=false)
 Copy file to directory.
 
static bool FileMove (const QString &source, const QString &targetFolder, bool overWrite=false)
 Move a file to another directory.
 
static bool EnsurePathExists (const QString &filePath)
 Ensure that the given path exists.
 
static QString GetCurrentUserName ()
 Get the name of the currently logged user.
 
static FileDriveInfo GetFileDriveInfo (const QString &fileDrivePath)
 Get the free space information for the given file drive.
 
static QString GetCompilerVariable (const QString &varName)
 Get compiler specific variable.
 
static void SetUserVariables (const QString *applicationDirPtr=nullptr, const QString *compilerModePtr=nullptr, const QString *compilerNamePtr=nullptr, const QString *platformCodePtr=nullptr)
 Set some user specific variables to override the generated by compiler.
 

Detailed Description

Implementation of global system helpers.

Definition at line 24 of file CSystem.h.

Member Typedef Documentation

◆ EnvironmentVariables

QMap<QString, QString> istd::CSystem::EnvironmentVariables

Definition at line 27 of file CSystem.h.

Member Function Documentation

◆ ConvertToFileName()

static bool istd::CSystem::ConvertToFileName ( const QString & fileNameString,
QString & fileName,
const QString replacingChar = QString() )
static

Make a valid file name from a string.

All not allowed characters in the fileNameString will be replaced by a valid symbol defined in c\replacingChar or removed if this parameter is not set.

Parameters
fileNameStringInput string representing the file name
fileNameResulting file name if the conversion was successful.
Returns
true if the operation was successful, otherwise false.

◆ CopyDirectory()

static bool istd::CSystem::CopyDirectory ( const QString & srcPath,
const QString & dstPath )
static

Copy files and directories from one folder to another.

◆ EnsurePathExists()

static bool istd::CSystem::EnsurePathExists ( const QString & filePath)
static

◆ FileCopy()

static bool istd::CSystem::FileCopy ( const QString & source,
const QString & result,
bool overWrite = false )
static

Copy file to directory.

If the target directory doesn't exist, it will be created.

◆ FileMove()

static bool istd::CSystem::FileMove ( const QString & source,
const QString & targetFolder,
bool overWrite = false )
static

Move a file to another directory.

If the target directory doesn't exist, it will be created.

◆ GetCompilerVariable()

static QString istd::CSystem::GetCompilerVariable ( const QString & varName)
static

Get compiler specific variable.

Please note, that this variable depends only on compiler time state and cannot be set by application. To use 'logical value' of variable you should use GetVariableValue.

◆ GetCurrentUserName()

static QString istd::CSystem::GetCurrentUserName ( )
static

Get the name of the currently logged user.

◆ GetEnrolledPath()

static QString istd::CSystem::GetEnrolledPath ( const QString & path,
bool envVars = true,
bool embeddedVars = true )
static

Get path with enrolled system variables.

◆ GetEnvironmentVariables()

static EnvironmentVariables istd::CSystem::GetEnvironmentVariables ( )
static

Get list of environment valiables related to the current process.

◆ GetFileDriveInfo()

static FileDriveInfo istd::CSystem::GetFileDriveInfo ( const QString & fileDrivePath)
static

Get the free space information for the given file drive.

◆ GetNormalizedPath()

static QString istd::CSystem::GetNormalizedPath ( const QString & path)
static

Get normalized path with enrolled system variables.

◆ GetOperationSystemName()

static QString istd::CSystem::GetOperationSystemName ( )
static

Get the name of the operation system currently used.

◆ GetVariableValue()

static QString istd::CSystem::GetVariableValue ( const QString & varName,
bool envVars = true,
bool embeddedVars = true )
static

Get value of system variables.

Parameters
varNamename of variable.
envVarsif enabled, the system environment variables will be also considered.

◆ RemoveDirectory()

static bool istd::CSystem::RemoveDirectory ( const QString & directoryPath)
static

Remove a given directory with all contents.

◆ SetTempDirectoryPath()

static void istd::CSystem::SetTempDirectoryPath ( const QString & tempPath)
static

Set path for for temporary data to the current process.

◆ SetUserVariables()

static void istd::CSystem::SetUserVariables ( const QString * applicationDirPtr = nullptr,
const QString * compilerModePtr = nullptr,
const QString * compilerNamePtr = nullptr,
const QString * platformCodePtr = nullptr )
static

Set some user specific variables to override the generated by compiler.

Parameters
applicationDirPtrPath to application.
compilerModePtrtypically is 'Debug' or 'Release'.
compilerNamePtrcode of compiler, e.g. 'VC12' or 'GCC'.
platformCodePtrsuffix used typically to differentiate 32 and 64 bit mode - empty for 32 bit and 'x64' for 64 bit mode.

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

© Witold Gantzke and Kirill Lepskiy