MGL(Win32)
読み取り中…
検索中…
一致する文字列を見つけられません
mgl_text_index_converter.h
[詳解]
1// SPDX-License-Identifier: Zlib
2/* ------------------------------------------------------------------------- */
9/* ------------------------------------------------------------------------- */
10
11#ifndef INCGUARD_MGL_TEXT_INDEX_CONVERTER_H_1624739470
12#define INCGUARD_MGL_TEXT_INDEX_CONVERTER_H_1624739470
13
19
20namespace MGL::Text
21{
24{
25public:
26 virtual ~IndexConverter() noexcept = default;
27
28 /* ------------------------------------------------------------------------- */
35 /* ------------------------------------------------------------------------- */
36 [[nodiscard]] virtual Text::IndexedCharacter ToIndexedCharacter(char32_t character, Render::FontFaceType faceType) const noexcept = 0;
37
38 /* ------------------------------------------------------------------------- */
45 /* ------------------------------------------------------------------------- */
46 [[nodiscard]] virtual char32_t ToUTF32(Text::IndexedCharacter indexedCharacter, Render::FontFaceType faceType) const noexcept = 0;
47
48 /* ------------------------------------------------------------------------- */
55 /* ------------------------------------------------------------------------- */
56 [[nodiscard]] virtual bool HasFontFace(Render::FontFaceType faceType) const noexcept = 0;
57
58 STL::unique_ptr<Text::IndexedCharacter[]> ToIndexedString(const char *text, bool enableFormat, bool enableTag) const noexcept;
59
60private:
61 const char *ParseSubstitute(STL::vector<Text::IndexedCharacter> &indexes, bool enable, const char *text, Render::FontFaceType faceType) const noexcept;
62 const char *ParseTag(STL::vector<Text::IndexedCharacter> &indexes, Render::FontFaceType &faceType, bool enable, const char *text) const noexcept;
63 static void ParseColorTag(STL::vector<Text::IndexedCharacter> &indexes, const STL::string &tagName) noexcept;
64 void ParseFaceTag(STL::vector<Text::IndexedCharacter> &indexes, Render::FontFaceType &faceType, const STL::string &tagName) const noexcept;
65 bool ParseRuby(STL::vector<Text::IndexedCharacter> &indexes, Render::FontFaceType faceType, const STL::string &tagName) const noexcept;
66 static void ParseResetTag(STL::vector<Text::IndexedCharacter> &indexes, Render::FontFaceType &faceType, const STL::string &tagName) noexcept;
67 static const char *GetTagName(STL::string &tagName, const char *text) noexcept;
68 static const char *GetUTF32(char32_t &u32char, const char *text) noexcept;
69};
70} // namespace MGL::Text
71
72#endif // INCGUARD_MGL_TEXT_INDEX_CONVERTER_H_1624739470
73
74// vim: et ts=4 sw=4 sts=4
インデックスコンバータクラス
Definition mgl_text_index_converter.h:24
STL::unique_ptr< Text::IndexedCharacter[]> ToIndexedString(const char *text, bool enableFormat, bool enableTag) const noexcept
文字列をインデックス化
Definition mgl_text_index_converter.cc:28
virtual Text::IndexedCharacter ToIndexedCharacter(char32_t character, Render::FontFaceType faceType) const noexcept=0
文字をインデックス文字に変換
virtual char32_t ToUTF32(Text::IndexedCharacter indexedCharacter, Render::FontFaceType faceType) const noexcept=0
インデックス文字をUTF-32の文字に変換
virtual bool HasFontFace(Render::FontFaceType faceType) const noexcept=0
指定したフェイスを保持しているかを取得
フォント関連定義
FontFaceType
フォントのフェイスタイプ
Definition mgl_font_defs.h:21
MGL STLコンテナの代替
std::vector< T, Allocator< T > > vector
std::vectorの代替
Definition mgl_stl_containers.h:51
MGL STLのメモリ関連の代替
std::unique_ptr< T, Deleter > unique_ptr
MGLのアロケータを利用するユニークポインタ
Definition mgl_stl_memory.h:247
MGL STL文字列クラスの代替
basic_string< char > string
std::stringの代替
Definition mgl_stl_string.h:25
MGL テキスト関連各種宣言
uint16_t IndexedCharacter
インデックス化文字
Definition mgl_text_defs.h:30