#include <xtd/xtd>
public:
character() = default;
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_;}
if (fmt == "F") return name_ + " (" + rank_ + ")";
if (fmt == "N") return name_;
if (fmt == "R") return rank_;
}
private:
string name_;
string rank_;
};
enum class cap {title, middle,
end};
auto print_character(
const string&
text,
const character& value, cap
c) {
<<
"┌───────────────────────────────────────────────┬────────────┬──────────────────────────────────────────┐" <<
environment::new_line
<<
"├───────────────────────────────────────────────┼────────────┼──────────────────────────────────────────┤" <<
environment::new_line;
else
}
auto main() -> int {
print_character("{}", character {}, cap::title);
print_character("{\"Jean-Luc Picard\", \"Captain\"}", character {"Jean-Luc Picard", "Captain"}, cap::middle);
print_character("{\"William Riker\", \"Commander\"}", character {"William Riker", "Commander"}, cap::middle);
print_character("{\"Data\", \"Commander\"}", character {"Data", "Commander"}, cap::middle);
print_character("{\"Beverly Crusher\", \"Commander\"}", character {"Beverly Crusher", "Commander"}, cap::middle);
print_character("{\"Geordi La Forge\", \"Lieutenant Commander\"}", character {"Geordi La Forge", "Lieutenant Commander"}, cap::middle);
print_character("{\"Worf\", \"Lieutenant Commander\"}", character {"Worf", "Lieutenant Commander"}, cap::middle);
print_character("{\"Tasha Yar\", \"Lieutenant\"}", character {"Tasha Yar", "Lieutenant"}, cap::end);
}
bool is_empty() const noexcept
Definition basic_string.hpp:3534
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.
Provides information about a specific culture (called a locale for unmanaged code development)....
Definition culture_info.hpp:43
static culture_info current_culture() noexcept
Gets the xtd::globalization::culture_info object that represents the culture used by the current appl...
@ 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
Contains classes that represent ASCII and Unicode character encodings; abstract base classes for conv...
Definition basic_string_builder.hpp:17
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
const_iterator end() const
Returns an iterator to the end.
Definition read_only_span.hpp:213