xtd - Reference Guide  0.1.1
Modern c++17/20 framework to create console, GUI and unit test applications on Windows, macOS, Linux, iOS and android.
string_format_flags.h
Go to the documentation of this file.
1 #pragma once
5 #include <xtd/ustring.h>
6 
8 namespace xtd {
10  namespace drawing {
17  enum class string_format_flags {
21  direction_vertical = 0b10,
23  fit_black_box = 0b100,
25  display_format_control = 0b100000,
27  no_font_fallback = 0b10000000000,
29  measure_trailing_spaces = 0b100000000000,
31  no_wrap = 0b1000000000000,
33  line_limit = 0b10000000000000,
35  no_clip = 0b100000000000000,
36  };
37 
39  inline string_format_flags& operator +=(string_format_flags& lhs, string_format_flags rhs) {lhs = static_cast<string_format_flags>(static_cast<long long>(lhs) + static_cast<long long>(rhs)); return lhs;}
40  inline string_format_flags& operator -=(string_format_flags& lhs, string_format_flags rhs) {lhs = static_cast<string_format_flags>(static_cast<long long>(lhs) - static_cast<long long>(rhs)); return lhs;}
41  inline string_format_flags& operator &=(string_format_flags& lhs, string_format_flags rhs) {lhs = static_cast<string_format_flags>(static_cast<long long>(lhs) & static_cast<long long>(rhs)); return lhs;}
42  inline string_format_flags& operator |=(string_format_flags& lhs, string_format_flags rhs) {lhs = static_cast<string_format_flags>(static_cast<long long>(lhs) | static_cast<long long>(rhs)); return lhs;}
43  inline string_format_flags& operator ^=(string_format_flags& lhs, string_format_flags rhs) {lhs = static_cast<string_format_flags>(static_cast<long long>(lhs) ^ static_cast<long long>(rhs)); return lhs;}
44  inline string_format_flags operator +(string_format_flags lhs, string_format_flags rhs) {return static_cast<string_format_flags>(static_cast<long long>(lhs) + static_cast<long long>(rhs));}
45  inline string_format_flags operator -(string_format_flags lhs, string_format_flags rhs) {return static_cast<string_format_flags>(static_cast<long long>(lhs) - static_cast<long long>(rhs));}
46  inline string_format_flags operator ~(string_format_flags rhs) {return static_cast<string_format_flags>(~static_cast<long long>(rhs));}
47  inline string_format_flags operator &(string_format_flags lhs, string_format_flags rhs) {return static_cast<string_format_flags>(static_cast<long long>(lhs) & static_cast<long long>(rhs));}
48  inline string_format_flags operator |(string_format_flags lhs, string_format_flags rhs) {return static_cast<string_format_flags>(static_cast<long long>(lhs) | static_cast<long long>(rhs));}
49  inline string_format_flags operator ^(string_format_flags lhs, string_format_flags rhs) {return static_cast<string_format_flags>(static_cast<long long>(lhs) ^ static_cast<long long>(rhs));}
50  inline std::ostream& operator<<(std::ostream& os, string_format_flags value) {return os << xtd::to_string(value, {{string_format_flags::direction_right_to_left, "direction_right_to_left"}, {string_format_flags::direction_vertical, "direction_vertical"}, {string_format_flags::fit_black_box, "fit_black_box"}, {string_format_flags::display_format_control, "display_format_control"}, {string_format_flags::no_font_fallback, "no_font_fallback"}, {string_format_flags::measure_trailing_spaces, "measure_trailing_spaces"}, {string_format_flags::no_wrap, "no_wrap"}, {string_format_flags::line_limit, "line_limit"}, {string_format_flags::no_clip, "no_clip"}});}
51  inline std::wostream& operator<<(std::wostream& os, string_format_flags value) {return os << xtd::to_string(value, {{string_format_flags::direction_right_to_left, L"direction_right_to_left"}, {string_format_flags::direction_vertical, L"direction_vertical"}, {string_format_flags::fit_black_box, L"fit_black_box"}, {string_format_flags::display_format_control, L"display_format_control"}, {string_format_flags::no_font_fallback, L"no_font_fallback"}, {string_format_flags::measure_trailing_spaces, L"measure_trailing_spaces"}, {string_format_flags::no_wrap, L"no_wrap"}, {string_format_flags::line_limit, L"line_limit"}, {string_format_flags::no_clip, L"no_clip"}});}
53  }
54 }
std::string to_string(const value_t &value, const std::string &fmt, const std::locale &loc)
Convert a specified value into a string with specified format and locale.
Definition: to_string.h:37
string_format_flags
Specifies the display and layout information for text strings. This enumeration allows a bitwise comb...
Definition: string_format_flags.h:17
@ line_limit
Only entire lines are laid out in the formatting rectangle. By default layout continues until the end...
@ display_format_control
Control characters such as the left-to-right mark are shown in the output with a representative glyph...
@ direction_vertical
Text is vertically aligned.
@ fit_black_box
Parts of characters are allowed to overhang the string's layout rectangle. By default,...
@ measure_trailing_spaces
Includes the trailing space at the end of each line. By default the boundary rectangle returned by th...
@ no_wrap
Text wrapping between lines when formatting within a rectangle is disabled. This flag is implied when...
@ no_clip
Overhanging parts of glyphs, and unwrapped text reaching outside the formatting rectangle are allowed...
@ no_font_fallback
Fallback to alternate fonts for characters not supported in the requested font is disabled....
@ direction_right_to_left
Text is displayed from right to left. text.
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition: system_report.h:17
Contains xtd::ustring class.