11#ifndef INCGUARD_MGL_TEXT_CHARACTER_H_1538587141
12#define INCGUARD_MGL_TEXT_CHARACTER_H_1538587141
30 static constexpr uint32_t
kValidateMask = 0xFFFFFFFF & ~kInvalidMarkerBit;
52 [[nodiscard]]
constexpr char32_t GetCode() const noexcept
64 constexpr void SetCode(
char32_t code)
noexcept
66 _code =
static_cast<uint32_t
>(code);
93 [[nodiscard]]
constexpr bool IsValid() const noexcept
106 [[nodiscard]]
constexpr bool IsNull() const noexcept
121 return ((_code == 0x0D) || (_code == 0x0A));
132 [[nodiscard]]
constexpr bool IsSpace() const noexcept
134 return ((_code ==
' ') || (_code ==
'\t'));
143 [[nodiscard]]
constexpr bool IsDigit() const noexcept
145 return ((_code >=
'0') && (_code <=
'9'));
150 char *
ToByte(
char *dest,
size_t destSize) const noexcept;
151 [[nodiscard]] STL::
string ToString() const noexcept;
165 [[nodiscard]]
int Find(uint32_t findCode, uint32_t start = 0)
const;
176 reference
at(size_type n)
190 [[nodiscard]] const_reference
at(size_type n)
const
218 [[nodiscard]] const_reference
operator[](size_type pos)
const noexcept
文字の集合体クラス
Definition mgl_text_character.h:160
reference operator[](size_type pos) noexcept
配列アクセス
Definition mgl_text_character.h:204
reference at(size_type n)
STL::vector::atのオーバーライド
Definition mgl_text_character.h:176
const_reference operator[](size_type pos) const noexcept
配列アクセス(const版)
Definition mgl_text_character.h:218
const_reference at(size_type n) const
STL::vector::atのオーバーライド(const版)
Definition mgl_text_character.h:190
文字クラス
Definition mgl_text_character.h:24
static constexpr uint32_t kValidateMask
コードの有効範囲
Definition mgl_text_character.h:30
constexpr void SetInvalidMarker() noexcept
不正なコードのマーカーを書き込む
Definition mgl_text_character.h:80
STL::string ToString() const noexcept
文字をSTL::stringに変換
Definition mgl_text_character.cc:195
static constexpr size_t kByteArraySize
バイト配列のサイズ
Definition mgl_text_character.h:33
constexpr bool IsDigit() const noexcept
数値かどうかを取得
Definition mgl_text_character.h:143
constexpr bool IsNull() const noexcept
Null文字かどうかを判定
Definition mgl_text_character.h:106
constexpr bool IsValid() const noexcept
コードが正常かどうかを取得する
Definition mgl_text_character.h:93
constexpr void SetCode(char32_t code) noexcept
値を設定
Definition mgl_text_character.h:64
constexpr Character(uint32_t code) noexcept
コンストラクタ
Definition mgl_text_character.h:41
constexpr char32_t GetCode() const noexcept
値を取得
Definition mgl_text_character.h:52
constexpr bool IsNewLine() const noexcept
改行文字かどうかを取得
Definition mgl_text_character.h:119
static constexpr uint32_t kInvalidMarkerBit
不正な文字を検出した際に書き込むビット位置
Definition mgl_text_character.h:27
size_t GetByteSize() const noexcept
文字をバイトに変換する際に必要なサイズを取得
Definition mgl_text_character.cc:23
constexpr bool IsSpace() const noexcept
スペースかどうかを取得
Definition mgl_text_character.h:132
bool ToByte(char byteArray[kByteArraySize]) const noexcept
コードをバイト列に変換
Definition mgl_text_character.cc:141
std::vector< T, Allocator< T > > vector
std::vectorの代替
Definition mgl_stl_containers.h:51
basic_string< char > string
std::stringの代替
Definition mgl_stl_string.h:25