FTXUI 6.1.9
C++ functional terminal UI.
载入中...
搜索中...
未找到
string_internal.hpp
浏览该文件的文档.
1// 版权所有 2023 Arthur Sonzogni。保留所有权利。
2// 本源代码受 MIT 许可证的约束,可在 LICENSE 文件中找到。
3#ifndef FTXUI_SCREEN_STRING_INTERNAL_HPP
4#define FTXUI_SCREEN_STRING_INTERNAL_HPP
5
6#include <cstdint>
7#include <string>
8#include <vector>
9
10namespace ftxui {
11
12bool EatCodePoint(const std::string& input,
13 size_t start,
14 size_t* end,
15 uint32_t* ucs);
16bool EatCodePoint(const std::wstring& input,
17 size_t start,
18 size_t* end,
19 uint32_t* ucs);
20
21bool IsCombining(uint32_t ucs);
22bool IsFullWidth(uint32_t ucs);
23bool IsControl(uint32_t ucs);
24
25size_t GlyphPrevious(const std::string& input, size_t start);
26size_t GlyphNext(const std::string& input, size_t start);
27
28// 返回在 |input| 字符串中,从 |start| 开始,位于 |glyph_offset| 处的字形的索引。
29size_t GlyphIterate(const std::string& input,
30 int glyph_offset,
31 size_t start = 0);
32
33// 返回 |input| 中字形的数量。
34int GlyphCount(const std::string& input);
35
36// 属性来自:
37// https://www.unicode.org/Public/UCD/latest/ucd/auxiliary/WordBreakProperty.txt
38enum class WordBreakProperty : int8_t {
39 ALetter,
40 CR,
42 Extend,
44 Format,
47 LF,
49 MidNum,
51 Newline,
52 Numeric,
56 ZWJ,
57};
59std::vector<WordBreakProperty> Utf8ToWordBreakProperty(
60 const std::string& input);
61
62bool IsWordBreakingCharacter(const std::string& input, size_t glyph_index);
63} // namespace ftxui
64
65#endif /* end of include guard: FTXUI_SCREEN_STRING_INTERNAL_HPP */ // 包含守卫的结束
#include "ftxui/component/component_base.hpp" // 用于 ComponentBase
size_t GlyphNext(const std::string &input, size_t start)
bool IsControl(uint32_t ucs)
WordBreakProperty CodepointToWordBreakProperty(uint32_t codepoint)
bool IsCombining(uint32_t ucs)
bool IsWordBreakingCharacter(const std::string &input, size_t glyph_index)
bool EatCodePoint(const std::string &input, size_t start, size_t *end, uint32_t *ucs)
int GlyphCount(const std::string &input)
bool IsFullWidth(uint32_t ucs)
std::vector< WordBreakProperty > Utf8ToWordBreakProperty(const std::string &input)
size_t GlyphIterate(const std::string &input, int glyph_offset, size_t start)
size_t GlyphPrevious(const std::string &input, size_t start)