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_trimming.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_trimming {
19  none = 0,
21  character = 1,
23  word = 2,
27  ellipsis_word = 4,
29  ellipsis_path = 5,
30  };
31 
33  inline std::ostream& operator<<(std::ostream& os, string_trimming value) {return os << xtd::to_string(value, {{string_trimming::none, "none"}, {string_trimming::character, "character"}, {string_trimming::word, "word"}, {string_trimming::ellipsis_character, "ellipsis_character"}, {string_trimming::ellipsis_word, "ellipsis_word"}, {string_trimming::ellipsis_path, "ellipsis_path"}});}
34  inline std::wostream& operator<<(std::wostream& os, string_trimming value) {return os << xtd::to_string(value, {{string_trimming::none, L"none"}, {string_trimming::character, L"character"}, {string_trimming::word, L"word"}, {string_trimming::ellipsis_character, L"ellipsis_character"}, {string_trimming::ellipsis_word, L"ellipsis_word"}, {string_trimming::ellipsis_path, L"ellipsis_path"}});}
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_trimming
Specifies how to trim characters from a string that does not completely fit into a layout shape.
Definition: string_trimming.h:17
@ ellipsis_path
The center is removed from trimmed lines and replaced by an ellipsis. The algorithm keeps as much of ...
@ none
Specifies no trimming.
@ ellipsis_character
Specifies that the text is trimmed to the nearest character, and an ellipsis is inserted at the end o...
@ ellipsis_word
Specifies that text is trimmed to the nearest word, and an ellipsis is inserted at the end of a trimm...
@ character
Specifies that the text is trimmed to the nearest character.
@ word
Specifies that text is trimmed to the nearest word.
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition: system_report.h:17
Contains xtd::ustring class.