FTXUI 6.1.9 C++ functional terminal UI.

Loading...
Searching...
No Matches
string.hpp
Go to the documentation of this file.
1// Copyright 2020 Arthur Sonzogni. All rights reserved.
2// Use of this source code is governed by the MIT license that can be found in
3// the LICENSE file.
4#ifndef FTXUI_SCREEN_STRING_HPP
5#define FTXUI_SCREEN_STRING_HPP
6
7#include <string> // for string, wstring, to_string
8#include <vector> // for vector
9
10 namespace ftxui {
11std::string to_string(const std::wstring& s);
12std::wstring to_wstring(const std::string& s);
13
14 template <typename T>
15std::wstring to_wstring(T s) {
16 return to_wstring(std::to_string(s));
17}
18
19 int string_width(const std::string&);
20
21// Split the string into a its glyphs. An empty one is inserted ater fullwidth
22// ones.
23std::vector<std::string> Utf8ToGlyphs(const std::string& input);
24
25// Map every cells drawn by |input| to their corresponding Glyphs. Half-size
26// Glyphs takes one cell, full-size Glyphs take two cells.
27std::vector<int> CellToGlyphIndex(const std::string& input);
28
29} // namespace ftxui
30
31#endif /* end of include guard: FTXUI_SCREEN_STRING_HPP */
ftxui
The FTXUI ftxui:: namespace.
Definition animation.hpp:10
ftxui::Utf8ToGlyphs
std::vector< std::string > Utf8ToGlyphs(const std::string &input)
Definition string.cpp:1357
ftxui::string_width
int string_width(const std::string &)
Definition string.cpp:1330
ftxui::to_wstring
std::wstring to_wstring(const std::string &s)
Convert a UTF8 std::string into a std::wstring.
Definition string.cpp:1637
ftxui::to_string
std::string to_string(const std::wstring &s)
Convert a std::wstring into a UTF8 std::string.
Definition string.cpp:1565
ftxui::CellToGlyphIndex
std::vector< int > CellToGlyphIndex(const std::string &input)
Definition string.cpp:1464