11 #include "core_export.h" 28 #define __XTD_CORE_INTERNAL__ 29 #include "internal/__build_type.h" 30 #include "internal/__compiler_id.h" 31 #include "internal/__compiler_version.h" 32 #include "internal/__cpp_language.h" 33 #undef __XTD_CORE_INTERNAL__ 55 #if !defined(__XTD_INCLUDE_PATH__) || !defined(__XTD_LIB_PATH__) || !defined(__XTD_CONSOLE_INCLUDE_PATH__) || !defined(__XTD_CONSOLE_LIB_PATH__) || !defined(__XTD_DRAWING_INCLUDE_PATH__) || !defined(__XTD_DRAWING_LIB_PATH__) || !defined(__XTD_DRAWING_RESOURCES_PATH__) || !defined(__XTD_FORMS_INCLUDE_PATH__) || !defined(__XTD_FORMS_LIB_PATH__) || !defined(__XTD_FORMS_RESOURCES_PATH__) || !defined(__XTD_TUNIT_INCLUDE_PATH__) || !defined(__XTD_TUNIT_LIB_PATH__) 56 #error "Some variables (like __XTD_INCLUDE_PATH__) are not defined. This is probably because you are not using CMake to generate your project. See the following link for more information: https://gammasoft71.github.io/xtd/docs/documentation/Guides/xtd.cmake/Overview..." 174 desktop_directory = 16,
178 network_shortcuts = 19,
184 common_start_menu = 22,
186 common_programs = 23,
190 common_desktop_directory = 25,
192 application_data = 26,
194 printer_shortcuts = 27,
196 local_application_data = 28,
204 common_application_data = 35,
218 program_files_x86 = 42,
220 common_program_files = 43,
222 common_program_files_x86 = 44,
224 common_templates = 45,
226 common_documents = 46,
228 common_admin_tools = 47,
234 common_pictures = 54,
240 localized_resources = 57,
242 common_oem_links = 58,
252 xtd_reference_guide = 1002,
258 xtd_libraries = 1005,
260 xtd_resources = 1006,
262 xtd_console_include = 1007,
264 xtd_console_libraries = 1008,
266 xtd_drawing_include = 1009,
268 xtd_drawing_libraries = 1010,
270 xtd_drawing_resources = 1011,
272 xtd_forms_include = 1012,
274 xtd_forms_libraries = 1013,
276 xtd_forms_resources = 1014,
278 xtd_tunit_include = 1015,
280 xtd_tunit_libraries = 1016,
289 do_not_verify = 16384,
360 static auto version = __compiler_version;
385 static void current_directory(
const xtd::ustring& directory_name);
389 static int32 current_managed_thread_id() noexcept;
393 static intptr current_thread_id() noexcept;
400 static int32 exit_code() noexcept;
406 static void exit_code(
int32 value) noexcept;
411 static bool has_shutdown_started();
415 static bool is_64_bit_operating_system() noexcept;
419 static bool is_64_bit_process() noexcept;
424 static std::locale locale() noexcept;
438 template <
class char_t,
class traits_t>
439 static std::basic_ostream<char_t, traits_t>&
new_line(std::basic_ostream<char_t, traits_t>& os) {
440 for (
auto c : new_line())
452 static uint32 processor_count();
469 static size_t system_page_size();
479 static std::chrono::milliseconds tick_count();
488 static bool user_administrator();
499 static bool user_interactive();
515 static int64 working_set();
545 [[noreturn]]
static void exit();
549 [[noreturn]]
static void exit(
int32 exit_code);
598 static std::map<std::string, std::string>& get_environment_variables();
627 [[noreturn]]
static void quick_exit() noexcept;
631 [[noreturn]] static
void quick_exit(
int32 exit_code) noexcept;
659 static
void __signal_catcher_check__();
666 inline static constexpr const
char* xtd_include_path = __XTD_INCLUDE_PATH__;
667 inline static constexpr const
char* xtd_libraries_path = __XTD_LIB_PATH__;
668 inline static constexpr const
char* xtd_resources_path = __XTD_RESOURCES_PATH__;
669 inline static constexpr const
char* xtd_console_include_path = __XTD_CONSOLE_INCLUDE_PATH__;
670 inline static constexpr const
char* xtd_console_libraries_path = __XTD_CONSOLE_LIB_PATH__;
671 inline static constexpr const
char* xtd_drawing_include_path = __XTD_DRAWING_INCLUDE_PATH__;
672 inline static constexpr const
char* xtd_drawing_libraries_path = __XTD_DRAWING_LIB_PATH__;
673 inline static constexpr const
char* xtd_drawing_resources_path = __XTD_DRAWING_RESOURCES_PATH__;
674 inline static constexpr const
char* xtd_forms_include_path = __XTD_FORMS_INCLUDE_PATH__;
675 inline static constexpr const
char* xtd_forms_libraries_path = __XTD_FORMS_LIB_PATH__;
676 inline static constexpr const
char* xtd_forms_resources_path = __XTD_FORMS_RESOURCES_PATH__;
677 inline static constexpr const
char* xtd_tunit_include_path = __XTD_TUNIT_INCLUDE_PATH__;
678 inline static constexpr const
char* xtd_tunit_libraries_path = __XTD_TUNIT_LIB_PATH__;
679 static signal_catcher signal_catcher_;
685 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::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"}};}
Provides data for the environment program exit event. This class cannot be inherited.
Definition: program_exit_event_args.h:16
signal
Specifies signals that can interrupt the current process.
Definition: signal.h:18
Contains xtd::diagnostics::stack_trace class.
The file system directory that contains the programs that appear in the Startup folder for all users...
The file system directory that serves as a repository for videos that belong to a user...
The xtd::console libraries folder.
Contains xtd::static_object class.
Defines the xtd::startup object that can be used in the main method to safely call the application's ...
Definition: startup.h:20
A folder for components that are shared across applications. This special folder is valid only for Wi...
Represents a xtd library that contains name, version and paths.
Definition: environment.h:295
Represents information about c++ libraries, such as the version and standard identifier. This class cannot be inherited.
Definition: compiler.h:25
The Windows System folder.
compiler_id
Identifies the compiler, supported by an assembly.
Definition: compiler_id.h:18
Represents information about target type, such as the target identifier. This class cannot be inherit...
Definition: target_type.h:17
Contains xtd::operating_system class.
The file system directory that contains resource data.
build_type
Identifies the build type.
Definition: build_type.h:18
The Program Files folder.
intmax_t intptr
Represent a pointer or a handle.
Definition: types.h:151
The xtd resources folder.
The directory that contains the user's program groups.
special_folder
Definition: environment.h:150
#define static_
This keyword is use to represent a static object. A static object can't be instantiated (constructors...
Definition: static.h:37
The file system directory that contains the link objects that can exist in the Printers virtual folde...
The xtd::tunit libraries folder.
The path to the folder is verified. If the folder exists, the path is returned. If the folder does no...
A file system directory that contains the link objects that may exist in the My Network Places virtua...
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.h:534
A virtual folder that contains fonts.
Contains xtd::io::directory class.
The xtd::forms include folder.
Contains xtd::guid class.
The xtd namespace contains all fundamental classes to access Hardware, Os, System, and more.
Definition: system_report.h:17
The file system directory that acts as a staging area for files waiting to be written to a CD...
The directory used to physically store file objects on the desktop. Do not confuse this directory wit...
Contains xtd::environment_variable_target enum class.
The xtd::console include folder.
The file system directory that serves as a repository for image files common to all users...
special_folder_option
Specifies options to use for getting the path to a special folder.
Definition: environment.h:285
The xtd::drawing libraries folder.
Represents text as a sequence of UTF-8 code units.
Definition: ustring.h:46
Represents information about c++ libraries, such as the version and language identifier. This class cannot be inherited.
Definition: cpp_language.h:24
Represents the version number of an assembly, operating system, or the xtd. This class cannot be inhe...
Definition: version.h:95
std::string to_string(const date_time &value, const std::string &fmt, const std::locale &loc)
Convert a specified value into a string with specified format and locale.
Definition: date_time.h:1063
std::vector< std::pair< enum_t, xtd::ustring > > enum_collection
Represents a pair of an enum_t value and a string of an enum of type enum_t.
Definition: enum_collection.h:19
Represents information about an operating system, such as the version and platform identifier...
Definition: operating_system.h:25
The file system directory that serves as a repository for video files common to all users...
The file system directory that contains documents that are common to all users. This special folder i...
Contains xtd::compiler class.
exit_status
Specifies exit status for the xtd::environment::exit method.
Definition: exit_status.h:18
The file system directory that contains home folder.
Contains enum_ and enum_ut_ keywords.
The directory that serves as a common repository for document templates.
The file system directory that contains the programs and folders that appear on the Start menu for al...
The file system directory that is used to store administrative tools for an individual user...
The xtd reference guide folder.
The directory that contains the Start menu items.
Contains xtd::collections::specialized::string_vector typedef.
Contains xtd::cpp_language class.
Contains xtd::exit_status enum class.
Represents an event.
Definition: event.h:21
std::vector< xtd::ustring > string_vector
Represents a collection of strings.
Definition: string_vector.h:25
The xtd::forms libraries folder.
static xtd::target_type target_type() noexcept
Gets an xtd::target_type object that contains the current target identifier.
Definition: environment.h:473
The My Computer folder. The MyComputer constant always yields the empty string ("") because no path i...
The Windows directory or SYSROOT. This corresponds to the windir% or SYSTEMROOT% environment variable...
The file system directory that contains administrative tools for all users of the computer...
Provides data for the environment signal event. This class cannot be inherited.
Definition: signal_cancel_event_args.h:18
std::vector< xtd_library > xtd_library_collection
Represents a xtd libraries collection.
Definition: environment.h:344
The path to the folder is returned without verifying whether the path exists. If the folder is locate...
The xtd::forms resources folder.
The file system directory that serves as a repository for music files common to all users...
Contains xtd::target_type class.
The file system directory that contains files and folders that appear on the desktop for all users...
Contains xtd::processor class.
Contains xtd::ustring class.
The directory that serves as a common repository for the user's favorite items.
Contains xtd::version class.
The installation folder of xtd.
The directory that serves as a common repository for Internet cookies.
The program files directory.On a non-x86 system, passing ProgramFiles to the GetFolderPath method ret...
The xtd libraries folder.
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.h:368
The xtd::drawing resources folder.
The directory for components that are shared across applications.To get the x86 common program files ...
Supports all classes in the xtd class hierarchy and provides low-level services to derived classes...
Definition: object.h:32
int_least32_t int32
Represents a 32-bit signed integer.
Definition: types.h:129
Contains xtd::event event.
The directory that contains the Send To menu items.
The directory that corresponds to the user's Startup program group. The system starts these programs ...
The Program Files folder On an x86 system, passing the ProgramFilesX86 member to the Environment...
The logical Desktop rather than the physical file system location.
Contains xtd::program_exit_event_handler event handler.
The directory that serves as a common repository for application-specific data for the current roamin...
Represents information about a processor, such as the architecture. This class cannot be inherited...
Definition: processor.h:19
The directory that serves as a common repository for application-specific data that is used by all us...
environment_variable_target
Specifies the location where an environment variable is stored or retrieved in a set or get operation...
Definition: environment_variable_target.h:15
Contains xtd::argument_exception exception.
The path to the folder is created if it does not already exist.
The file system directory that contains localized resource data.
static std::basic_ostream< char_t, traits_t > & new_line(std::basic_ostream< char_t, traits_t > &os)
Inserts a new-line character and flushes the stream.
Definition: environment.h:439
The user's profile folder. Applications should not create files or folders at this level; they should...
The file system directory that contains the templates that are available to all users. This special folder is valid only for Windows NT systems.
int_least64_t int64
Represents a 64-bit signed integer.
Definition: types.h:140
The environment class.
Definition: environment.h:71
uint_least32_t uint32
Represents a 32-bit unsigned integer.
Definition: types.h:239
static event< environment, signal_cancel_event_handler > cancel_signal
Occurs when a signal is sent to the current process.
Definition: environment.h:530
The directory that contains the user's most recently used documents.
Contains xtd::signal_cancel_event_handler event handler.
The xtd::drawing include folder.
The xtd::tunit include folder.
This value is recognized in Windows Vista for backward compatibility, but the special folder itself i...
The directory that serves as a common repository for application-specific data that is used by the cu...
Provides the registration struct for enumerations.
Definition: enum_register.h:36
The directory that serves as a common repository for temporary Internet files.
The My Documents folder. This member is equivalent to Personal.
The directory that serves as a common repository for Internet history items.