xtd 0.2.0
version.cpp

Demonstrates the xtd::version constructor, and major, minor, build, revision, major_revision, and minor_revision properties.

#include <xtd/console>
#include <xtd/startup>
#include <xtd/version>
using namespace xtd;
namespace version_example {
class program {
public:
// The main entry point for the application.
static auto main() {
auto fmt_std = "Standard version:\n"
" major.minor.build.revision = {0}.{1}.{2}.{3}";
auto fmt_int = "Interim version:\n"
" major.minor.build.maj_rev/min_rev = {0}.{1}.{2}.{3}/{4}";
auto std = version {2, 4, 1128, 2};
auto interim = version {2, 4, 1128, (100 << 16) + 2};
console::write_line(fmt_std, std.major(), std.minor(), std.build(), std.revision());
console::write_line(fmt_int, interim.major(), interim.minor(), interim.build(), interim.major_revision(), interim.minor_revision());
}
};
}
startup_(version_example::program::main);
// This code can produce the following output :
//
// Standard version:
// major.minor.build.revision = 2.4.1128.2
// Interim version:
// major.minor.build.maj_rev/min_rev = 2.4.1128.100/2
static void write_line()
Writes the current line terminator to the standard output stream using the specified format informati...
Represents the version number of an assembly, operating system, or the xtd. This class cannot be inhe...
Definition version.hpp:114
#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