xtd - Reference Guide  0.2.0
Modern c++17/20 framework to create console, GUI and unit test applications on Windows, macOS, Linux, iOS and android.
system_report.h
Go to the documentation of this file.
1 #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 
17 namespace xtd {
23  class export_ system_report final static_ {
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 
78 
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 
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 }
Contains xtd::static_object class.
Represents information about c++ libraries, such as the version and standard identifier. This class cannot be inherited.
Definition: compiler.h:23
Provides system report about the current system environment.
Definition: system_report.h:23
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
std::vector< std::pair< std::string, xtd::drawing::color > > system_color_collection
Represents a colors collection.
Definition: system_report.h:63
#define static_
This keyword is use to represent a static object. A static object can&#39;t be instantiated (constructors...
Definition: static.h:38
std::vector< std::pair< std::string, xtd::drawing::font > > system_font_collection
Represents a fonts collection.
Definition: system_report.h:67
static std::vector< screen > all_screens()
Gets an array of all displays on the system.
generic_font_families
Specifies a generic font_family object.
Definition: generic_font_families.h:19
static xtd::operating_system os_version()
Gets an operating_system object that contains the current platform identifier and version number...
Contains xtd::forms::screen component.
The xtd namespace contains all fundamental classes to access Hardware, Os, System, and more.
Definition: system_report.h:17
Represents a stack trace, which is an ordered collection of one or more stack frames.
Definition: stack_trace.h:32
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 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:93
Represents information about an operating system, such as the version and platform identifier...
Definition: operating_system.h:23
std::vector< std::pair< std::string, std::string > > system_information_collection
Represents a system informations collection.
Definition: system_report.h:69
static xtd::processor processor_information()
Gets an operating_system object that contains the current platform identifier and version number...
Contains xtd::forms::system_information class.
std::vector< std::pair< std::string, std::string > > special_folder_collection
Represents a folders collection.
Definition: system_report.h:61
Contains xtd::ustring class.
std::vector< xtd_library > xtd_library_collection
Represents a xtd libraries collection.
Definition: system_report.h:57
Contains xtd::version class.
Contains xtd::drawing::color class.
std::vector< std::pair< std::string, std::string > > environment_variable_collection
Represents an environment variables collection.
Definition: system_report.h:59
Contains xtd::environment 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
Represents information about a processor, such as the architecture. This class cannot be inherited...
Definition: processor.h:19
static xtd::compiler compiler_version()
Gets an cpp_standard object that contains the current c++ standard identifier and version number...
Definition: environment.h:211
Represents a xtd library that contains name, version and paths.
Definition: system_report.h:26
Contains xtd::drawing::font class.
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