Classes | Public Types | Static Public Member Functions | List of all members
istd::CSystem Class Reference

Implementation of global system helpers. More...

#include <CSystem.h>

Classes

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. More...
 
static bool ConvertToFileName (const QString &fileNameString, QString &fileName, const QString replacingChar=QString())
 Make a valid file name from a string. More...
 
static QString GetNormalizedPath (const QString &path)
 Get normalized path with enrolled system variables. More...
 
static QString GetVariableValue (const QString &varName, bool envVars=true, bool embeddedVars=true)
 Get value of system variables. More...
 
static QString GetEnrolledPath (const QString &path, bool envVars=true, bool embeddedVars=true)
 Get path with enrolled system variables. More...
 
static EnvironmentVariables GetEnvironmentVariables ()
 Get list of environment valiables related to the current process. More...
 
static void SetTempDirectoryPath (const QString &tempPath)
 Set path for for temporary data to the current process. More...
 
static void Sleep (double seconds)
 Sleep current thread. More...
 
static bool CopyDirectory (const QString &srcPath, const QString &dstPath)
 Copy files and directories from one folder to another. More...
 
static bool RemoveDirectory (const QString &directoryPath)
 Remove a given directory with all contents. More...
 
static bool FileCopy (const QString &source, const QString &result, bool overWrite=false)
 Copy file to directory. More...
 
static bool FileMove (const QString &source, const QString &targetFolder, bool overWrite=false)
 Move a file to another directory. More...
 
static bool EnsurePathExists (const QString &filePath)
 Ensure that the given path exists. More...
 
static QString GetCurrentUserName ()
 Get the name of the currently logged user. More...
 
static FileDriveInfo GetFileDriveInfo (const QString &fileDrivePath)
 Get the free space information for the given file drive. More...
 
static QString GetCompilerVariable (const QString &varName)
 Get compiler specific variable. More...
 
static void SetUserVariables (const QString &compilerMode, const QString &compilerName, const QString &platformCode)
 Set some user specific variables to override the generated by compiler. More...
 
static QString ConvertNetworkPathToUnc (const QString &localPath)
 Convert a mapped network path to UNC representation. More...
 

Detailed Description

Implementation of global system helpers.

Definition at line 24 of file CSystem.h.

Member Typedef Documentation

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

Definition at line 27 of file CSystem.h.

Member Function Documentation

static QString istd::CSystem::ConvertNetworkPathToUnc ( const QString &  localPath)
static

Convert a mapped network path to UNC representation.

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 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.
static bool istd::CSystem::CopyDirectory ( const QString &  srcPath,
const QString &  dstPath 
)
static

Copy files and directories from one folder to another.

static bool istd::CSystem::EnsurePathExists ( const QString &  filePath)
static
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.

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.

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.

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

Get the name of the currently logged user.

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

Get path with enrolled system variables.

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

Get list of environment valiables related to the current process.

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

Get the free space information for the given file drive.

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

Get normalized path with enrolled system variables.

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

Get the name of the operation system currently used.

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.
static bool istd::CSystem::RemoveDirectory ( const QString &  directoryPath)
static

Remove a given directory with all contents.

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

Set path for for temporary data to the current process.

static void istd::CSystem::SetUserVariables ( const QString &  compilerMode,
const QString &  compilerName,
const QString &  platformCode 
)
static

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

Parameters
compilerModetypically is 'Debug' or 'Release'.
compilerNamecode of compiler, e.g. 'VC12' or 'GCC'.
platformCodesuffix used typically to differentiate 32 and 64 bit mode - empty for 32 bit and 'x64' for 64 bit mode.
static void istd::CSystem::Sleep ( double  seconds)
static

Sleep current thread.


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

© 2007-2017 Witold Gantzke and Kirill Lepskiy