xtd 0.2.0
version_os.cpp

Shows how to use xtd::version to get the Operating System version.

#include <xtd/console>
#include <xtd/environment>
#include <xtd/startup>
using namespace xtd;
namespace version_os_example {
class program {
public:
// The main entry point for the application.
static auto main() {
// Get the operating system version.
auto ver = os.version();
console::write_line("Operating System: {0} ({1})", os.version_string(), ver.to_string());
}
};
}
startup_(version_os_example::program::main);
// This code can produce the following output :
//
// Operating System: macOS 11.6.0 (11.6.0.0)
static void write_line()
Writes the current line terminator to the standard output stream using the specified format informati...
static xtd::operating_system os_version() noexcept
Gets an xtd::operating_system object that contains the current platform identifier and version number...
#define startup_(main_method)
Defines the entry point to be called when the application loads. Generally this is set either to the ...
Definition startup.hpp:167
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition abstract_object.hpp:8