#include <xtd/xtd>
class character {
public:
character(const string& name, const string& rank) noexcept : name_(name), rank_(rank) {}
const string& name() const noexcept {return name_;}
const string& rank() const noexcept {return rank_;}
string to_string(
const string& fmt,
const std::locale& loc)
const {
if (fmt == "F") return name_ + " (" + rank_ + ")";
if (fmt == "N") return name_;
if (fmt == "R") return rank_;
}
private:
string name_;
string rank_;
};
template<>
string xtd::to_string(
const character& value,
const string& fmt,
const std::locale& loc) {
return value.to_string(fmt, loc);}
using characters = list<character>;
auto main() -> int {
}
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 xtd::string new_line() noexcept
Gets the newline string defined for this environment.
static culture_info current_culture() noexcept
Gets the xtd::globalization::culture_info object that represents the culture used by the current appl...
@ character
Specifies that the text is trimmed to the nearest character.
Definition string_trimming.hpp:21
@ c
The C key.
Definition console_key.hpp:92
Contains classes that define culture-related information, including language, country/region,...
Definition culture_info.hpp:20
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