CppCommon  1.0.4.1
C++ Common Library
Public Member Functions | Static Public Member Functions | List of all members
CppCommon::Environment Class Reference

Environment management static class. More...

#include <environment.h>

Public Member Functions

 Environment ()=delete
 
 Environment (const Environment &)=delete
 
 Environment (Environment &&)=delete
 
 ~Environment ()=delete
 
Environmentoperator= (const Environment &)=delete
 
Environmentoperator= (Environment &&)=delete
 

Static Public Member Functions

static bool Is32BitOS ()
 Is 32-bit OS? More...
 
static bool Is64BitOS ()
 Is 64-bit OS? More...
 
static bool Is32BitProcess ()
 Is 32-bit running process? More...
 
static bool Is64BitProcess ()
 Is 64-bit running process? More...
 
static bool IsDebug ()
 Is compiled in debug mode? More...
 
static bool IsRelease ()
 Is compiled in release mode? More...
 
static bool IsBigEndian ()
 Is big-endian system? More...
 
static bool IsLittleEndian ()
 Is little-endian system? More...
 
static std::string OSVersion ()
 Get OS version string. More...
 
static std::string EndLine ()
 Get text end line separator. More...
 
static std::string UnixEndLine ()
 Get Unix text end line separator. More...
 
static std::string WindowsEndLine ()
 Get Windows text end line separator. More...
 
static std::map< std::string, std::string > envars ()
 Get all environment variables. More...
 
static std::string GetEnvar (const std::string name)
 Get environment variable value by the given name. More...
 
static void SetEnvar (const std::string name, const std::string value)
 Set environment variable value by the given name. More...
 
static void ClearEnvar (const std::string name)
 Clear environment variable by the given name. More...
 

Detailed Description

Environment management static class.

Provides environment management functionality to get OS bit version, process bit version, debug/release mode.

Thread-safe.

Definition at line 26 of file environment.h.

Constructor & Destructor Documentation

◆ Environment() [1/3]

CppCommon::Environment::Environment ( )
delete

◆ Environment() [2/3]

CppCommon::Environment::Environment ( const Environment )
delete

◆ Environment() [3/3]

CppCommon::Environment::Environment ( Environment &&  )
delete

◆ ~Environment()

CppCommon::Environment::~Environment ( )
delete

Member Function Documentation

◆ ClearEnvar()

void CppCommon::Environment::ClearEnvar ( const std::string  name)
static

Clear environment variable by the given name.

Parameters
name- Environment variable name

Definition at line 504 of file environment.cpp.

◆ EndLine()

std::string CppCommon::Environment::EndLine ( )
static

Get text end line separator.

Examples
system_process_pipes.cpp.

Definition at line 415 of file environment.cpp.

◆ envars()

std::map< std::string, std::string > CppCommon::Environment::envars ( )
static

Get all environment variables.

Returns
Environment variables collection
Examples
system_environment.cpp.

Definition at line 436 of file environment.cpp.

◆ GetEnvar()

std::string CppCommon::Environment::GetEnvar ( const std::string  name)
static

Get environment variable value by the given name.

Parameters
name- Environment variable name
Returns
Environment variable value

Definition at line 473 of file environment.cpp.

◆ Is32BitOS()

bool CppCommon::Environment::Is32BitOS ( )
static

Is 32-bit OS?

Examples
system_environment.cpp.

Definition at line 41 of file environment.cpp.

◆ Is32BitProcess()

bool CppCommon::Environment::Is32BitProcess ( )
static

Is 32-bit running process?

Examples
system_environment.cpp.

Definition at line 65 of file environment.cpp.

◆ Is64BitOS()

bool CppCommon::Environment::Is64BitOS ( )
static

Is 64-bit OS?

Examples
system_environment.cpp.

Definition at line 46 of file environment.cpp.

◆ Is64BitProcess()

bool CppCommon::Environment::Is64BitProcess ( )
static

Is 64-bit running process?

Examples
system_environment.cpp.

Definition at line 70 of file environment.cpp.

◆ IsBigEndian()

bool CppCommon::Environment::IsBigEndian ( )
static

Is big-endian system?

Examples
system_environment.cpp.

Definition at line 103 of file environment.cpp.

◆ IsDebug()

bool CppCommon::Environment::IsDebug ( )
static

Is compiled in debug mode?

Examples
system_environment.cpp.

Definition at line 89 of file environment.cpp.

◆ IsLittleEndian()

bool CppCommon::Environment::IsLittleEndian ( )
static

Is little-endian system?

Examples
system_environment.cpp.

Definition at line 109 of file environment.cpp.

◆ IsRelease()

bool CppCommon::Environment::IsRelease ( )
static

Is compiled in release mode?

Examples
system_environment.cpp.

Definition at line 94 of file environment.cpp.

◆ operator=() [1/2]

Environment& CppCommon::Environment::operator= ( const Environment )
delete

◆ operator=() [2/2]

Environment& CppCommon::Environment::operator= ( Environment &&  )
delete

◆ OSVersion()

std::string CppCommon::Environment::OSVersion ( )
static

Get OS version string.

Examples
system_environment.cpp.

Definition at line 115 of file environment.cpp.

◆ SetEnvar()

void CppCommon::Environment::SetEnvar ( const std::string  name,
const std::string  value 
)
static

Set environment variable value by the given name.

Parameters
name- Environment variable name
value- Environment variable value

Definition at line 493 of file environment.cpp.

◆ UnixEndLine()

std::string CppCommon::Environment::UnixEndLine ( )
static

Get Unix text end line separator.

Definition at line 426 of file environment.cpp.

◆ WindowsEndLine()

std::string CppCommon::Environment::WindowsEndLine ( )
static

Get Windows text end line separator.

Definition at line 431 of file environment.cpp.


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