#include <xtd/console>
#include <xtd/environment>
#include <xtd/foreground_color>
#include <xtd/iformatable>
class foo1 {
public:
explicit foo1(int value) : value_ {value} {}
string to_string()
const noexcept {
return string::format(
"{}", value_);}
string to_string(
const string&
format,
const std::locale& loc)
const {
return string::format(string::format(
"{{:{}}}",
format), value_);}
private:
int value_ = 0;
};
class foo2 {
public:
explicit foo2(int value) : value_ {value} {}
string to_string() const noexcept {
return string::format(
"{}", value_);}
string to_string(
const string& format,
const std::locale& loc)
const {
return string::format(string::format(
"{{:{}}}", format), value_);}
private:
int value_ = 0;
};
template<>
std::string
xtd::to_string(
const foo2& value,
const std::string&
format,
const std::locale& loc) {
return value.to_string(
format, loc);}
public:
explicit foo3(int value) : value_ {value} {}
string to_string() const noexcept {
return string::format(
"{}", value_);}
string to_string(
const string& format,
const std::locale& loc)
const override {
return string::format(string::format(
"{{:{}}}", format), value_);}
private:
int value_ = 0;
};
public:
explicit foo4(int value) : value_ {value} {}
string to_string() const noexcept
override {
return string::format(
"{}", value_);}
string to_string(
const string& format,
const std::locale& loc)
const {
return string::format(string::format(
"{{:{}}}", format), value_);}
private:
int value_ = 0;
};
public:
explicit foo5(int value) : value_ {value} {}
string to_string() const noexcept {
return string::format(
"{}", value_);}
string to_string(
const string& format,
const std::locale& loc)
const override {
return string::format(string::format(
"{{:{}}}", format), value_);}
friend std::ostream& operator <<(std::ostream& stream,
const foo5& value) {
return stream << value.to_string(
"", std::locale {});}
private:
int value_ = 0;
};
class foo6 {
public:
explicit foo6(int value) : value_ {value} {}
string to_string(
const string& format,
const std::locale& loc)
const {
return string::format(string::format(
"{{:{}}}", format), value_);}
friend std::ostream& operator <<(std::ostream& stream,
const foo6& value) {
return stream << value.to_string();}
private:
int value_ = 0;
};
template<>
std::string
xtd::to_string(
const foo6& value,
const std::string&
format,
const std::locale& loc) {
return value.to_string(
format, loc);}
public:
explicit foo7(int value) : value_ {value} {}
using object::to_string;
string to_string(
const string& format,
const std::locale& loc)
const override {
return string::format(string::format(
"{{:{}}}", format), value_);}
private:
int value_ = 0;
};
auto main() -> int {
try {
}
try {
}
try {
}
try {
}
try {
}
}
static void write(arg_t &&value)
Writes the text representation of the specified value to the standard output stream.
Definition console.hpp:462
static std::ostream out
Gets the standard output stream. A std::basic_ostream<char_t> that represents the standard output str...
Definition console.hpp:52
static void write_line()
Writes the current line terminator to the standard output stream using the specified format informati...
static xtd::string new_line() noexcept
Gets the newline string defined for this environment.
Represent foreground color output manipulator class.
Definition foreground_color.hpp:20
Supports all classes in the xtd class hierarchy and provides low-level services to derived classes....
Definition object.hpp:44
@ red
The color red.
Definition console_color.hpp:48
@ default_color
The default color.
Definition console_color.hpp:22
@ f3
The F3 key.
Definition console_key.hpp:184
@ f2
The F2 key.
Definition console_key.hpp:182
@ f6
The F6 key.
Definition console_key.hpp:190
@ f7
The F7 key.
Definition console_key.hpp:192
@ f4
The F4 key.
Definition console_key.hpp:186
@ f5
The F5 key.
Definition console_key.hpp:188
@ f1
The F1 key.
Definition console_key.hpp:180
@ e
The E key.
Definition console_key.hpp:96
@ stream
Supports reliable, two-way, connection-based byte streams without the duplication of data and without...
Definition socket_type.hpp:36
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition abstract_object.hpp:8
string to_string() const noexcept override
Returns the string representation of this xtd::read_only_span <type_t> object.
Definition read_only_span.hpp:375