OROCHI
 
Loading...
Searching...
No Matches
GxString.h
Go to the documentation of this file.
1//===========================================================================
9//===========================================================================
10#pragma once
11
12GX_CORE_NAMESPACE_BEGIN()
14//===========================================================================
16//===========================================================================
17struct GxString : public GxStructBase
18{
19 //-------------------------------------------------------------
21 //-------------------------------------------------------------
23public:
24 GX_RTTI_STRUCT(GxString)
25
26 struct GxTokenizer;
27
29 static constexpr u32 MARGIN_LENGTH = 115;
31 static constexpr u32 ALLOC_BLOCK_SIZE = GxMath::VALUE_16;
33 static constexpr u32 TEMPORARY_LENGTH = GxMath::VALUE_512;
35 static constexpr u32 LENGTH_MAX = 0x0FFFFFFF;
37 static constexpr u32 TEMPORARY_STACK_SIZE = GxMath::VALUE_2K;
38
40 enum class CODE
41 {
42 SJIS = 0,
43 UTF8,
44 UTF16,
45 MAX,
46 };
47
49 static constexpr u32 NUM_SJIS_FAST_TABLE = 22;
51 static const u32 SJIS_FAST_TABLE[NUM_SJIS_FAST_TABLE][2];
53 static constexpr u32 NUM_UTF8_UTF16_TABLE = 3557;
55 static constexpr u32 NUM_HALF_KANA = 63;
57 static const u8 SJIS_UTF8_UTF16_TABLE[NUM_UTF8_UTF16_TABLE][static_cast<s32>(CODE::MAX)][3];
58
60 static constexpr s32 FTOA_DEFAULT = -2;
62 static constexpr s32 FTOA_REAL = -1;
64 static constexpr s32 FTOA_INT = 0;
65
67 //-------------------------------------------------------------
69 //-------------------------------------------------------------
71
73 GxString(void) : _pString(nullptr), _allocSize(0){ setString(""); }
75 GX_FORCE_INLINE GxString(const GxString& string) : _pString(nullptr), _allocSize(0){ setString(string._pString ? string._pString : ""); }
77 GX_FORCE_INLINE GxString(GX_CSTR string) : _pString(nullptr), _allocSize(0){ setString(string); }
79 ~GxString(void);
81 GX_FORCE_INLINE void clear(void){ copyString(""); }
82
84 //-------------------------------------------------------------
86 //-------------------------------------------------------------
88
90 GX_FORCE_INLINE const GxString& operator = (GX_CSTR string){ copyString(string); return *this; }
92 GX_FORCE_INLINE const GxString& operator = (const GxString& string){ copyString(string._pString); return *this; }
94 GX_FORCE_INLINE void operator += (GX_CCHAR character){ GX_CCHAR temporary[2] = {character, '\0'}; concatenate(temporary); }
96 GX_FORCE_INLINE void operator += (GX_CSTR string){ concatenate(string); }
98 GX_FORCE_INLINE void operator += (const GxString& string){ concatenate(string.getString()); }
100 GxString operator + (GX_CSTR string) const;
102 GxString operator + (const GxString& string) const;
104 GX_FORCE_INLINE b32 operator == (GX_CSTR string) const { return compare(string) == 0; }
106 GX_FORCE_INLINE b32 operator == (const GxString& string) const { return compare(string) == 0; }
108 GX_FORCE_INLINE b32 operator != (GX_CSTR string) const { return compare(string) != 0; }
110 GX_FORCE_INLINE b32 operator != (const GxString& string) const { return compare(string) != 0; }
111
113 //-------------------------------------------------------------
115 //-------------------------------------------------------------
117
119 constexpr u32 getLength(void) const { return _length; }
121 static u32 getLength(GX_CSTR string);
123 static u32 getLengthUtf8(GX_CSTR string);
125 static u32 getLengthSjis(GX_CSTR string);
127 static u32 getBytesUtf8(GX_CSTR string);
129 static u32 getBytesSjis(GX_CSTR string);
131 u32 getStartUtf8(u32 characterNum) const;
133 u32 getStartSjis(u32 characterNum) const;
135 static b32 isHalfUtf8(GX_CSTR string);
137 static b32 isHalfSjis(GX_CSTR string);
139 static b32 isHalfKanaUtf8(GX_CSTR string);
141 static b32 isHalfKanaSjis(GX_CSTR string);
143 static b32 isAscii(GX_CSTR string);
145 static b32 isNumber(GX_CCHAR character);
147 static b32 isUnsignedInteger(GX_CSTR string);
149 static b32 isSignedInteger(GX_CSTR string);
151 static b32 isFloat(GX_CSTR string);
153 static b32 isHexadecimal(GX_CSTR string);
155 static b32 isBinaryDigit(GX_CSTR string);
157 static b32 isWhiteSpace(GX_CCHAR character){ return (character == 0x20) || (character == 0x09); }
159 b32 isContain(GX_CSTR string) const;
161 b32 isStartsWith(GX_CSTR string) const;
163 b32 isEndsWith(GX_CSTR string) const;
165 GX_FORCE_INLINE GX_STR getString(void){ return _pString; }
167 constexpr GX_CSTR getString(void) const { return _pString; }
169 GX_FORCE_INLINE void getLeft(GxString& left, u32 length) const { getSubString(left, 0, length); }
171 GX_FORCE_INLINE void getRight(GxString& right, u32 length) const { getSubString(right, _length - length, length); }
173 void getSubString(GxString& subString, u32 start, u32 length = LENGTH_MAX) const;
174
176 static b32 decodeUnsignedInteger(GX_CSTR string, u64& result);
178 static b32 decodeSignedInteger(GX_CSTR string, s64& result);
180 static b32 decodeFloat(GX_CSTR string, f64& result);
181
182protected:
184 void getStringProperty(void* pValue);
186 void setStringProperty(const void* pValue);
187
189 //-------------------------------------------------------------
191 //-------------------------------------------------------------
193public:
195 s32 find(GX_CSTR string, u32 start = 0, b32 isIgnoreCase = false) const;
197 s32 find(GX_CHAR character, u32 start = 0, b32 isIgnoreCase = false) const;
199 s32 findReverse(GX_CSTR string, s32 start = -1, b32 isIgnoreCase = false) const;
201 s32 findReverse(GX_CHAR character, s32 start = -1, b32 isIgnoreCase = false) const;
203 s32 findUtf8(GX_CSTR string, u32 start = 0) const;
205 s32 findUtf8(GX_CHAR character, u32 start = 0) const;
207 s32 findSjis(GX_CSTR string, u32 start = 0) const;
209 s32 findSjis(GX_CHAR character, u32 start = 0) const;
211 u32 findCount(GX_CSTR string, u32 start = 0, b32 isIgnoreCase = false) const;
213 u32 findCount(GX_CHAR character, u32 start = 0, b32 isIgnoreCase = false) const;
215 GX_FORCE_INLINE s32 compare(GX_CSTR string) const { return compare(_pString, string); }
217 GX_FORCE_INLINE s32 compare(const GxString& string) const { return compare(_pString, string._pString); }
219 static s32 compare(GX_CSTR string0, GX_CSTR string1);
221 GX_FORCE_INLINE s32 icompare(GX_CSTR string) const { return icompare(_pString, string); }
223 GX_FORCE_INLINE s32 icompare(const GxString& string) const { return icompare(_pString, string._pString); }
225 static s32 icompare(GX_CSTR string0, GX_CSTR string1);
227 static GX_FORCE_INLINE s32 ncompare(GX_CSTR string0, GX_CSTR string1, u32 length){ return strncmp(string0, string1, length); }
229 static s32 nicompare(GX_CSTR string0, GX_CSTR string1, u32 length);
231 static GX_STR copy(GX_STR dst, GX_CSTR src);
233 static GX_STR ncopy(GX_STR dst, GX_CSTR src, u32 length);
235 static GX_STR concatenate(GX_STR dst, GX_CSTR src);
237 static GX_STR nconcatenate(GX_STR dst, GX_CSTR src, u32 length);
239 void insert(u32 start, GX_CSTR string, u32 stringStart = 0, s32 stringLength = -1);
241 void eraseLeft(u32 length);
243 void eraseRight(u32 length);
245 void erase(u32 start, u32 length = LENGTH_MAX);
247 void trim(void);
249 void trimStart(void);
251 void trimEnd(void);
252
254 static void itoa(s64 value, GX_STR string);
256 static void uitoa(u64 value, GX_STR string);
258 static void ftoa(f64 value, GX_STR string, s32 figure = -2);
260 static void uitoh(u64 value, GX_STR string, u32 figure);
262 static void uitob(u64 value, GX_STR string, u32 figure);
264 static s64 atoi(GX_CSTR string);
266 static u64 atoui(GX_CSTR string);
268 static f64 atof(GX_CSTR string);
270 static u64 htoui(GX_CSTR string);
272 static u64 btoui(GX_CSTR string);
274 static GX_FORCE_INLINE GX_CHAR utol(GX_CHAR character) { return ('Z' >= character && character >= 'A') ? (character + 0x20) : character; }
276 static GX_FORCE_INLINE GX_CHAR ltou(GX_CHAR character) { return ('z' >= character && character >= 'a') ? (character - 0x20) : character; }
278 static void sjisToUtf8(GX_CSTR sjis, GX_STR utf8);
280 static void utf8ToSjis(GX_CSTR utf8, GX_STR sjis);
282 GX_FORCE_INLINE static void setCallbackSjisToUtf8(GxCallback::GxHandlerBase handler){ _callbackSjisToUtf8 = handler; }
284 GX_FORCE_INLINE static void setCallbackUtf8ToSjis(GxCallback::GxHandlerBase handler){ _callbackUtf8ToSjis = handler; }
286 const GxString& format(GX_CSTR format, ...);
288 void addComma(void);
290 void replace(GX_CSTR oldString, GX_CSTR newString);
292 void replaceUtf8(GX_CSTR oldString, GX_CSTR newString);
294 void replaceSjis(GX_CSTR oldString, GX_CSTR newString);
296 void paddingLeft(u32 totalWidth, GX_CHAR paddingCharacter = ' ');
298 void paddingRight(u32 totalWidth, GX_CHAR paddingCharacter = ' ');
299
300#if defined(_WINDOWS)
302 static s32 vsnprintfUtf8(GX_STR str, s32 bufferSize, GX_CSTR format, va_list ap);
304 const GxString& formatUtf8(GX_CSTR format, ...);
305#endif // _WINDOWS
306
307private:
309 void setString(GX_CSTR string);
311 void concatenate(GX_CSTR string);
313 void copyString(GX_CSTR string);
315 void deleteString(void);
316
318 //-------------------------------------------------------------
320 //-------------------------------------------------------------
322private:
323 GX_CHAR* _pString;
324 u32 _length;
325 u32 _allocSize;
326 GX_CHAR _marginString[MARGIN_LENGTH + 1];
327 static GxCallback::GxHandlerBase _callbackSjisToUtf8;
328 static GxCallback::GxHandlerBase _callbackUtf8ToSjis;
329
331};
332
333//===========================================================================
335//===========================================================================
337{
338 //-------------------------------------------------------------
340 //-------------------------------------------------------------
342public:
343 GX_RTTI_STRUCT(GxTokenizer)
344
345
346 static constexpr u32 TEMPORARY_LENGTH = GxMath::VALUE_256;
348 static constexpr u32 DELIMITER_MAX = GxMath::VALUE_4;
349
351 //-------------------------------------------------------------
353 //-------------------------------------------------------------
355private:
357 GxTokenizer(void){}
358public:
360 GxTokenizer(GX_CSTR string, GX_CHAR delimiter, b32 copyFlag = true);
362 void initialize(GX_CSTR string, GX_CHAR delimiter, b32 copyFlag = true);
364 void addDelimiter(GX_CHAR delimiter);
366 constexpr void setIgnore(GX_CHAR character){ _ignore = character; }
367
369 //-------------------------------------------------------------
371 //-------------------------------------------------------------
373
375 u32 split(void);
376
378 //-------------------------------------------------------------
380 //-------------------------------------------------------------
382
384 void getTop(GxString* pString = nullptr);
386 b32 getPrevious(GxString* pString = nullptr);
388 b32 getNext(GxString* pString = nullptr);
390 void getCurrent(GxString* pString);
392 void getRest(GxString* pString) const;
394 GX_FORCE_INLINE const GxString& getString(void) const { return _string; }
396 GX_CSTR getFromIndex(u32 index) const;
398 constexpr u32 getSplitLength(void) const { return _splitLength; }
399
400private:
402 u32 getCurrentLength(void);
404 b32 isDelimiter(GX_CHAR character);
405
407 //-------------------------------------------------------------
409 //-------------------------------------------------------------
411private:
412 GxString _string;
413 GX_CHAR* _pCurrent;
414 GX_CHAR _delimiter[DELIMITER_MAX];
415 u32 _delimiterCount;
416 GX_CHAR _temporaryString[TEMPORARY_LENGTH];
417 b32 _copyFlag;
418 b32 _ignoreFlag;
419 GX_CHAR _ignore;
420 GxString _splitString;
421 u32 _splitLength;
422
424};
425
426//===========================================================================
428//===========================================================================
429struct GxStringW : public GxStructBase
430{
431 //-------------------------------------------------------------
433 //-------------------------------------------------------------
435public:
436 GX_RTTI_STRUCT(GxStringW)
437
438
439 static constexpr u32 MARGIN_LENGTH = GxMath::VALUE_16;
441 static constexpr u32 ALLOC_BLOCK_SIZE = GxMath::VALUE_16;
443 static constexpr u32 TEMPORARY_LENGTH = GxMath::VALUE_512;
445 static constexpr u32 MAX_LENGTH = 0x0FFFFFFF;
447 static constexpr u32 TEMPORARY_STACK_SIZE = GxMath::VALUE_2K;
448
450 //-------------------------------------------------------------
452 //-------------------------------------------------------------
454
456 GxStringW(void) : _pString(nullptr), _allocSize(0){ setString(L""); }
458 GxStringW(const GxStringW& string) : _pString(nullptr), _allocSize(0){ setString(string._pString); }
460 GxStringW(GX_CWSTR string) : _pString(nullptr), _allocSize(0){ setString(string); }
462 ~GxStringW(void);
464 GX_FORCE_INLINE void clear(void){ copyString(L""); }
465
467 //-------------------------------------------------------------
469 //-------------------------------------------------------------
471
473 GX_FORCE_INLINE const GxStringW& operator = (GX_CWSTR string){ copyString(string); return *this; }
475 GX_FORCE_INLINE const GxStringW& operator = (const GxStringW& string){ copyString(string._pString); return *this; }
477 GX_FORCE_INLINE void operator += (GX_CWCHAR character){ GX_CWCHAR temporary[2] = {character, 0x0000}; concatenate(temporary); }
479 GX_FORCE_INLINE void operator += (GX_CWSTR string){ concatenate(string); }
481 GX_FORCE_INLINE GxStringW operator + (GX_CWSTR string){ GxStringW result(*this); result.concatenate(string); return result; }
483 GX_FORCE_INLINE b32 operator == (GX_CWSTR string) const { return compare(string) == 0; }
485 GX_FORCE_INLINE b32 operator == (const GxStringW& string) const { return compare(string) == 0; }
487 GX_FORCE_INLINE b32 operator != (GX_CWSTR string) const { return compare(string) != 0; }
489 GX_FORCE_INLINE b32 operator != (const GxStringW& string) const { return compare(string) != 0; }
490
492 //-------------------------------------------------------------
494 //-------------------------------------------------------------
496
498 constexpr u32 getLength(void) const { return _length; }
500 static u32 getLength(GX_CWSTR string);
502 static u32 constexpr getBytesUtf16(GX_CWSTR /*string*/){ return 2; }
504 GX_FORCE_INLINE GX_WSTR getString(void){ return _pString; }
506 constexpr GX_CWSTR getString(void) const { return _pString; }
508 static b32 isHalfKanaUtf16(GX_CWCHAR character);
510 GX_FORCE_INLINE void getLeft(GxStringW& left, u32 length) const { getSubString(left, 0, length); }
512 GX_FORCE_INLINE void getRight(GxStringW& right, u32 length) const { getSubString(right, _length - length, length); }
514 void getSubString(GxStringW& subString, u32 start, u32 length = MAX_LENGTH) const;
515
516protected:
518 void getStringProperty(void* pValue);
520 void setStringProperty(const void* pValue);
521
523 //-------------------------------------------------------------
525 //-------------------------------------------------------------
527public:
529 s32 find(GX_CWSTR string, u32 start = 0) const;
531 s32 find(GX_WCHAR character, u32 start = 0) const;
533 s32 findReverse(GX_WCHAR character, s32 start = -1) const;
535 GX_FORCE_INLINE s32 compare(GX_CWSTR string) const { return compare(_pString, string); }
537 GX_FORCE_INLINE s32 compare(const GxStringW& string) const { return compare(_pString, string._pString); }
539 static s32 compare(GX_CWSTR string0, GX_CWSTR string1);
541 GX_FORCE_INLINE s32 icompare(GX_CWSTR string) const { return icompare(_pString, string); }
543 GX_FORCE_INLINE s32 icompare(const GxStringW& string) const { return icompare(_pString, string._pString); }
545 static s32 icompare(GX_CWSTR string0, GX_CWSTR string1);
547 static void itoa(s64 value, GX_WSTR string);
549 static void uitoa(u64 value, GX_WSTR string);
551 static s64 atoi(GX_CWSTR string);
553 static u64 atoui(GX_CWSTR string);
555 static GX_FORCE_INLINE GX_WCHAR utol(GX_WCHAR character) { return (L'Z' >= character && character >= L'A') ? (character + 0x20) : character; }
557 static GX_FORCE_INLINE GX_WCHAR ltou(GX_WCHAR character) { return (L'z' >= character && character >= L'a') ? (character - 0x20) : character; }
559 static void sjisToUtf16(GX_CSTR sjis, GX_WSTR utf16);
561 static void utf16ToSjis(GX_CWSTR utf16, GX_STR sjis);
563 static void utf8ToUtf16(GX_CSTR utf8, GX_WSTR utf16);
565 static void utf16ToUtf8(GX_CWSTR utf16, GX_STR utf8);
567 GX_FORCE_INLINE static void setCallbackSjisToUtf16(GxCallback::GxHandlerBase handler){ _callbackSjisToUtf16 = handler; }
569 GX_FORCE_INLINE static void setCallbackUtf16ToSjis(GxCallback::GxHandlerBase handler){ _callbackUtf16ToSjis = handler; }
571 GX_FORCE_INLINE static void setCallbackUtf8ToUtf16(GxCallback::GxHandlerBase handler){ _callbackUtf8ToUtf16 = handler; }
573 GX_FORCE_INLINE static void setCallbackUtf16ToUtf8(GxCallback::GxHandlerBase handler){ _callbackUtf16ToUtf8 = handler; }
574
575private:
577 void setString(GX_CWSTR string);
579 void concatenate(GX_CWSTR string);
581 void copyString(GX_CWSTR string);
583 void deleteString(void);
584
586 //-------------------------------------------------------------
588 //-------------------------------------------------------------
590private:
591 GX_WCHAR* _pString;
592 u32 _length;
593 u32 _allocSize;
594 GX_WCHAR _marginString[MARGIN_LENGTH + 1];
595 static GxCallback::GxHandlerBase _callbackSjisToUtf16;
596 static GxCallback::GxHandlerBase _callbackUtf16ToSjis;
597 static GxCallback::GxHandlerBase _callbackUtf8ToUtf16;
598 static GxCallback::GxHandlerBase _callbackUtf16ToUtf8;
599
601};
602
604#define GX_STRLEN(__STRING__) GxString::getLength(__STRING__)
606#define GX_WCSLEN(__STRING__) GxStringW::getLength(__STRING__)
608#define GX_STRCAT(__DST__, __SRC__) GxString::concatenate(__DST__, __SRC__)
610#define GX_STRNCAT(__DST__, __SRC__, __LENGTH__) GxString::nconcatenate(__DST__, __SRC__, __LENGTH__)
612#define GX_STRCPY(__DST__, __SRC__) GxString::copy(__DST__, __SRC__)
614#define GX_STRNCPY(__DST__, __SRC__, __LENGTH__) GxString::ncopy(__DST__, __SRC__, __LENGTH__)
616#define GX_STRCMP(__STRING0__, __STRING1__) GxString::compare(__STRING0__, __STRING1__)
618#define GX_STRICMP(__STRING0__, __STRING1__) GxString::icompare(__STRING0__, __STRING1__)
620#define GX_STRNCMP(__STRING0__, __STRING1__, __LENGTH__) GxString::ncompare(__STRING0__, __STRING1__, __LENGTH__)
622#define GX_STRNICMP(__STRING0__, __STRING1__, __LENGTH__) GxString::nicompare(__STRING0__, __STRING1__, __LENGTH__)
624#define GX_WSTRCMP(__STRING0__, __STRING1__) GxStringW::compare(__STRING0__, __STRING1__)
626#define GX_WSTRICMP(__STRING0__, __STRING1__) GxStringW::icompare(__STRING0__, __STRING1__)
627
628GX_CORE_NAMESPACE_END()
GX_FORCE_INLINE b32 operator==(const GxColor color0, const GxColor color1)
Definition GxColor.inl:274
GX_FORCE_INLINE const GxColor operator+(const GxColor color, u32 scalar)
Definition GxColor.inl:178
GX_FORCE_INLINE b32 operator!=(const GxColor color0, const GxColor color1)
Definition GxColor.inl:285
@ MAX
定義数
ハンドラ基本クラス
Definition GxCallback.h:27
算術演算クラス
Definition GxMath.h:84
static constexpr u32 VALUE_512
512
Definition GxMath.h:128
static constexpr u32 VALUE_2K
2K
Definition GxMath.h:130
static constexpr u32 VALUE_16
16
Definition GxMath.h:123
トークン操作クラス
Definition GxString.h:337
constexpr void setIgnore(GX_CHAR character)
無視する囲い文字の設定
Definition GxString.h:366
constexpr u32 getSplitLength(void) const
分割した数を取得
Definition GxString.h:398
void addDelimiter(GX_CHAR delimiter)
区切り文字の追加
Definition GxString.cpp:2276
static constexpr u32 TEMPORARY_LENGTH
テンポラリサイズ
Definition GxString.h:346
void getRest(GxString *pString) const
残りの文字列を取得
Definition GxString.cpp:2370
b32 getPrevious(GxString *pString=nullptr)
前の文字列を取得
Definition GxString.cpp:2298
static constexpr u32 DELIMITER_MAX
区切り文字最大数
Definition GxString.h:348
void getCurrent(GxString *pString)
現在の文字列を取得
Definition GxString.cpp:2345
u32 split(void)
文字列を分割する
Definition GxString.cpp:2250
GX_CSTR getFromIndex(u32 index) const
指定されたインデックスの文字列を取得
Definition GxString.cpp:2381
void initialize(GX_CSTR string, GX_CHAR delimiter, b32 copyFlag=true)
初期化
Definition GxString.cpp:2226
GX_FORCE_INLINE const GxString & getString(void) const
全体の文字列を取得
Definition GxString.h:394
b32 getNext(GxString *pString=nullptr)
次の文字列を取得
Definition GxString.cpp:2323
void getTop(GxString *pString=nullptr)
先頭の文字列を取得
Definition GxString.cpp:2286
文字列型クラス
Definition GxString.h:18
static GX_FORCE_INLINE GX_CHAR utol(GX_CHAR character)
大文字→小文字
Definition GxString.h:274
GX_FORCE_INLINE s32 compare(const GxString &string) const
比較
Definition GxString.h:217
GX_FORCE_INLINE GxString(const GxString &string)
コンストラクタ
Definition GxString.h:75
GX_FORCE_INLINE s32 compare(GX_CSTR string) const
比較
Definition GxString.h:215
static GX_FORCE_INLINE void setCallbackUtf8ToSjis(GxCallback::GxHandlerBase handler)
UTF-8→SJIS変換拡張コールバックを設定
Definition GxString.h:284
constexpr GX_CSTR getString(void) const
文字列取得
Definition GxString.h:167
GxString(void)
デフォルトコンストラクタ
Definition GxString.h:73
GX_FORCE_INLINE GxString(GX_CSTR string)
コンストラクタ
Definition GxString.h:77
GX_FORCE_INLINE void getRight(GxString &right, u32 length) const
右文字列取得
Definition GxString.h:171
static GX_FORCE_INLINE s32 ncompare(GX_CSTR string0, GX_CSTR string1, u32 length)
比較(長さ指定)
Definition GxString.h:227
static GX_FORCE_INLINE GX_CHAR ltou(GX_CHAR character)
小文字→大文字
Definition GxString.h:276
GX_FORCE_INLINE s32 icompare(const GxString &string) const
比較(大文字、小文字の区別なし)
Definition GxString.h:223
GX_FORCE_INLINE void getLeft(GxString &left, u32 length) const
左文字列取得
Definition GxString.h:169
constexpr u32 getLength(void) const
文字列の長さを取得
Definition GxString.h:119
CODE
コード分類定義
Definition GxString.h:41
GX_FORCE_INLINE GX_STR getString(void)
文字列取得
Definition GxString.h:165
GX_FORCE_INLINE void clear(void)
クリア
Definition GxString.h:81
static b32 isWhiteSpace(GX_CCHAR character)
空白文字か判定
Definition GxString.h:157
static GX_FORCE_INLINE void setCallbackSjisToUtf8(GxCallback::GxHandlerBase handler)
SJIS→UTF-8変換拡張コールバックを設定
Definition GxString.h:282
GX_FORCE_INLINE s32 icompare(GX_CSTR string) const
比較(大文字、小文字の区別なし)
Definition GxString.h:221
ワイド文字列型クラス(UTF-16用)
Definition GxString.h:430
static constexpr u32 MARGIN_LENGTH
元々持っている文字列の長さ
Definition GxString.h:439
static u32 constexpr getBytesUtf16(GX_CWSTR)
文字のバイト数取得(UTF16)
Definition GxString.h:502
static GX_FORCE_INLINE void setCallbackUtf16ToUtf8(GxCallback::GxHandlerBase handler)
UTF-16→UTF-8変換拡張コールバックを設定
Definition GxString.h:573
static void utf8ToUtf16(GX_CSTR utf8, GX_WSTR utf16)
UTF-8をUTF-16へ変換
Definition GxString.cpp:2831
GX_FORCE_INLINE void getLeft(GxStringW &left, u32 length) const
左文字列取得
Definition GxString.h:510
static void itoa(s64 value, GX_WSTR string)
整数→文字列
Definition GxString.cpp:2608
static constexpr u32 ALLOC_BLOCK_SIZE
確保する文字列のブロックサイズ
Definition GxString.h:441
GxStringW(const GxStringW &string)
コンストラクタ
Definition GxString.h:458
GX_FORCE_INLINE s32 icompare(GX_CWSTR string) const
比較(大文字、小文字の区別なし)
Definition GxString.h:541
GX_FORCE_INLINE const GxStringW & operator=(GX_CWSTR string)
代入
Definition GxString.h:473
GX_FORCE_INLINE s32 compare(const GxStringW &string) const
比較
Definition GxString.h:537
GX_FORCE_INLINE void getRight(GxStringW &right, u32 length) const
右文字列取得
Definition GxString.h:512
static b32 isHalfKanaUtf16(GX_CWCHAR character)
半角カナか判定(UTF16)
Definition GxString.cpp:2477
static GX_FORCE_INLINE void setCallbackUtf16ToSjis(GxCallback::GxHandlerBase handler)
UTF-16→SJIS変換拡張コールバックを設定
Definition GxString.h:569
static u64 atoui(GX_CWSTR string)
文字列→非負整数
Definition GxString.cpp:2674
s32 find(GX_CWSTR string, u32 start=0) const
文字列検索
Definition GxString.cpp:2510
static constexpr u32 TEMPORARY_LENGTH
一時領域のサイズ
Definition GxString.h:443
static GX_FORCE_INLINE void setCallbackSjisToUtf16(GxCallback::GxHandlerBase handler)
SJIS→UTF-16変換拡張コールバックを設定
Definition GxString.h:567
static GX_FORCE_INLINE GX_WCHAR ltou(GX_WCHAR character)
小文字→大文字
Definition GxString.h:557
s32 findReverse(GX_WCHAR character, s32 start=-1) const
文字検索(終端から検索)
Definition GxString.cpp:2558
static s64 atoi(GX_CWSTR string)
文字列→整数
Definition GxString.cpp:2654
~GxStringW(void)
デストラクタ
Definition GxString.cpp:2457
GX_FORCE_INLINE void operator+=(GX_CWCHAR character)
結合代入
Definition GxString.h:477
GX_FORCE_INLINE b32 operator!=(GX_CWSTR string) const
不一致
Definition GxString.h:487
constexpr GX_CWSTR getString(void) const
文字列取得
Definition GxString.h:506
GX_FORCE_INLINE b32 operator==(GX_CWSTR string) const
一致
Definition GxString.h:483
static void uitoa(u64 value, GX_WSTR string)
非負整数→文字列
Definition GxString.cpp:2635
void getSubString(GxStringW &subString, u32 start, u32 length=MAX_LENGTH) const
指定位置からの抜き出し
Definition GxString.cpp:2492
static void utf16ToUtf8(GX_CWSTR utf16, GX_STR utf8)
UTF-16をUTF-8へ変換
Definition GxString.cpp:2918
static GX_FORCE_INLINE void setCallbackUtf8ToUtf16(GxCallback::GxHandlerBase handler)
UTF-8→UTF-16変換拡張コールバックを設定
Definition GxString.h:571
constexpr u32 getLength(void) const
文字列の長さを取得
Definition GxString.h:498
GX_FORCE_INLINE GX_WSTR getString(void)
文字列取得
Definition GxString.h:504
GX_FORCE_INLINE s32 icompare(const GxStringW &string) const
比較(大文字、小文字の区別なし)
Definition GxString.h:543
GxStringW(GX_CWSTR string)
コンストラクタ
Definition GxString.h:460
static void utf16ToSjis(GX_CWSTR utf16, GX_STR sjis)
UTF-16をSJISへ変換
Definition GxString.cpp:2772
void setStringProperty(const void *pValue)
文字列設定(プロパティ用)
Definition GxString.cpp:2984
static GX_FORCE_INLINE GX_WCHAR utol(GX_WCHAR character)
大文字→小文字
Definition GxString.h:555
GX_FORCE_INLINE void clear(void)
クリア
Definition GxString.h:464
GX_FORCE_INLINE GxStringW operator+(GX_CWSTR string)
結合
Definition GxString.h:481
static constexpr u32 MAX_LENGTH
最大長定義
Definition GxString.h:445
static constexpr u32 TEMPORARY_STACK_SIZE
一時メモリにスタックを使うか閾値
Definition GxString.h:447
GX_FORCE_INLINE s32 compare(GX_CWSTR string) const
比較
Definition GxString.h:535
void getStringProperty(void *pValue)
文字列取得(プロパティ用)
Definition GxString.cpp:2975
static void sjisToUtf16(GX_CSTR sjis, GX_WSTR utf16)
UTF-SJISをUTF-16へ変換
Definition GxString.cpp:2690
Definition GxBase.h:24
32bitブーリアン
Definition GxDefine.h:173