TNB Library
TnbLongInteger.h
[詳解]
1#pragma once
11#include "TnbComparable.h"
12#include "TnbSerializer.h"
13#include "TnbStr.h"
14
15
16
17//TNB Library
18namespace TNB
19{
20
21
22
41template<size_t PLACE = 8>
42class CLongIntegerT : public IComparableT< TNB::CLongIntegerT<PLACE> >, public ISerializable
43{
44public:
45
51 {
52 Zero();
53 }
54
60 {
61 loop ( i, DWORD_LEN )
62 {
63 m_num[i] = other.m_num[i];
64 }
65 }
66
71 CLongIntegerT(LONGLONG val)
72 {
73 operator=(val);
74 }
75
80 void Zero(void)
81 {
82 loop ( i, DWORD_LEN )
83 {
84 m_num[i] = 0;
85 }
86 }
87
99 size_t SetString(LPCTSTR lpsz)
100 {
101 Zero();
102 CStr str = lpsz;
103 size_t len = str.GetLength();
104 bool isMinus = false;
105 loop ( i, len )
106 {
107 if ( i == 0 && str[i] == '-' )
108 {
109 isMinus = true;
110 }
111 else if ( str[i] < '0' || str[i] > '9' )
112 {
113 len = i;
114 break;
115 }
116 }
117 size_t ret = len;
118 if ( isMinus )
119 {
120 len--;
121 str = str.Mid(1, len);
122 }
123 else
124 {
125 str = str.Left(len);
126 }
127 INDEX cnt = 0;
128 while ( len > 0 )
129 {
130 CStr s = str.Right(9);
131 CLongIntegerT x(s.ToInt());
132 loop ( i, cnt )
133 {
134 x *= INT_VALUE_MAX;
135 }
136 operator+=(x);
137 len -= s.GetLength();
138 str = str.Left(len);
139 cnt++;
140 }
141 if ( isMinus )
142 {
143 *this = operator-();
144 }
145 return ret;
146 }
147
161 size_t SetHexString(LPCTSTR lpsz)
162 {
163 Zero();
164 size_t len = STRLIB::GetLen(lpsz);
165 loop ( i, len )
166 {
167 if ( STRLIB::HexCharToInt(lpsz[i]) < 0 )
168 {
169 len = i;
170 break;
171 }
172 }
173 loop( i, len )
174 {
175 size_t j = i / 8;
176 if ( j >= DWORD_LEN )
177 {
178 break;
179 }
180 int c = STRLIB::HexCharToInt(lpsz[len - 1 - i]);
181 DWORD k = (c & 0xFF) << ((i & 7) * 4);
182 m_num[j] |= k;
183 }
184 return len;
185 }
186
196 void SetRawData(size_t size, LPCVOID lpRawData)
197 {
198 Zero();
199 if ( size > BYTE_LEN )
200 {
201 size = BYTE_LEN;
202 }
203 const BYTE* P1 = static_cast<const BYTE*>(lpRawData);
204 BYTE* P2 = reinterpret_cast<BYTE*>(m_num);
205 loop ( i, size )
206 {
207 *P2++ = *P1++;
208 }
209 }
210
217 void GetRawData(CWorkMem& _rawData) const
218 {
219 _rawData.Resize(BYTE_LEN);
220 const BYTE* P1 = reinterpret_cast<const BYTE*>(m_num);
221 BYTE* P2 = _rawData.Ref();
222 loop ( i, BYTE_LEN )
223 {
224 *P2++ = *P1++;
225 }
226 }
227
234 const BYTE* RefRawData(void) const
235 {
236 return reinterpret_cast<const BYTE*>(m_num);
237 }
238
245 bool GetBit(INDEX bitNo) const
246 {
247 size_t l = bitNo / 32;
248 if ( l < DWORD_LEN )
249 {
250 return (m_num[l] & _BIT(bitNo % 32)) != 0;
251 }
252 return false;
253 }
254
260 void SetBit(INDEX bitNo, bool v = true)
261 {
262 size_t l = bitNo / 32;
263 if ( l < DWORD_LEN )
264 {
265 if ( v )
266 {
267 m_num[l] |= _BIT(bitNo % 32);
268 }
269 else
270 {
271 m_num[l] &= ~_BIT(bitNo % 32);
272 }
273 }
274 }
275
282 {
283 loop ( i, DWORD_LEN )
284 {
285 m_num[i] = other.m_num[i];
286 }
287 return *this;
288 }
289
296 {
297 LONGLONG* P =reinterpret_cast<LONGLONG*>(m_num);
298 *P = val;
299 DWORD u = (val < 0) ? DWORD_MAX : 0;
300 for ( size_t i = 2 ; i < DWORD_LEN; i++ )
301 {
302 m_num[i] = u;
303 }
304 return *this;
305 }
306
313 {
314 return *this;
315 }
316
323 {
325 loop ( i, DWORD_LEN )
326 {
327 x.m_num[i] = ~m_num[i];
328 }
329 if ( x.m_num[0] == DWORD_MAX )
330 {
331 //桁上がり
332 x.m_num[0] = 0;
333 for ( size_t i = 1; i < DWORD_LEN; i++ )
334 {
335 if ( x.m_num[i] == DWORD_MAX )
336 {
337 x.m_num[i] = 0;
338 }
339 else
340 {
341 x.m_num[i]++;
342 break;
343 }
344 }
345 }
346 else
347 {
348 x.m_num[0]++;
349 }
350 return x;
351 }
352
358 {
360 loop ( i, DWORD_LEN )
361 {
362 x.m_num[i] = ~m_num[i];
363 }
364 return x;
365 }
366
374 {
375 return operator-=(-val);
376 }
377
385 {
386 if ( this != &val )
387 {
388 loop ( i, DWORD_LEN )
389 {
390 bool isBorrow = true;
391 if ( m_num[i] >= val.m_num[i] )
392 {
393 isBorrow = false;
394 }
395 m_num[i] -= val.m_num[i];
396 size_t j = i + 1;
397 while ( isBorrow && j < DWORD_LEN )
398 {
399 if ( m_num[j] >= 1 )
400 {
401 isBorrow = false;
402 }
403 m_num[j]--;
404 j++;
405 }
406 }
407 }
408 else
409 {
410 Zero();
411 }
412 return *this;
413 }
414
422 {
423 *this = operator*(*this, val);
424 return *this;
425 }
426
434 {
435 *this = operator/(*this, val);
436 return *this;
437 }
438
446 {
447 *this = operator%(*this, val);
448 return *this;
449 }
450
458 {
459 loop ( i, DWORD_LEN )
460 {
461 m_num[i] &= val.m_num[i];
462 }
463 return *this;
464 }
465
473 {
474 loop ( i, DWORD_LEN )
475 {
476 m_num[i] |= val.m_num[i];
477 }
478 return *this;
479 }
480
488 {
489 loop ( i, DWORD_LEN )
490 {
491 m_num[i] ^= val.m_num[i];
492 }
493 return *this;
494 }
495
503 {
504 while ( val > 0 )
505 {
506 if ( val >= 32 )
507 {
508 for ( int i = DWORD_LEN - 1; i > 0; i-- )
509 {
510 m_num[i] = m_num[i - 1];
511 }
512 val -= 32;
513 m_num[0] = 0;
514 }
515 else
516 {
517 for ( int i = DWORD_LEN - 1; i > 0; i-- )
518 {
519 m_num[i] = (m_num[i] << 1) | ((m_num[i - 1] & 0x80000000) ? 1 : 0);
520 }
521 m_num[0] <<= 1;
522 val--;
523 }
524 }
525 return *this;
526 }
527
535 {
536 while ( val > 0 )
537 {
538 if ( val >= 32 )
539 {
540 loop ( i, DWORD_LEN - 1 )
541 {
542 m_num[i] = m_num[i + 1];
543 }
544 m_num[DWORD_LEN - 1] = 0;
545 val -= 32;
546 }
547 else
548 {
549 loop ( i, DWORD_LEN - 1 )
550 {
551 m_num[i] = (m_num[i] >> 1) | ((m_num[i + 1] & 1) ? 0x80000000 : 0);
552 }
553 m_num[DWORD_LEN - 1] >>= 1;
554 val--;
555 }
556 }
557 return *this;
558 }
559
566 CLongIntegerT operator<<(size_t val) const
567 {
568 CLongIntegerT x = *this;
569 x.operator<<=(val);
570 return x;
571 }
572
579 CLongIntegerT operator>>(size_t val) const
580 {
581 CLongIntegerT x = *this;
582 x.operator>>=(val);
583 return x;
584 }
585
592 {
593 m_num[0]--;
594 if ( m_num[0] == DWORD_MAX )
595 {
596 for ( size_t i = 1; i < DWORD_LEN; i++ )
597 {
598 m_num[i]--;
599 if ( m_num[i] != DWORD_MAX )
600 {
601 break;
602 }
603 }
604 }
605 return *this;
606 }
607
614 {
615 CLongIntegerT x = *this;
616 operator--();
617 return x;
618 }
619
626 {
627 m_num[0]++;
628 if ( m_num[0] == 0 )
629 {
630 for ( size_t i = 1; i < DWORD_LEN; i++ )
631 {
632 m_num[i]++;
633 if ( m_num[i] != 0 )
634 {
635 break;
636 }
637 }
638 }
639 return *this;
640 }
641
648 {
649 CLongIntegerT x = *this;
650 operator++();
651 return x;
652 }
653
661 {
662 CLongIntegerT x = a;
663 x.operator+=(b);
664 return x;
665 }
666
674 {
675 CLongIntegerT x = a;
676 x.operator-=(b);
677 return x;
678 }
679
687 {
688 CWorkMemT<DWORD> w(DWORD_LEN * 2);
689 w.Fill(0);
690 const BYTE* pV1 = reinterpret_cast<const BYTE*>(a.m_num);
691 const BYTE* pV2 = reinterpret_cast<const BYTE*>(b.m_num);
692 BYTE* pWork = reinterpret_cast<BYTE*>(w.Ref());
693 loop ( i, BYTE_LEN )
694 {
695 if ( pV2[i] != 0 )
696 {
697 loop ( j, BYTE_LEN )
698 {
699 if ( pV1[j] != 0 )
700 {
701 size_t ix = i + j;
702 BYTE* P = &pWork[ix];
703 DWORD kk = pV1[j] * pV2[i] + *P;
704 *P++ = static_cast<BYTE>(kk & 0xFF);
705 ix++;
706 kk /= 0x100;
707 while ( (kk != 0) && (ix < (BYTE_LEN * 2)) )
708 {
709 kk += *P;
710 *P++ = static_cast<BYTE>(kk & 0xFF);
711 ix++;
712 kk /= 0x100;
713 }
714 }
715 }
716 }
717 }
719 loop ( i, DWORD_LEN )
720 {
721 x.m_num[i] = w[i];
722 }
723 return x;
724 }
725
733 {
734 CLongIntegerT quotient;
735 CLongIntegerT remainder;
736 m_Divide(a, b, quotient, remainder);
737 return quotient;
738 }
739
747 {
748 CLongIntegerT quotient;
749 CLongIntegerT remainder;
750 m_Divide(a, b, quotient, remainder);
751 return remainder;
752 }
753
761 {
762 CLongIntegerT x = a;
763 x.operator&=(b);
764 return x;
765 }
766
774 {
775 CLongIntegerT x = a;
776 x.operator|=(b);
777 return x;
778 }
779
787 {
788 CLongIntegerT x = a;
789 x.operator^=(b);
790 return x;
791 }
792
798 friend CLongIntegerT abs(const CLongIntegerT& val)
799 {
800 if ( val.IsMinus() )
801 {
802 return -val;
803 }
804 return val;
805 }
806
816 bool Divide(CLongIntegerT& _quotient, CLongIntegerT& _remainder, const CLongIntegerT& val) const
817 {
818 return m_Divide(*this, val, _quotient, _remainder);
819 }
820
828 virtual INT_PTR Compare(const CLongIntegerT<PLACE>& t) const
829 {
830 INT_PTR sign1 = IsMinus() ? -1 : 1;
831 INT_PTR sign2 = t.IsMinus() ? -1 : 1;
832 if ( sign1 == sign2 )
833 {
834 for ( int i = DWORD_LEN - 1; i >= 0; i-- )
835 {
836 if ( m_num[i] > t.m_num[i] )
837 {
838 return sign1;
839 }
840 else if ( m_num[i] < t.m_num[i] )
841 {
842 return -sign1;
843 }
844 }
845 }
846 else
847 {
848 return sign1;
849 }
850 return 0;
851 }
852
859 bool IsMinus(void) const
860 {
861 return (m_num[DWORD_LEN - 1] & 0x80000000) != 0;
862 }
863
870 bool IsZero(void) const
871 {
872 loop ( i, DWORD_LEN )
873 {
874 if ( m_num[i] != 0 )
875 {
876 return false;
877 }
878 }
879 return true;
880 }
881
888 bool CanExpressInt(void) const
889 {
890 return m_CanExpress(1);
891 }
892
898 int ToInt(void) const
899 {
900 return m_num[0];
901 }
902
909 bool CanExpressLonglong(void) const
910 {
911 if ( DWORD_LEN > 2 )
912 {
913 return m_CanExpress(2);
914 }
915 return true;
916 }
917
923 LONGLONG ToLonglong(void) const
924 {
925 LONGLONG r = m_num[1];
926 r <<= 32;
927 return r | m_num[0];
928 }
929
935 size_t GetValidBitsCount(void) const
936 {
937 loop_dn ( i, DWORD_LEN )
938 {
939 if ( m_num[i] != 0 )
940 {
941 loop_dn ( j, 32 )
942 {
943 if ( (m_num[i] & _BIT(j)) != 0 )
944 {
945 return i * 32 + j + 1;
946 }
947 }
948 }
949 }
950 return 0;
951 }
952
959 CStr ToHexString(bool isUpperCase = true) const
960 {
961 CStr s;
962 LPCTSTR lpszFmt = isUpperCase ? _T("%08X") : _T("%08x");
963 loop ( i, DWORD_LEN )
964 {
965 s += CStr::Fmt(lpszFmt, m_num[DWORD_LEN - 1 - i]);
966 }
967 return s;
968 }
969
975 CStr ToString(void) const
976 {
977 CLongIntegerT x = *this;
978 bool isMinus = x.IsMinus();
979 if ( isMinus )
980 {
981 x = -x;
982 }
983 CStr s;
984 while ( x > 0 )
985 {
986 s = CStr::Fmt(_T("%09d"), (x % INT_VALUE_MAX).ToInt()) + s;
987 x /= INT_VALUE_MAX;
988 }
989 s.TrimLeft('0');
990 if ( s.IsEmpty() )
991 {
992 return _T("0");
993 }
994 if ( isMinus )
995 {
996 return _T("-") + s;
997 }
998 return s;
999 }
1000
1006 virtual void Serialize(ISerializer& _sr) const
1007 {
1008 size_t l = DWORD_LEN;
1009 _sr << l << l;
1010 loop ( i, l )
1011 {
1012 _sr << m_num[i];
1013 }
1014 }
1015
1021 virtual void Deserialize(const IDeserializer& ds)
1022 {
1023 Zero();
1024 size_t l1, l2;
1025 ds >> l1 >> l2;
1026 if ( l1 != l2 || l1 != DWORD_LEN )
1027 {
1028 throw CInvalidParamException();
1029 }
1030 loop ( i, l1 )
1031 {
1032 ds >> m_num[i];
1033 }
1034 }
1035
1040 static size_t GetBitsCount(void)
1041 {
1042 return BIT_LEN;
1043 }
1044
1049 static size_t GetBytesCount(void)
1050 {
1051 return BYTE_LEN;
1052 }
1053
1059 static size_t GetMaxPlace(void)
1060 {
1061 return GetMax().ToString().GetLength() - 1;
1062 }
1063
1070 {
1071 CLongIntegerT x;
1072 loop ( i, DWORD_LEN )
1073 {
1074 x.m_num[i] = DWORD_MAX;
1075 }
1076 x.m_num[DWORD_LEN - 1] = 0x7FFFFFFF;
1077 return x;
1078 }
1079
1086 {
1087 CLongIntegerT x;
1088 x.m_num[0] = 1;
1089 x.m_num[DWORD_LEN - 1] = 0x80000000;
1090 return x;
1091 }
1092
1103 static CLongIntegerT FromString(LPCTSTR lpsz)
1104 {
1105 CLongIntegerT x;
1106 x.SetString(lpsz);
1107 return x;
1108 }
1109
1122 static CLongIntegerT FromHexString(LPCTSTR lpsz)
1123 {
1124 CLongIntegerT x;
1125 x.SetHexString(lpsz);
1126 return x;
1127 }
1128
1129private:
1130
1132 static bool m_Divide(const CLongIntegerT& a, const CLongIntegerT& b, CLongIntegerT& _quotient, CLongIntegerT& _remainder)
1133 {
1134 _quotient.Zero();
1135 _remainder.Zero();
1136 if ( a.IsZero() )
1137 {
1138 return true;
1139 }
1140 if ( b.IsZero() )
1141 {
1142 return false ;
1143 }
1144 CLongIntegerT aa = abs(a);
1145 CLongIntegerT bb = abs(b);
1146 if ( aa < bb )
1147 {
1148 _remainder = a;
1149 return true;
1150 }
1151 INT_PTR cnt = aa.GetValidBitsCount() - bb.GetValidBitsCount();
1152 ASSERT( cnt >= 0 );
1153 bb <<= cnt;
1154 for ( INT_PTR i = 0; i <= cnt; i++ )
1155 {
1156 _quotient <<= 1;
1157 if ( aa >= bb )
1158 {
1159 aa -= bb;
1160 _quotient.m_num[0] |= 1;
1161 }
1162 bb >>= 1;
1163 }
1164 if ( a.IsMinus() != b.IsMinus() )
1165 {
1166 _quotient = -_quotient;
1167 }
1168 _remainder = aa;
1169 if ( a.IsMinus() )
1170 {
1171 _remainder = -_remainder;
1172 }
1173 return true;
1174 }
1176 bool m_CanExpress(INDEX idx) const
1177 {
1178 DWORD n = m_num[idx];
1179 if ( n == 0 || n != DWORD_MAX )
1180 {
1181 for ( size_t i = idx + 1; i < DWORD_LEN; i++ )
1182 {
1183 if ( n != m_num[i] )
1184 {
1185 return false;
1186 }
1187 }
1188 return true;
1189 }
1190 return false;
1191 }
1192 #ifdef _TnbDOXYGEN //Document作成用シンボル
1193 INT_PTR operator- (const TYP &t) const
1194 {
1195 return 0;
1196 }
1197 #endif // _TnbDOXYGEN
1199 enum
1200 {
1201 DWORD_LEN = PLACE,
1202 BYTE_LEN = PLACE * 4,
1203 BIT_LEN = PLACE * 32,
1204 INT_VALUE_MAX = 1000000000,
1205 };
1206 DWORD m_num[DWORD_LEN];
1207 friend class CLongIntegerTest;
1208};
1209
1210
1211
1212#ifndef _TnbDOXYGEN //Document作成用シンボル
1213
1214template<> class CLongIntegerT<0>
1215{
1216 CLongIntegerT(void); // PLACE に 0 は指定できません。
1217};
1218
1219template<> class CLongIntegerT<1>
1220{
1221 CLongIntegerT(void); // PLACE に 1 は指定できません。
1222};
1223
1224#endif // _TnbDOXYGEN
1225
1226
1227
1241
1242
1243
1244}; // TNB
比較機能関係のヘッダ
#define loop_dn(VAR, CNT)
loop構文.
Definition: TnbDef.h:355
#define _BIT(X)
BIT演算
Definition: TnbDef.h:307
#define loop(VAR, CNT)
loop構文.
Definition: TnbDef.h:343
シリアライザー関係のヘッダ
文字列管理関係のヘッダ
パラメータ不正例外
Definition: TnbException.h:159
多倍長整数管理
size_t SetHexString(LPCTSTR lpsz)
[代入] 値代入.
void SetBit(INDEX bitNo, bool v=true)
[設定] ビット設定.
CLongIntegerT & operator^=(const CLongIntegerT &val)
[代入] XOR 算代入.
bool GetBit(INDEX bitNo) const
[取得] ビット取得.
CLongIntegerT & operator<<=(size_t val)
[代入] 左シフト代入.
bool CanExpressLonglong(void) const
[確認] 保持値確認.
virtual void Deserialize(const IDeserializer &ds)
[処理] デシリアライズ
CLongIntegerT operator>>(size_t val) const
[計算] 右シフト.
int ToInt(void) const
[取得] int 取得.
CLongIntegerT operator-(void) const
[計算] マイナス符号.
bool Divide(CLongIntegerT &_quotient, CLongIntegerT &_remainder, const CLongIntegerT &val) const
[計算] 除算.
CLongIntegerT & operator--(void)
[代入] デクリメント.
bool IsZero(void) const
[確認] ゼロ確認.
size_t SetString(LPCTSTR lpsz)
[代入] 値代入.
static CLongIntegerT FromString(LPCTSTR lpsz)
[取得] 変換値取得.
CLongIntegerT & operator|=(const CLongIntegerT &val)
[代入] OR 算代入.
LONGLONG ToLonglong(void) const
[取得] LONGLONG 取得.
CLongIntegerT & operator&=(const CLongIntegerT &val)
[代入] AND 算代入.
CLongIntegerT operator+(void) const
[計算] プラス符号.
CLongIntegerT operator~(void) const
[計算] ビット反転.
friend CLongIntegerT operator|(const CLongIntegerT &a, const CLongIntegerT &b)
[計算] OR 算.
bool CanExpressInt(void) const
[確認] 保持値確認.
static CLongIntegerT FromHexString(LPCTSTR lpsz)
[取得] 変換値取得.
CLongIntegerT(void)
コンストラクタ.
friend CLongIntegerT abs(const CLongIntegerT &val)
[計算] 絶対値.
CLongIntegerT & operator/=(const CLongIntegerT &val)
[代入] 除算代入.
CLongIntegerT & operator++(void)
[代入] インクリメント.
CStr ToHexString(bool isUpperCase=true) const
[取得] HEX文字列化.
friend CLongIntegerT operator-(const CLongIntegerT &a, const CLongIntegerT &b)
[計算] 減算.
const BYTE * RefRawData(void) const
[参照] 生データ参照.
friend CLongIntegerT operator*(const CLongIntegerT &a, const CLongIntegerT &b)
[計算] 乗算.
friend CLongIntegerT operator%(const CLongIntegerT &a, const CLongIntegerT &b)
[計算] 余り算.
void Zero(void)
[代入] ゼロ代入.
void GetRawData(CWorkMem &_rawData) const
[取得] 生データ取得.
static CLongIntegerT GetMin(void)
[取得] 最小値取得.
CLongIntegerT & operator=(const CLongIntegerT &other)
コピーオペレータ.
size_t GetValidBitsCount(void) const
[取得] 有効 bit 数取得.
virtual INT_PTR Compare(const CLongIntegerT< PLACE > &t) const
[確認] 比較
CLongIntegerT & operator+=(const CLongIntegerT &val)
[代入] 加算代入.
CLongIntegerT operator--(int)
[代入] デクリメント.
friend CLongIntegerT operator^(const CLongIntegerT &a, const CLongIntegerT &b)
[計算] XOR 算.
CLongIntegerT & operator*=(const CLongIntegerT &val)
[代入] 乗算代入.
CLongIntegerT & operator>>=(size_t val)
[代入] 右シフト代入.
virtual void Serialize(ISerializer &_sr) const
[処理] シリアライズ
static size_t GetBytesCount(void)
[取得] byte 数取得.
bool IsMinus(void) const
[確認] マイナス確認.
CStr ToString(void) const
[取得] 文字列化.
CLongIntegerT operator++(int)
[代入] インクリメント.
CLongIntegerT(const CLongIntegerT &other)
コピーコンストラクタ.
static CLongIntegerT GetMax(void)
[取得] 最大値取得.
CLongIntegerT & operator%=(const CLongIntegerT &val)
[代入] 余り算代入.
static size_t GetBitsCount(void)
[取得] bit 数取得.
friend CLongIntegerT operator+(const CLongIntegerT &a, const CLongIntegerT &b)
[計算] 加算.
CLongIntegerT(LONGLONG val)
代入コンストラクタ.
CLongIntegerT & operator-=(const CLongIntegerT &val)
[代入] 減算代入.
friend CLongIntegerT operator/(const CLongIntegerT &a, const CLongIntegerT &b)
[計算] 除算.
void SetRawData(size_t size, LPCVOID lpRawData)
[設定] 生データ設定.
CLongIntegerT & operator=(LONGLONG val)
代入オペレータ.
CLongIntegerT operator<<(size_t val) const
[計算] 左シフト.
friend CLongIntegerT operator&(const CLongIntegerT &a, const CLongIntegerT &b)
[計算] AND 算.
static size_t GetMaxPlace(void)
[取得] 最大桁数取得.
CStrT & TrimLeft(TYP t=' ')
[処理] 先頭から文字をトリム.
Definition: TnbStr.h:968
bool IsEmpty(void) const
[確認] 空チェック
Definition: TnbStr.h:528
CStrT Left(size_t iSize) const
[作成] 範囲取得.
Definition: TnbStr.h:801
size_t GetLength(void) const
[取得] 文字列長
Definition: TnbStr.h:518
CStrT Right(INT_PTR iSize) const
[作成] 範囲取得.
Definition: TnbStr.h:811
static CStrT Fmt(const TCHAR *lpszFormat,...)
[作成] 書式付き文字列作成
Definition: TnbStr.h:1206
CStrT Mid(INDEX iOffset, size_t iSize=INVALID_SIZE) const
[作成] 範囲取得.
Definition: TnbStr.h:766
int ToInt(INDEX iOffset=0, int iBase=10) const
[取得] 数値(int)へ変換
Definition: TnbStr.h:842
void Fill(const TYP &other)
[設定] 全情報代入.
Definition: TnbDef.h:724
void Resize(size_t l)
[設定] サイズ再設定
Definition: TnbDef.h:672
const TYP * Ref(void) const
[取得] ポインタ取得
Definition: TnbDef.h:712
size_t GetLen(LPCSTR lpsz)
[計算] 文字列長計算(ASCII/SJIS用)
Definition: TnbStrLib.h:44
int HexCharToInt(int c)
[変換] HEX文字数値変換
Definition: TnbStrLib.h:492
CLongIntegerT< 8 > INT256
256bit 整数管理
TNB Library
Definition: TnbDoxyTitle.txt:2
比較機能インターフェース.
Definition: TnbComparable.h:54
デシリアライザーインターフェースクラス.
シリアライザブルインターフェース.
Definition: TnbSerializer.h:47
シリアライザーインターフェースクラス.