35#define __XTD_CORE_INTERNAL__
40#undef __XTD_CORE_INTERNAL__
52#if !defined(__XTD_ROOT_PATH__)
53# define __XTD_ROOT_PATH__ ""
297 xtd_library() =
default;
298 xtd_library(
const xtd_library&) =
default;
299 xtd_library& operator =(
const xtd_library&) =
default;
330 bool equals(
const xtd_library&
other)
const noexcept override {
return name_ ==
other.name_ && version_ ==
other.version_ && include_path_ ==
other.include_path_ && library_path_ ==
other.library_path_ && resources_path_ ==
other.resources_path_;}
336 friend class environment;
340 xtd::
string include_path_;
341 xtd::
string library_path_;
342 xtd::
string resources_path_;
362 static auto version = __compiler_version;
440 template<class char_t, class traits_t>
441 static std::basic_ostream<char_t, traits_t>&
new_line(std::basic_ostream<char_t, traits_t>& os) {
441 static std::basic_ostream<char_t, traits_t>&
new_line(std::basic_ostream<char_t, traits_t>& os) {
…}
546 [[noreturn]] static
void exit();
661 static
void __signal_catcher_check__();
670 static signal_catcher signal_catcher_;
676 explicit operator auto()
const noexcept {
return xtd::enum_collection<xtd::environment::special_folder> {{
xtd::environment::special_folder::desktop,
"desktop"}, {
xtd::environment::special_folder::programs,
"programs"}, {
xtd::environment::special_folder::my_documents,
"my_documents"}, {
xtd::environment::special_folder::favorites,
"favorites"}, {
xtd::environment::special_folder::startup,
"startup"}, {
xtd::environment::special_folder::recent,
"recent"}, {
xtd::environment::special_folder::send_to,
"send_to"}, {
xtd::environment::special_folder::start_menu,
"start_menu"}, {
xtd::environment::special_folder::my_music,
"my_music"}, {
xtd::environment::special_folder::my_videos,
"my_videos"}, {
xtd::environment::special_folder::desktop_directory,
"desktop_directory"}, {
xtd::environment::special_folder::my_computer,
"my_computer"}, {
xtd::environment::special_folder::network_shortcuts,
"network_shortcuts"}, {
xtd::environment::special_folder::fonts,
"fonts"}, {
xtd::environment::special_folder::templates,
"templates"}, {
xtd::environment::special_folder::common_start_menu,
"common_start_menu"}, {
xtd::environment::special_folder::common_programs,
"common_programs"}, {
xtd::environment::special_folder::common_startup,
"common_startup"}, {
xtd::environment::special_folder::common_desktop_directory,
"common_desktop_directory"}, {
xtd::environment::special_folder::application_data,
"application_data"}, {
xtd::environment::special_folder::printer_shortcuts,
"printer_shortcuts"}, {
xtd::environment::special_folder::local_application_data,
"local_application_data"}, {
xtd::environment::special_folder::internet_cache,
"internet_cache"}, {
xtd::environment::special_folder::cookies,
"cookies"}, {
xtd::environment::special_folder::history,
"history"}, {
xtd::environment::special_folder::common_application_data,
"common_application_data"}, {
xtd::environment::special_folder::windows,
"windows"}, {
xtd::environment::special_folder::system,
"system"}, {
xtd::environment::special_folder::program_files,
"program_files"}, {
xtd::environment::special_folder::my_pictures,
"my_pictures"}, {
xtd::environment::special_folder::user_profile,
"user_profile"}, {
xtd::environment::special_folder::system_x86,
"system_x86"}, {
xtd::environment::special_folder::program_files_x86,
"program_files_x86"}, {
xtd::environment::special_folder::common_program_files,
"common_program_files"}, {
xtd::environment::special_folder::common_program_files_x86,
"common_program_files_x86"}, {
xtd::environment::special_folder::common_templates,
"common_templates"}, {
xtd::environment::special_folder::common_documents,
"common_documents"}, {
xtd::environment::special_folder::common_admin_tools,
"common_admin_tools"}, {
xtd::environment::special_folder::admin_tools,
"admin_tools"}, {
xtd::environment::special_folder::common_music,
"common_music"}, {
xtd::environment::special_folder::common_pictures,
"common_pictures"}, {
xtd::environment::special_folder::common_videos,
"common_videos"}, {
xtd::environment::special_folder::resources,
"resources"}, {
xtd::environment::special_folder::localized_resources,
"localized_resources"}, {
xtd::environment::special_folder::common_oem_links,
"common_oem_links"}, {
xtd::environment::special_folder::cd_burning,
"cd_burning"}, {
xtd::environment::special_folder::home,
"home"}, {
xtd::environment::special_folder::application_resources,
"application_resources"}, {
xtd::environment::special_folder::xtd_install,
"xtd_install"}, {
xtd::environment::special_folder::xtd_locale,
"xtd_locale"}, {
xtd::environment::special_folder::xtd_reference_guide,
"xtd_reference_guide"}, {
xtd::environment::special_folder::xtd_themes,
"xtd_themes"}, {
xtd::environment::special_folder::xtd_include,
"xtd_include"}, {
xtd::environment::special_folder::xtd_libraries,
"xtd_libraries"}, {
xtd::environment::special_folder::xtd_resources,
"xtd_resources"}, {
xtd::environment::special_folder::xtd_console_include,
"xtd_console_include"}, {
xtd::environment::special_folder::xtd_console_libraries,
"xtd_console_libraries"}, {
xtd::environment::special_folder::xtd_drawing_include,
"xtd_drawing_include"}, {
xtd::environment::special_folder::xtd_drawing_libraries,
"xtd_drawing_libraries"}, {
xtd::environment::special_folder::xtd_drawing_resources,
"xtd_drawing_resources"}, {
xtd::environment::special_folder::xtd_forms_include,
"xtd_forms_include"}, {
xtd::environment::special_folder::xtd_forms_libraries,
"xtd_forms_libraries"}, {
xtd::environment::special_folder::xtd_forms_resources,
"xtd_forms_resources"}, {
xtd::environment::special_folder::xtd_tunit_include,
"xtd_tunit_include"}, {
xtd::environment::special_folder::xtd_tunit_libraries,
"xtd_tunit_libraries"}};}
Contains __build_type definition.
Contains __compiler_id definition.
Contains __compiler_version definition.
Contains __cpp_language definition.
Contains xtd::argument_collection alias.
Contains xtd::argument_exception exception.
Contains availability versions.
bool is_empty() const noexcept
Definition basic_string.hpp:1471
Represents information about c++ libraries, such as the version and standard identifier....
Definition compiler.hpp:27
Represents information about c++ libraries, such as the version and language identifier....
Definition cpp_language.hpp:26
static source_location current(const __xtd_source_location__ &value=__xtd_source_location__::current()) noexcept
Crates a new xtd::diagnostics::source_location object corresponding to the location of the call site.
Represents a xtd library that contains name, version and paths.
Definition environment.hpp:294
const xtd::string & include_path() const noexcept
Gets The inlcude path of the library.
xtd::string to_string() const noexcept override
Returns a xtd::string that represents the current object.
const xtd::string & resources_path() const noexcept
Gets The resource path of the library.
const xtd::string & library_path() const noexcept
Gets The library path of the library.
bool equals(const object &other) const noexcept override
Determines whether the specified object is equal to the current object.
Definition environment.hpp:329
const xtd::version & version() const noexcept
Gets The version of the library.
const xtd::string & name() const noexcept
Gets The name of the library.
The environment class.
Definition environment.hpp:69
static event< environment, program_exit_event_handler > program_exit
Occurs when the terminates normally (via xtd::environment::exit or returning from the main function).
Definition environment.hpp:535
static uint32 processor_count()
Gets the number of processors on the current machine.
static void exit()
Terminates this process and returns an exit code to the operating system.
static std::chrono::milliseconds tick_count()
Gets the number of milliseconds elapsed since the system started.
static bool is_64_bit_operating_system() noexcept
Determines whether the current operating system is a 64-bit operating system.
static xtd::string new_line() noexcept
Gets the newline string defined for this environment.
static int64 working_set()
Gets the amount of physical memory mapped to the process context.
static bool has_shutdown_started()
Gets a value that indicates whether the current application domain is shutting down.
static xtd::string expand_environment_variables(const xtd::string &name)
Replaces the name of each environment variable embedded in the specified string with the string equiv...
static void set_environment_variable(const xtd::string &variable, const xtd::string &value)
Creates, modifies, or deletes an environment variable stored in the current process.
static xtd::argument_collection get_command_line_args()
Returns a string array containing the command-line arguments for the current process.
special_folder
Specifies enumerated constants used to retrieve directory paths to system special folders.
Definition environment.hpp:147
@ common_startup
The file system directory that contains the programs that appear in the Startup folder for all users....
Definition environment.hpp:185
@ xtd_locale
The xtd locale folder.
Definition environment.hpp:249
@ personal
The directory that serves as a common repository for documents. This member is equivalent to MyDocume...
Definition environment.hpp:155
@ printer_shortcuts
The file system directory that contains the link objects that can exist in the Printers virtual folde...
Definition environment.hpp:191
@ windows
The Windows directory or SYSROOT. This corresponds to the windir% or SYSTEMROOT% environment variable...
Definition environment.hpp:203
@ home
The file system directory that contains home folder.
Definition environment.hpp:243
@ xtd_drawing_libraries
The xtd::drawing libraries folder.
Definition environment.hpp:267
@ local_application_data
The directory that serves as a common repository for application-specific data that is used by the cu...
Definition environment.hpp:193
@ my_computer
The My Computer folder. The MyComputer constant always yields the empty string ("") because no path i...
Definition environment.hpp:173
@ user_profile
The user's profile folder. Applications should not create files or folders at this level; they should...
Definition environment.hpp:211
@ xtd_console_libraries
The xtd::console libraries folder.
Definition environment.hpp:263
@ common_application_data
The directory that serves as a common repository for application-specific data that is used by all us...
Definition environment.hpp:201
@ xtd_forms_resources
The xtd::forms resources folder.
Definition environment.hpp:275
@ xtd_forms_libraries
The xtd::forms libraries folder.
Definition environment.hpp:273
@ xtd_reference_guide
The xtd reference guide folder.
Definition environment.hpp:251
@ localized_resources
The file system directory that contains localized resource data.
Definition environment.hpp:237
@ common_program_files
The directory for components that are shared across applications.To get the x86 common program files ...
Definition environment.hpp:217
@ program_files
The program files directory.On a non-x86 system, passing ProgramFiles to the GetFolderPath method ret...
Definition environment.hpp:207
@ history
The directory that serves as a common repository for Internet history items.
Definition environment.hpp:199
@ xtd_console_include
The xtd::console include folder.
Definition environment.hpp:261
@ xtd_resources
The xtd resources folder.
Definition environment.hpp:259
@ common_videos
The file system directory that serves as a repository for video files common to all users.
Definition environment.hpp:233
@ common_admin_tools
The file system directory that contains administrative tools for all users of the computer.
Definition environment.hpp:225
@ programs
The directory that contains the user's program groups.
Definition environment.hpp:151
@ system
The System directory.
Definition environment.hpp:205
@ resources
The file system directory that contains resource data.
Definition environment.hpp:235
@ cookies
The directory that serves as a common repository for Internet cookies.
Definition environment.hpp:197
@ admin_tools
The file system directory that is used to store administrative tools for an individual user....
Definition environment.hpp:227
@ xtd_tunit_libraries
The xtd::tunit libraries folder.
Definition environment.hpp:279
@ common_desktop_directory
The file system directory that contains files and folders that appear on the desktop for all users....
Definition environment.hpp:187
@ common_start_menu
The file system directory that contains the programs and folders that appear on the Start menu for al...
Definition environment.hpp:181
@ xtd_drawing_include
The xtd::drawing include folder.
Definition environment.hpp:265
@ common_pictures
The file system directory that serves as a repository for image files common to all users.
Definition environment.hpp:231
@ my_music
The My Music folder.
Definition environment.hpp:167
@ desktop_directory
The directory used to physically store file objects on the desktop. Do not confuse this directory wit...
Definition environment.hpp:171
@ common_programs
A folder for components that are shared across applications. This special folder is valid only for Wi...
Definition environment.hpp:183
@ xtd_tunit_include
The xtd::tunit include folder.
Definition environment.hpp:277
@ xtd_include
The xtd inlude folder.
Definition environment.hpp:255
@ recent
The directory that contains the user's most recently used documents.
Definition environment.hpp:161
@ common_music
The file system directory that serves as a repository for music files common to all users.
Definition environment.hpp:229
@ my_pictures
The My Pictures folder.
Definition environment.hpp:209
@ fonts
A virtual folder that contains fonts.
Definition environment.hpp:177
@ xtd_install
The installation folder of xtd.
Definition environment.hpp:247
@ system_x86
The Windows System folder.
Definition environment.hpp:213
@ start_menu
The directory that contains the Start menu items.
Definition environment.hpp:165
@ my_documents
The My Documents folder. This member is equivalent to Personal.
Definition environment.hpp:153
@ xtd_forms_include
The xtd::forms include folder.
Definition environment.hpp:271
@ common_program_files_x86
The Program Files folder.
Definition environment.hpp:219
@ favorites
The directory that serves as a common repository for the user's favorite items.
Definition environment.hpp:157
@ desktop
The logical Desktop rather than the physical file system location.
Definition environment.hpp:149
@ network_shortcuts
A file system directory that contains the link objects that may exist in the My Network Places virtua...
Definition environment.hpp:175
@ internet_cache
The directory that serves as a common repository for temporary Internet files.
Definition environment.hpp:195
@ common_templates
The file system directory that contains the templates that are available to all users....
Definition environment.hpp:221
@ application_resources
The application resources folder.
Definition environment.hpp:245
@ send_to
The directory that contains the Send To menu items.
Definition environment.hpp:163
@ xtd_drawing_resources
The xtd::drawing resources folder.
Definition environment.hpp:269
@ application_data
The directory that serves as a common repository for application-specific data for the current roamin...
Definition environment.hpp:189
@ program_files_x86
The Program Files folder On an x86 system, passing the ProgramFilesX86 member to the Environment....
Definition environment.hpp:215
@ cd_burning
The file system directory that acts as a staging area for files waiting to be written to a CD.
Definition environment.hpp:241
@ startup
The directory that corresponds to the user's Startup program group. The system starts these programs ...
Definition environment.hpp:159
@ xtd_themes
The xtd themes folder.
Definition environment.hpp:253
@ common_oem_links
This value is recognized in Windows Vista for backward compatibility, but the special folder itself i...
Definition environment.hpp:239
@ my_videos
The file system directory that serves as a repository for videos that belong to a user.
Definition environment.hpp:169
@ common_documents
The file system directory that contains documents that are common to all users. This special folder i...
Definition environment.hpp:223
@ xtd_libraries
The xtd libraries folder.
Definition environment.hpp:257
@ templates
The directory that serves as a common repository for document templates.
Definition environment.hpp:179
static bool user_administrator()
Gets a value indicating whether the current user is an administrator.
static void current_directory(const xtd::string &directory_name)
Sets the fully qualified path of the current working directory.
static xtd::string command_line() noexcept
Gets the command line for this process.
static void raise(xtd::signal signal)
Sends xtd::signal to the program. The xtd::environment::cancel_signal event is invoked with the speci...
static xtd::string get_folder_path(environment::special_folder folder)
Gets the path to the system special folder that is identified by the specified enumeration.
Definition environment.hpp:613
static xtd::target_type target_type() noexcept
Gets an xtd::target_type object that contains the current target identifier.
Definition environment.hpp:474
static std::map< std::string, std::string > & get_environment_variables()
Retrieves all environment variable names and their values from the current process.
static event< environment, signal_cancel_event_handler > cancel_signal
Occurs when a signal is sent to the current process.
Definition environment.hpp:531
static xtd::cpp_language cpp_version() noexcept
Gets an xtd::cpp_language object that contains the current c++ standard identifier and version number...
Definition environment.hpp:370
static int32 current_managed_thread_id() noexcept
Gets a unique identifier for the current managed thread.
static intptr current_thread_id() noexcept
Gets a unique identifier for the current thread.
static bool is_64_bit_process() noexcept
Determines whether the current process is a 64-bit process.
static const xtd_library_collection & xtd_libraries() noexcept
Gets an xtd::environment::xtd_library array that represent the xtd libraries name,...
static xtd::operating_system os_version() noexcept
Gets an xtd::operating_system object that contains the current platform identifier and version number...
static xtd::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,...
Definition environment.hpp:620
static xtd::compiler compiler_version() noexcept
Gets an xtd::compiler object that contains the current compiler identifier and version number.
Definition environment.hpp:360
static void quick_exit() noexcept
Terminates this process and returns an exit code to the operating system without completely cleaning ...
xtd::collections::generic::list< xtd_library > xtd_library_collection
Represents a xtd libraries collection.
Definition environment.hpp:346
static xtd::string stack_trace()
Gets current stack trace information.
static xtd::string user_name()
Gets the user name of the person who is currently logged on to the operating system.
special_folder_option
Specifies options to use for getting the path to a special folder.
Definition environment.hpp:284
@ none
The path to the folder is verified. If the folder exists, the path is returned. If the folder does no...
Definition environment.hpp:286
@ create
The path to the folder is created if it does not already exist.
Definition environment.hpp:290
@ do_not_verify
The path to the folder is returned without verifying whether the path exists. If the folder is locate...
Definition environment.hpp:288
static xtd::version version() noexcept
Gets a version consisting of the major, minor, build, and revision numbers of the xtd framework.
static xtd::string user_domain_name()
Gets the network domain name associated with the current user.
static int32 exit_code() noexcept
Gets the exit code of the process.
static void abort()
Causes abnormal program termination unless xtd::signal::abnormal_termination is being caught by a xtd...
static xtd::string machine_name()
Gets the NetBIOS name of this local computer.
static std::locale locale() noexcept
Gets a copy of the global C++ locale, which is the locale most recently used as the argument to See s...
static xtd::string get_environment_variable(const xtd::string &variable)
Retrieves the value of an environment variable from the current process.
static xtd::collections::specialized::string_collection get_logical_drives()
Returns an array of string containing the names of the logical drives on the current computer.
static size_t system_page_size()
Gets the number of bytes in the operating system's memory page.
static xtd::string current_directory()
Gets the fully qualified path of the current working directory.
static bool user_interactive()
Gets a value indicating whether the current process is running in user interactive mode.
static xtd::processor processor_information()
Gets an xtd::processor object that contains the processor identifier.
static xtd::toolkit toolkit_version()
Gets the current toolkit version.
static xtd::string system_directory()
Gets the fully qualified path of the system directory.
Represents an event.
Definition event.hpp:21
Defines a generalized method that a value type or class implements to create a type-specific method f...
Definition iequatable.hpp:22
static xtd::string get_full_path(const xtd::string &path)
Returns the absolute path for the specified path string.
static xtd::string get_directory_name(const xtd::string &path)
Returns the directory information for the specified path string.
static xtd::string combine(const xtd::string &path1, const xtd::string &path2)
Combines two path strings.
Supports all classes in the xtd class hierarchy and provides low-level services to derived classes....
Definition object.hpp:44
Represents information about an operating system, such as the version and platform identifier....
Definition operating_system.hpp:25
Represents information about a processor, such as the architecture. This class cannot be inherited.
Definition processor.hpp:19
Provides data for the environment program exit event. This class cannot be inherited.
Definition program_exit_event_args.hpp:16
Provides data for the environment signal event. This class cannot be inherited.
Definition signal_cancel_event_args.hpp:18
Represents information about target type, such as the target identifier. This class cannot be inherit...
Definition target_type.hpp:17
Represents the version number of an assembly, operating system, or the xtd. This class cannot be inhe...
Definition version.hpp:114
Contains xtd::compiler class.
Contains core_export_ keyword.
Contains xtd::cpp_language class.
Contains xtd::io::directory class.
Contains enum_ and enum_ut_ keywords.
Contains xtd::environment_variable_target enum class.
Contains xtd::event event.
Contains xtd::exit_status enum class.
xtd::delegate< void(const program_exit_event_args &)> program_exit_event_handler
Represents the method that will handle the program exit events of a xtd::environment.
Definition program_exit_event_handler.hpp:24
xtd::delegate< void(signal_cancel_event_args &)> signal_cancel_event_handler
Represents the method that will handle the signal events of a xtd::environment.
Definition signal_cancel_event_handler.hpp:24
#define static_
This keyword is use to represent a static object. A static object can't be instantiated (constructors...
Definition static.hpp:37
#define core_export_
Define shared library export.
Definition core_export.hpp:13
xtd::collections::generic::list< xtd::string > string_collection
Represents a collection of strings.
Definition string_collection.hpp:27
xtd::basic_string< char > string
Represents text as a sequence of UTF-8 code units.
Definition __string_definitions.hpp:43
int32_t int32
Represents a 32-bit signed integer.
Definition int32.hpp:23
intmax_t intptr
Represent a pointer or a handle.
Definition intptr.hpp:23
int64_t int64
Represents a 64-bit signed integer.
Definition int64.hpp:23
uint32_t uint32
Represents a 32-bit unsigned integer.
Definition uint32.hpp:23
std::vector< std::pair< enum_t, xtd::string > > enum_collection
Represents a pair of an enum_t value and a string of an enum of type enum_t.
Definition enum_collection.hpp:24
signal
Specifies signals that can interrupt the current process.
Definition signal.hpp:18
exit_status
Specifies exit status for the xtd::environment::exit method.
Definition exit_status.hpp:18
type_t as(any_object &o)
Casts a type into another type.
Definition __as_any_object.hpp:59
environment_variable_target
Specifies the location where an environment variable is stored or retrieved in a set or get operation...
Definition environment_variable_target.hpp:15
bool is(xtd::any value)
Checks if the result of an expression is compatible with a given type.
Definition is.hpp:485
build_type
Identifies the build type.
Definition build_type.hpp:20
xtd::array< xtd::string > argument_collection
Represents the collection of arguments passed to the main entry point method.
Definition argument_collection.hpp:19
compiler_id
Identifies the compiler, supported by an assembly.
Definition compiler_id.hpp:20
@ other
The operating system is other.
Definition platform_id.hpp:58
@ c
The C key.
Definition console_key.hpp:92
@ e
The E key.
Definition console_key.hpp:96
Contains xtd::guid class.
Contains xtd::iequatable interface.
Contains xtd::collections::generic::list <value_t> class.
The xtd::collections namespace contains interfaces and classes that define various collections of obj...
Definition any_pair.hpp:10
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition abstract_object.hpp:8
bool equals(const object &obj) const noexcept override
Determines whether the specified object is equal to the current object.
Definition read_only_span.hpp:272
Contains xtd::operating_system class.
Contains xtd::io::path class.
Contains xtd::processor class.
Contains xtd::program_exit_event_handler event handler.
Contains xtd::signal_cancel_event_handler event handler.
Contains xtd::diagnostics::stack_trace class.
Contains xtd::static_object class.
Contains xtd::string alias.
Contains xtd::collections::specialized::string_collection typedef.
Contains xtd::target_id enum class.
Contains xtd::target_type class.
Contains xtd::version class.