Asposecpplib
System::Environment Struct Reference

Environment services. This is a static type with no instance services. You should never create instances of it by any means. More...

Public Types

enum class  SpecialFolder {
  Desktop = 0 , Programs = 2 , Personal = 5 , MyDocuments = 5 ,
  Favorites = 6 , Startup = 7 , Recent = 8 , SendTo = 9 ,
  StartMenu = 11 , MyMusic = 13 , DesktopDirectory = 16 , MyComputer = 17 ,
  Templates = 21 , ApplicationData = 26 , LocalApplicationData = 28 , InternetCache = 32 ,
  Cookies = 33 , History = 34 , CommonApplicationData = 35 , System = 37 ,
  ProgramFiles = 38 , MyPictures = 39 , UserProfile = 40 , CommonProgramFiles = 43
}
 Represents system special folders. More...
 

Static Public Member Functions

static String get_CommandLine ()
 Returns the command line used to start the current process. More...
 
static String get_CurrentDirectory ()
 Returns the path to the current working directory. More...
 
static void set_CurrentDirectory (const String &path)
 Sets the specified directory as the current working directory. More...
 
static int get_ExitCode ()
 Returns the exit code for the current process. More...
 
static void set_ExitCode (int value)
 Sets the specified value as exit code for the current process. More...
 
static bool get_HasShutdownStarted ()
 Checks if shutdown is in progress. Not implemented. More...
 
static String get_MachineName ()
 Returns the NetBIOS name of this computer. More...
 
static String get_NewLine ()
 Returns the newline string set for the current environment. More...
 
static const OperatingSystemget_OSVersion ()
 Returns the OperatingSystem object that contains information about the current operating system. More...
 
static int get_ProcessorCount ()
 Returns the number of processors or the current machine. More...
 
static String get_StackTrace ()
 Returns the string that contains the current stack trace inofrmation. More...
 
static String get_SystemDirectory ()
 Returns the path to the system directory. More...
 
static int get_TickCount ()
 Returns the number of milliseconds passed since the system started. More...
 
static String get_UserDomainName ()
 Returns the network domain name of the current user. More...
 
static bool get_UserInteractive ()
 Determines whether the current process is running in user interactive mode. More...
 
static String get_UserName ()
 Returns the name of the user currently logged on to the Windows OS. More...
 
static Version get_Version ()
 Returns the Version object that represents the information about the version of the common language runtime. The version number returned by this method is rather dummy and does not mean that all library classes behave in accordance with the returned version. More...
 
static int64_t get_WorkingSet ()
 Returns the amount of physical memory mapped to the process context. More...
 
static void Exit (int exitCode)
 Terminates the current process and returns the specified exit code to the operating system. More...
 
static String ExpandEnvironmentVariables (const String &name)
 Replaces the names of environment variables found in the specified string with the values of those variables and returns the resulting string. More...
 
static void FailFast (const String &message)
 Aborts the current process. More...
 
static ArrayPtr< StringGetCommandLineArgs ()
 Returns an array containing the command-line arguments used to start the current process. More...
 
static String GetEnvironmentVariable (const String &variable)
 Returns the value of the specified environment varibale associated with the current process. More...
 
static String GetEnvironmentVariableA (const String &variable)
 Returns the value of the specified environment varibale associated with the current process. More...
 
static String GetEnvironmentVariableW (const String &variable)
 Returns the value of the specified environment varibale associated with the current process. More...
 
static String GetEnvironmentVariable (const String &variable, EnvironmentVariableTarget target)
 Returns the value of the specified environment varibale from the specified location. More...
 
static Collections::Generic::DictionaryPtr< String, StringGetEnvironmentVariables ()
 Returns a dictionary containing all environment variables names and their values associated with the current process. More...
 
static Collections::Generic::DictionaryPtr< String, StringGetEnvironmentVariables (EnvironmentVariableTarget target)
 Returns a dictionary containing all environment variables' names and their values from the specified location. More...
 
static String GetFolderPath (SpecialFolder folder)
 Returns fully qualified path to the specified system folder. More...
 
static ArrayPtr< StringGetLogicalDrives ()
 Returns an array containing the names of all logical drives on the current computer. More...
 
static void SetEnvironmentVariable (const String &variable, const String &value)
 NOT IMPLEMENTED. More...
 
static void SetEnvironmentVariable (const String &variable, const String &value, EnvironmentVariableTarget target)
 NOT IMPLEMENTED. More...
 
static bool IsWindowsSubsystemForLinux ()
 Returns true only for WSL. More...
 
static bool get_Is64BitProcess ()
 Returns true for 64-bit platform executables/libs. More...
 

Detailed Description

Environment services. This is a static type with no instance services. You should never create instances of it by any means.

Member Enumeration Documentation

◆ SpecialFolder

Represents system special folders.

Enumerator
Desktop 

The logical Desktop.

Programs 

The folder that contains the user's program groups.

Personal 

The folder that serves as a common repository for documents.

MyDocuments 

The "My Documents" directory.

Favorites 

The folder that serves as a common repository for the user's favorite items.

Startup 

The folder that corresponds to the user's Startup program group.

Recent 

The folder that contains the user's most recently used documents.

SendTo 

The folder that serves as a container for the Send To menu items.

StartMenu 

The folder that serves as a container for the Start menu items.

MyMusic 

The "My Music" directory.

DesktopDirectory 

The folder that is used to physically store items on the desktop.

MyComputer 

The "My Computer" directory.

Templates 

The folder that serves as a common container for document templates.

ApplicationData 

The folder that is used to store application-specific data for the current roaming user.

LocalApplicationData 

The folder that is used to store application-specific data for the current non-roaming user.

InternetCache 

The folder that is used as a storage for temporary Internet files.

Cookies 

The folder that is used as a storage for Internet cookies.

History 

The folder that is used as a storage for Internet history items.

CommonApplicationData 

The folder that is used to store application-specific data that is used by all users.

System 

The system folder.

ProgramFiles 

The program files folder.

MyPictures 

The "My picutres" folder.

UserProfile 

The user's profile folder.

CommonProgramFiles 

The directory used as a storage for components that are shared by applications.

Member Function Documentation

◆ Exit()

static void System::Environment::Exit ( int  exitCode)
static

Terminates the current process and returns the specified exit code to the operating system.

Parameters
exitCodeThe exit code to be returned to the operating system

◆ ExpandEnvironmentVariables()

static String System::Environment::ExpandEnvironmentVariables ( const String name)
static

Replaces the names of environment variables found in the specified string with the values of those variables and returns the resulting string.

Parameters
nameThe string containing the names of environment varibles
Returns
The string that results from replacing of the varibale names in name with their values.

◆ FailFast()

static void System::Environment::FailFast ( const String message)
static

Aborts the current process.

Parameters
messageIGNORED

◆ get_CommandLine()

static String System::Environment::get_CommandLine ( )
static

Returns the command line used to start the current process.

◆ get_CurrentDirectory()

static String System::Environment::get_CurrentDirectory ( )
static

Returns the path to the current working directory.

◆ get_ExitCode()

static int System::Environment::get_ExitCode ( )
static

Returns the exit code for the current process.

◆ get_HasShutdownStarted()

static bool System::Environment::get_HasShutdownStarted ( )
static

Checks if shutdown is in progress. Not implemented.

Returns
true if it is in progress, false otherwise.

◆ get_Is64BitProcess()

static bool System::Environment::get_Is64BitProcess ( )
static

Returns true for 64-bit platform executables/libs.

◆ get_MachineName()

static String System::Environment::get_MachineName ( )
static

Returns the NetBIOS name of this computer.

◆ get_NewLine()

static String System::Environment::get_NewLine ( )
static

Returns the newline string set for the current environment.

◆ get_OSVersion()

static const OperatingSystem& System::Environment::get_OSVersion ( )
static

Returns the OperatingSystem object that contains information about the current operating system.

◆ get_ProcessorCount()

static int System::Environment::get_ProcessorCount ( )
static

Returns the number of processors or the current machine.

◆ get_StackTrace()

static String System::Environment::get_StackTrace ( )
static

Returns the string that contains the current stack trace inofrmation.

◆ get_SystemDirectory()

static String System::Environment::get_SystemDirectory ( )
static

Returns the path to the system directory.

◆ get_TickCount()

static int System::Environment::get_TickCount ( )
static

Returns the number of milliseconds passed since the system started.

◆ get_UserDomainName()

static String System::Environment::get_UserDomainName ( )
static

Returns the network domain name of the current user.

◆ get_UserInteractive()

static bool System::Environment::get_UserInteractive ( )
static

Determines whether the current process is running in user interactive mode.

Returns
True if the current protess is running in user interactive mode, otherwise - false

◆ get_UserName()

static String System::Environment::get_UserName ( )
static

Returns the name of the user currently logged on to the Windows OS.

◆ get_Version()

static Version System::Environment::get_Version ( )
static

Returns the Version object that represents the information about the version of the common language runtime. The version number returned by this method is rather dummy and does not mean that all library classes behave in accordance with the returned version.

◆ get_WorkingSet()

static int64_t System::Environment::get_WorkingSet ( )
static

Returns the amount of physical memory mapped to the process context.

◆ GetCommandLineArgs()

static ArrayPtr<String> System::Environment::GetCommandLineArgs ( )
static

Returns an array containing the command-line arguments used to start the current process.

◆ GetEnvironmentVariable() [1/2]

static String System::Environment::GetEnvironmentVariable ( const String variable)
static

Returns the value of the specified environment varibale associated with the current process.

Parameters
variableThe string containing the name of the variable to retrieve
Returns
The value of the specified variable

◆ GetEnvironmentVariable() [2/2]

static String System::Environment::GetEnvironmentVariable ( const String variable,
EnvironmentVariableTarget  target 
)
static

Returns the value of the specified environment varibale from the specified location.

Parameters
variableThe string containing the name of the variable to retrieve
targetThe location of the variable
Returns
The value of the specified variable

◆ GetEnvironmentVariableA()

static String System::Environment::GetEnvironmentVariableA ( const String variable)
inlinestatic

Returns the value of the specified environment varibale associated with the current process.

Parameters
variableThe string containing the name of the variable to retrieve
Returns
The value of the specified variable

◆ GetEnvironmentVariables() [1/2]

static Collections::Generic::DictionaryPtr<String, String> System::Environment::GetEnvironmentVariables ( )
static

Returns a dictionary containing all environment variables names and their values associated with the current process.

◆ GetEnvironmentVariables() [2/2]

static Collections::Generic::DictionaryPtr<String, String> System::Environment::GetEnvironmentVariables ( EnvironmentVariableTarget  target)
static

Returns a dictionary containing all environment variables' names and their values from the specified location.

Parameters
targetThe location of the variables
Returns
A dictionary containing all environment variables' names and their values from the specified location

◆ GetEnvironmentVariableW()

static String System::Environment::GetEnvironmentVariableW ( const String variable)
inlinestatic

Returns the value of the specified environment varibale associated with the current process.

Parameters
variableThe string containing the name of the variable to retrieve
Returns
The value of the specified variable

◆ GetFolderPath()

static String System::Environment::GetFolderPath ( SpecialFolder  folder)
static

Returns fully qualified path to the specified system folder.

Parameters
folderValue representing the system folder
Returns
Fully qualified path to the specified system folder

◆ GetLogicalDrives()

static ArrayPtr<String> System::Environment::GetLogicalDrives ( )
static

Returns an array containing the names of all logical drives on the current computer.

◆ IsWindowsSubsystemForLinux()

static bool System::Environment::IsWindowsSubsystemForLinux ( )
static

Returns true only for WSL.

◆ set_CurrentDirectory()

static void System::Environment::set_CurrentDirectory ( const String path)
static

Sets the specified directory as the current working directory.

Parameters
pathThe fully qualified path to the directory to be set as current working directory

◆ set_ExitCode()

static void System::Environment::set_ExitCode ( int  value)
static

Sets the specified value as exit code for the current process.

Parameters
valueThe exit code to be set for the current process

◆ SetEnvironmentVariable() [1/2]

static void System::Environment::SetEnvironmentVariable ( const String variable,
const String value 
)
static

NOT IMPLEMENTED.

◆ SetEnvironmentVariable() [2/2]

static void System::Environment::SetEnvironmentVariable ( const String variable,
const String value,
EnvironmentVariableTarget  target 
)
static

NOT IMPLEMENTED.