System::Environment Struct Reference

Public Types

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

Static Public Member Functions

static ASPOSECPP_SHARED_API String get_CommandLine ()
 Returns the command line used to start the current process. More...
 
static ASPOSECPP_SHARED_API String get_CurrentDirectory ()
 Returns the path to the current working directory. More...
 
static ASPOSECPP_SHARED_API void set_CurrentDirectory (const String &path)
 
static ASPOSECPP_SHARED_API int get_ExitCode ()
 Returns the exit code for the current process. More...
 
static ASPOSECPP_SHARED_API void set_ExitCode (int value)
 
static ASPOSECPP_SHARED_API bool get_HasShutdownStarted ()
 
static ASPOSECPP_SHARED_API String get_MachineName ()
 Returns the NetBIOS name of this computer. More...
 
static ASPOSECPP_SHARED_API String get_NewLine ()
 Returns the newline string set for the current environment. More...
 
static ASPOSECPP_SHARED_API const OperatingSystemget_OSVersion ()
 Returns the OperatingSystem object that contains information about the current operating system. More...
 
static ASPOSECPP_SHARED_API int get_ProcessorCount ()
 Returns the number of processors or the current machine. More...
 
static ASPOSECPP_SHARED_API String get_StackTrace ()
 Returns the string that contains the current stack trace inofrmation. More...
 
static ASPOSECPP_SHARED_API String get_SystemDirectory ()
 Returns the path to the system directory. More...
 
static ASPOSECPP_SHARED_API int get_TickCount ()
 Returns the number of milliseconds passed since the system started. More...
 
static ASPOSECPP_SHARED_API String get_UserDomainName ()
 Returns the network domain name of the current user. More...
 
static ASPOSECPP_SHARED_API bool get_UserInteractive ()
 
static ASPOSECPP_SHARED_API String get_UserName ()
 Returns the name of the user currently logged on to the Windows OS. More...
 
static ASPOSECPP_SHARED_API Version get_Version ()
 
static ASPOSECPP_SHARED_API int64_t get_WorkingSet ()
 Returns the amount of physical memory mapped to the process context. More...
 
static ASPOSECPP_SHARED_API void Exit (int exitCode)
 
static ASPOSECPP_SHARED_API String ExpandEnvironmentVariables (const String &name)
 
static ASPOSECPP_SHARED_API void FailFast (const String &message)
 
static ASPOSECPP_SHARED_API ArrayPtr< StringGetCommandLineArgs ()
 Returns an array containing the command-line arguments used to start the current process. More...
 
static ASPOSECPP_SHARED_API String GetEnvironmentVariable (const String &variable)
 
static String GetEnvironmentVariableA (const String &variable)
 
static String GetEnvironmentVariableW (const String &variable)
 
static ASPOSECPP_SHARED_API String GetEnvironmentVariable (const String &variable, EnvironmentVariableTarget target)
 
static ASPOSECPP_SHARED_API Collections::Generic::DictionaryPtr< String, StringGetEnvironmentVariables ()
 Returns a dictionary containing all environment variables names and their values associated with the current process. More...
 
static ASPOSECPP_SHARED_API Collections::Generic::DictionaryPtr< String, StringGetEnvironmentVariables (EnvironmentVariableTarget target)
 
static ASPOSECPP_SHARED_API String GetFolderPath (SpecialFolder folder)
 
static ASPOSECPP_SHARED_API ArrayPtr< StringGetLogicalDrives ()
 Returns an array containing the names of all logical drives on the current computer. More...
 
static ASPOSECPP_SHARED_API void SetEnvironmentVariable (const String &variable, const String &value)
 NOT IMPLEMENTED. More...
 
static ASPOSECPP_SHARED_API void SetEnvironmentVariable (const String &variable, const String &value, EnvironmentVariableTarget target)
 NOT IMPLEMENTED. More...
 
static ASPOSECPP_SHARED_API bool IsWindowsSubsystemForLinux ()
 Returns true only for WSL. More...
 
static ASPOSECPP_SHARED_API 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 ASPOSECPP_SHARED_API 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 ASPOSECPP_SHARED_API 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 ASPOSECPP_SHARED_API void System::Environment::FailFast ( const String message)
static

Aborts the current process.

Parameters
messageIGNORED

◆ get_CommandLine()

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

Returns the command line used to start the current process.

◆ get_CurrentDirectory()

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

Returns the path to the current working directory.

◆ get_ExitCode()

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

Returns the exit code for the current process.

◆ get_HasShutdownStarted()

static ASPOSECPP_SHARED_API 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 ASPOSECPP_SHARED_API bool System::Environment::get_Is64BitProcess ( )
static

Returns true for 64-bit platform executables/libs.

◆ get_MachineName()

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

Returns the NetBIOS name of this computer.

◆ get_NewLine()

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

Returns the newline string set for the current environment.

◆ get_OSVersion()

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

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

◆ get_ProcessorCount()

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

Returns the number of processors or the current machine.

◆ get_StackTrace()

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

Returns the string that contains the current stack trace inofrmation.

◆ get_SystemDirectory()

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

Returns the path to the system directory.

◆ get_TickCount()

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

Returns the number of milliseconds passed since the system started.

◆ get_UserDomainName()

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

Returns the network domain name of the current user.

◆ get_UserInteractive()

static ASPOSECPP_SHARED_API 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 ASPOSECPP_SHARED_API String System::Environment::get_UserName ( )
static

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

◆ get_Version()

static ASPOSECPP_SHARED_API 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 ASPOSECPP_SHARED_API int64_t System::Environment::get_WorkingSet ( )
static

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

◆ GetCommandLineArgs()

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

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

◆ GetEnvironmentVariable() [1/2]

static ASPOSECPP_SHARED_API 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 ASPOSECPP_SHARED_API 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 ASPOSECPP_SHARED_API 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 ASPOSECPP_SHARED_API 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 ASPOSECPP_SHARED_API 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 ASPOSECPP_SHARED_API ArrayPtr<String> System::Environment::GetLogicalDrives ( )
static

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

◆ IsWindowsSubsystemForLinux()

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

Returns true only for WSL.

◆ set_CurrentDirectory()

static ASPOSECPP_SHARED_API 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 ASPOSECPP_SHARED_API 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 ASPOSECPP_SHARED_API void System::Environment::SetEnvironmentVariable ( const String variable,
const String value 
)
static

NOT IMPLEMENTED.

◆ SetEnvironmentVariable() [2/2]

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

NOT IMPLEMENTED.