xtd - Reference Guide  0.1.0 Modern c++17 framework to create console, gui and unit test applications on Windows, macOS and Linux.
xtd::environment Class Referencefinal

The environment class. More...

#include <environment.h>

Inheritance diagram for xtd::environment:

## Public Types

enum  special_folder {
special_folder::desktop = 0, special_folder::programs = 2, special_folder::my_documents = 5, special_folder::personal = 5,
special_folder::favorites = 6, special_folder::startup = 7, special_folder::recent = 8, special_folder::send_to = 9,
special_folder::start_menu = 11, special_folder::my_music = 13, special_folder::my_videos = 14, special_folder::desktop_directory = 16,
special_folder::my_computer = 17, special_folder::network_shortcuts = 19, special_folder::fonts = 20, special_folder::templates = 21,
special_folder::common_start_menu = 22, special_folder::common_programs = 23, special_folder::common_startup = 24, special_folder::common_desktop_directory = 25,
special_folder::application_data = 26, special_folder::printer_shortcuts = 27, special_folder::local_application_data = 28, special_folder::internet_cache = 32,
special_folder::cookies = 33, special_folder::history = 34, special_folder::common_application_data = 35, special_folder::windows = 36,
special_folder::system = 37, special_folder::program_files = 38, special_folder::my_pictures = 39, special_folder::user_profile = 40,
special_folder::system_x86 = 41, special_folder::program_files_x86 = 42, special_folder::common_program_files = 43, special_folder::common_program_files_x86 = 44,
special_folder::common_templates = 45, special_folder::common_documents = 46, special_folder::common_admin_tools = 47, special_folder::admin_tools = 48,
special_folder::common_music = 53, special_folder::common_pictures = 54, special_folder::common_videos = 55, special_folder::resources = 56,
special_folder::localized_resources = 57, special_folder::common_oem_links = 58, special_folder::cd_burning = 59, home = 60
}
Specifies enumerated constants used to retrieve directory paths to system special folders. More...

enum  special_folder_option { special_folder_option::none = 0, special_folder_option::do_not_verify = 16384, special_folder_option::create = 32768 }
Specifies options to use for getting the path to a special folder. More...

## Static Public Member Functions

static std::string command_line () noexcept
Gets the command line for this process. More...

static xtd::compiler compiler_version () noexcept
Gets an cpp_standard object that contains the current c++ standard identifier and version number. More...

static xtd::cpp_standard cpp_version () noexcept
Gets an cpp_standard object that contains the current c++ standard identifier and version number. More...

static std::string current_directory () noexcept
Gets the fully qualified path of the current working directory. More...

static void current_directory (const std::string &directory_name)
Sets the fully qualified path of the current working directory. More...

Gets a unique identifier for the current thread. More...

static void exit (int exit_code) noexcept
Terminates this process and returns an exit code to the operating system. More...

static int exit_code () noexcept

static void exit_code (int value) noexcept

static std::string expand_environment_variables (const std::string &name) noexcept
Replaces the name of each environment variable embedded in the specified string with the string equivalent of the value of the variable, then returns the resulting string. More...

static xtd::collections::specialized::string_vector get_command_line_args () noexcept
Returns a string array containing the command-line arguments for the current process. More...

static std::string get_environment_variable (const std::string &variable) noexcept
Retrieves the value of an environment variable from the current process. More...

static std::string get_environment_variable (const std::string &variable, environment_variable_target target)
Retrieves the value of an environment variable from the current process or from the Windows operating system registry key for the current user or local machine. More...

static std::map< std::string, std::string > & get_environment_variables () noexcept
Retrieves all environment variable names and their values from the current process. More...

static std::map< std::string, std::string > & get_environment_variables (environment_variable_target target)
Retrieves all environment variable names and their values from the current process, or from the Windows operating system registry key for the current user or local machine. More...

static std::string get_folder_path (environment::special_folder folder) noexcept
Gets the path to the system special folder that is identified by the specified enumeration. More...

static std::string get_folder_path (environment::special_folder folder, environment::special_folder_option option)
Gets the path to the system special folder that is identified by the specified enumeration, and uses a specified option for accessing special folders. More...

static xtd::collections::specialized::string_vector get_logical_drives () noexcept
Returns an array of string containing the names of the logical drives on the current computer. More...

static bool is_64_bit_operating_system () noexcept
Determines whether the current operating system is a 64-bit operating system. More...

static bool is_64_bit_process () noexcept
Determines whether the current process is a 64-bit process. More...

static std::string machine_name () noexcept
Gets the NetBIOS name of this local computer. More...

static std::string new_line () noexcept
Gets the newline string defined for this environment. More...

template<class Char , class Traits >
static std::basic_ostream< Char, Traits > & new_line (std::basic_ostream< Char, Traits > &os)
Inserts a new-line character and flushes the stream. More...

static xtd::operating_system os_version () noexcept
Gets an operating_system object that contains the current platform identifier and version number. More...

static unsigned int processor_count () noexcept
Gets the number of processors on the current machine. More...

static void set_environment_variable (const std::string &variable, const std::string &value)
Creates, modifies, or deletes an environment variable stored in the current process. More...

static void set_environment_variable (const std::string &variable, const std::string &value, environment_variable_target target)
Creates, modifies, or deletes an environment variable stored in the current process or in the Windows operating system registry key reserved for the current user or local machine. More...

static std::string stack_trace () noexcept
Gets current stack trace information. More...

static std::string system_directory () noexcept
Gets the fully qualified path of the system directory. More...

static size_t system_page_size () noexcept
Gets the number of bytes in the operating system's memory page. More...

static std::chrono::milliseconds tick_count () noexcept
Gets the number of milliseconds elapsed since the system started. More...

static std::string user_domain_name () noexcept
Gets the network domain name associated with the current user. More...

static bool user_interactive () noexcept
Gets a value indicating whether the current process is running in user interactive mode. More...

static std::string user_name () noexcept
Gets the user name of the person who is currently logged on to the operating system. More...

static xtd::version version () noexcept

## Detailed Description

The environment class.

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