xtd - Reference Guide  0.1.0
Modern c++17/20 framework to create console, GUI and unit test applications on Windows, macOS, Linux, iOS and android.
Loading...
Searching...
No Matches
string_alignment.h
Go to the documentation of this file.
1
4#pragma once
5#include <xtd/ustring.h>
6
7#if defined(_WIN32)
8#undef far
9#undef near
10#endif
11
13namespace xtd {
15 namespace drawing {
23 enum class string_alignment {
25 near = 0,
27 center = 1,
29 far = 2
30 };
31
33 inline std::ostream& operator<<(std::ostream& os, string_alignment value) {return os << xtd::to_string(value, {{string_alignment::near, "near"}, {string_alignment::center, "center"}, {string_alignment::far, "far"}});}
34 inline std::wostream& operator<<(std::wostream& os, string_alignment value) {return os << xtd::to_string(value, {{string_alignment::near, L"near"}, {string_alignment::center, L"center"}, {string_alignment::far, L"far"}});}
36 }
37}
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_alignment
Specifies the alignment of a text string relative to its layout rectangle.
Definition: string_alignment.h:23
@ far
Specifies that text is aligned far from the origin position of the layout rectangle....
@ near
Specifies the text be aligned near the layout. In a left-to-right layout, the near position is left....
@ center
Specifies that text is aligned in the center of the layout rectangle.
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition: system_report.h:17
Contains xtd::ustring class.