xtd - Reference Guide  0.1.2
Modern c++17/20 framework to create console, GUI and unit test applications on Windows, macOS, Linux, iOS and android.
Loading...
Searching...
No Matches
system_report.h
Go to the documentation of this file.
1
4#pragma once
5#include <vector>
6#include <xtd/environment.h>
7#include <xtd/static.h>
8#include <xtd/ustring.h>
9#include <xtd/version.h>
10#include <xtd/drawing/color.h>
11#include <xtd/drawing/font.h>
12#include <xtd/forms/screen.h>
14#include "export.h"
15
17namespace xtd {
24 public:
26 class xtd_library final {
27 public:
29 xtd_library() = default;
30 xtd_library(const xtd_library&) = default;
31 xtd_library& operator=(const xtd_library&) = default;
33
34 const std::string& name() const {return name_;}
35
36 const xtd::version& version() const {return version_;}
37
38 const std::string& include_path() const {return include_path_;}
39
40 const std::string& library_path() const {return library_path_;}
41
42 const std::string& resources_path() const {return resources_path_;}
43
44 std::string to_string() const {return xtd::ustring::format("{} (version {})", name_, version_);}
45
46 private:
47 friend class system_report;
48 xtd_library(const std::string& name, const xtd::version& version, const std::string& include_path, const std::string& library_path, const std::string& resources_path) : name_(name), version_(version), include_path_(include_path), library_path_(library_path), resources_path_(resources_path) {}
49 std::string name_;
50 xtd::version version_;
51 std::string include_path_;
52 std::string library_path_;
53 std::string resources_path_;
54 };
55
57 using xtd_library_collection = std::vector<xtd_library>;
59 using environment_variable_collection = std::vector<std::pair<std::string, std::string>>;
61 using special_folder_collection = std::vector<std::pair<std::string, std::string>>;
63 using system_color_collection = std::vector<std::pair<std::string, xtd::drawing::color>>;
65 using system_font_family_collection = std::vector<std::pair<std::string, xtd::drawing::font_family>>;
67 using system_font_collection = std::vector<std::pair<std::string, xtd::drawing::font>>;
69 using system_information_collection = std::vector<std::pair<std::string, std::string>>;
70
71 static xtd::diagnostics::stack_trace stack_trace() noexcept {return stack_trace(0);}
72
73 static xtd::diagnostics::stack_trace stack_trace(size_t skip_frames) noexcept {return xtd::diagnostics::stack_trace(skip_frames, true);}
74
75 static xtd_library_collection xtd_libraries() noexcept;
76
77 static xtd::operating_system operating_system() noexcept {return xtd::environment::os_version();}
78
79 static xtd::processor processor() noexcept {return xtd::environment::processor_information();}
80
81 static xtd::compiler compiler() noexcept {return xtd::environment::compiler_version();}
82
83 static xtd::cpp_language language() noexcept {return xtd::environment::cpp_version();}
84
85 static std::locale locale() noexcept {return std::locale();}
86
87 static environment_variable_collection environment_variables() noexcept;
88
89 static special_folder_collection special_folders() noexcept;
90
91 static system_color_collection system_colors() noexcept;
92
93 static system_font_family_collection generic_font_families() noexcept;
94
95 static system_font_collection system_fonts() noexcept;
96
97 static std::vector<xtd::forms::screen> screens() noexcept {return xtd::forms::screen::all_screens();}
98
99 static system_information_collection system_informations() noexcept;
100
103 static std::string to_string() noexcept;
107 static std::string to_xml() noexcept;
108 };
109}
Represents information about c++ libraries, such as the version and standard identifier....
Definition compiler.h:23
Represents information about c++ libraries, such as the version and language identifier....
Definition cpp_language.h:24
Represents a stack trace, which is an ordered collection of one or more stack frames.
Definition stack_trace.h:32
static xtd::cpp_language cpp_version()
Gets an cpp_standard object that contains the current c++ standard identifier and version number.
Definition environment.h:218
static xtd::compiler compiler_version()
Gets an cpp_standard object that contains the current c++ standard identifier and version number.
Definition environment.h:211
static xtd::operating_system os_version()
Gets an operating_system object that contains the current platform identifier and version number.
static xtd::processor processor_information()
Gets an operating_system object that contains the current platform identifier and version number.
static std::vector< screen > all_screens()
Gets an array of all displays on the system.
Represents information about a processor, such as the architecture. This class cannot be inherited.
Definition processor.h:19
Represents a xtd library that contains name, version and paths.
Definition system_report.h:26
Provides system report about the current system environment.
Definition system_report.h:23
std::vector< std::pair< std::string, xtd::drawing::color > > system_color_collection
Represents a colors collection.
Definition system_report.h:63
std::vector< std::pair< std::string, std::string > > system_information_collection
Represents a system informations collection.
Definition system_report.h:69
std::vector< std::pair< std::string, std::string > > special_folder_collection
Represents a folders collection.
Definition system_report.h:61
std::vector< xtd_library > xtd_library_collection
Represents a xtd libraries collection.
Definition system_report.h:57
std::vector< std::pair< std::string, xtd::drawing::font > > system_font_collection
Represents a fonts collection.
Definition system_report.h:67
std::vector< std::pair< std::string, std::string > > environment_variable_collection
Represents an environment variables collection.
Definition system_report.h:59
std::vector< std::pair< std::string, xtd::drawing::font_family > > system_font_family_collection
Represents a font families collection.
Definition system_report.h:65
Represents the version number of an assembly, operating system, or the xtd. This class cannot be inhe...
Definition version.h:93
Contains xtd::drawing::color class.
Contains xtd::environment class.
Contains export_ keyword.
Contains xtd::drawing::font class.
static ustring format(const ustring &fmt, args_t &&... args)
Writes the text representation of the specified arguments list, to string using the specified format ...
Definition ustring.h:689
#define static_
This keyword is use to represent a static object. A static object can't be instantiated (constructors...
Definition static.h:38
#define export_
Define shared library export.
Definition export.h:13
std::string to_string(const value_t &value, const std::string &fmt, const std::locale &loc)
Convert a specified value into a string with specified format and locale.
Definition to_string.h:37
The xtd::forms namespace contains classes for creating Windows-based applications that take full adva...
Definition about_box.h:13
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition system_report.h:17
Contains xtd::forms::screen component.
Contains xtd::static_object class.
Contains xtd::forms::system_information class.
Contains xtd::ustring class.
Contains xtd::version class.