CFx SDK Documentation 2026 SP0
Loading...
Searching...
No Matches
OdString.h
Go to the documentation of this file.
1
2// Copyright (C) 2002-2024, Open Design Alliance (the "Alliance").
3// All rights reserved.
4//
5// This software and its documentation and related materials are owned by
6// the Alliance. The software may only be incorporated into application
7// programs owned by members of the Alliance, subject to a signed
8// Membership Agreement and Supplemental Software License Agreement with the
9// Alliance. The structure and organization of this software are the valuable
10// trade secrets of the Alliance and its suppliers. The software is also
11// protected by copyright law and international treaty provisions. Application
12// programs incorporating this software must include the following statement
13// with their copyright notices:
14//
15// This application incorporates Open Design Alliance software pursuant to a license
16// agreement with Open Design Alliance.
17// Open Design Alliance Copyright (C) 2002-2024 by Open Design Alliance.
18// All rights reserved.
19//
20// By use of this software, its documentation or related materials, you
21// acknowledge and accept the above terms.
23
24
25
26
27
28#ifndef __ODSTRING_H__
29#define __ODSTRING_H__
30
31#include <stdarg.h>
32#include <stdio.h>
33
34#include <functional>
35
36#include "OdMutex.h"
37#include "OdPlatformSettings.h"
38#include "OdCodePage.h"
39#include "OdAnsiString.h"
40
41#define odaIsValidString(lpch) (true)
42
43#include "TD_PackPush.h"
44
45#ifdef sgi
46#include <string>
47using namespace std; // va_XXXX items are in std namespace for newest SGI compiler
48#endif
49
87
97{
98public:
99
101
103 { init(); }
104
108
113
116#if defined(_MSC_VER) && _MSC_VER >= 1300
117 OdString(const __wchar_t* source);
118 OdString(const __wchar_t* source, int length);
119#endif
120
121
122 OdString(const char* lpch, OdCodePageId codepage = CP_CNT);
123#ifndef ODA_WINDOWS
124 OdString(const OdChar16_t* lpch, OdCodePageId codepage = CP_CNT);
125#endif
126 OdString(const char* lpch, int nLength, OdCodePageId codepage = CP_CNT);
128protected:
129 explicit OdString(OdStringData* pData);
130public:
131
135 int getLength() const
136 {
137 if (isUnicodeNotInSync())
138 syncUnicode();
139 return getData()->nDataLength;
140 }
141 int getLengthA() const;
142
146 bool isEmpty() const
147 {
148 return (getData()->nDataLength == 0 &&
149 (getData()->ansiString == 0 || getAnsiString()->isEmpty()));
150 }
151
155 void empty();
156
161 OdChar getAt(int charIndex) const
162 {
163#ifdef TD_UNICODE
164 if (isUnicodeNotInSync())
165 syncUnicode();
166#endif
167 ODA_ASSERT(charIndex >= 0);
168 ODA_ASSERT(charIndex < getData()->nDataLength);
169 return getData()->unicodeBuffer[charIndex];
170 }
171
179 OdChar operator[](int charIndex) const
180 {
181 return getAt(charIndex);
182 }
183
191 void setAt(int charIndex, OdChar ch);
192
193#if defined(_MSC_VER) && defined(_WIN32) && defined(_DEBUG) && defined(ODA_LINT)
194#define UPDATECONSTSTRINGDIAGNISTIC
195private:
196 void updateConstStringDiagnostic(const OdChar* pAddr) const;
197public:
198#else
199 #define updateConstStringDiagnostic(pAddr)
200#endif
201
205 const OdChar* c_str() const
206 {
207 if (isUnicodeNotInSync())
208 syncUnicode();
209 const OdChar* pRet = getData()->unicodeBuffer;
211 return pRet;
212 }
213
217 inline operator const OdChar*() const
218 {
219 return c_str();
220 }
221
222#if defined(_MSC_VER) && _MSC_VER >= 1300
223 operator const __wchar_t*() const
224 {
225 return reinterpret_cast<const __wchar_t*>(c_str());
226 }
227#endif
228
229 operator const char*() const;
230
232
234
236
237#ifndef ODA_WINDOWS
239#endif
240
241#if defined(_MSC_VER) && _MSC_VER >= 1300
242 OdString& operator=(const __wchar_t* source){ return operator=((const OdChar*)source); }
243#endif
244
246
247 OdString& operator=(const char* source);
248
257 OdString& operator+=(const OdString& string);
258
268
277 OdString& operator+=(const OdChar* string);
278
279#if defined(_MSC_VER) && _MSC_VER >= 1300
288 OdString& operator+=(const __wchar_t* string){ return operator+=((const OdChar*)string); }
289#endif
290
299 OdString& operator+=(const char* string);
300
306 friend FIRSTDLL_EXPORT OdString operator+(const OdString& string1, const OdString& string2);
309
310 friend FIRSTDLL_EXPORT OdString operator+(const OdString& string1, const OdChar* string2);
311 friend FIRSTDLL_EXPORT OdString operator+(const OdChar* string1, const OdString& string2);
312
328 int compare(const OdChar* otherString) const
329 {
330 if (isUnicodeNotInSync())
331 syncUnicode();
332 return odStrCmp((const wchar_t*)getData()->unicodeBuffer, (const wchar_t*)otherString);
333 }
334
350 inline int compare(const OdString& otherString) const{ return compare(otherString.c_str());}
351
352#if defined(_MSC_VER) && _MSC_VER >= 1300
368 int compare(const __wchar_t* otherString) const { return compare((const OdChar*)otherString);}
369#endif
370
386 int compare(const char* otherString) const;
387
403 int iCompare(const OdChar* otherString) const
404 {
405 if (isUnicodeNotInSync())
406 syncUnicode();
407 return odStrICmp(getData()->unicodeBuffer, otherString);
408 }
409
425 inline int iCompare(const OdString& otherString) const{ return iCompare(otherString.c_str()); }
426#if defined(_MSC_VER) && _MSC_VER >= 1300
442 __forceinline int iCompare(const __wchar_t* otherString) const {return iCompare((const OdChar*)otherString);}
443#endif
444
451 OdString mid(int startIndex, int length) const;
452
458 OdString mid(int startIndex) const;
459
464 OdString left(int length) const;
465
471
483 OdString spanIncluding(const OdChar* charSet) const;
484
496 inline OdString spanIncluding(const OdString& charSet) const { return spanIncluding(charSet.c_str()); }
497
498#if defined(_MSC_VER) && _MSC_VER >= 1300
510 OdString spanIncluding(const __wchar_t* charSet) const{return spanIncluding((const OdChar*)charSet);}
511#endif
512
524 OdString spanExcluding(const OdChar* charSet) const;
525
537 inline OdString spanExcluding(const OdString& charSet) const{ return spanExcluding(charSet.c_str());}
538
539#if defined(_MSC_VER) && _MSC_VER >= 1300
551 OdString spanExcluding(const __wchar_t* charSet) const{return spanExcluding((const OdChar*)charSet);}
552#endif
553
561
569
577
578
588
598
610
621 OdString& trimRight(const OdChar* whiteChars);
622
633 inline OdString& trimRight(const OdString& whiteChars){ return trimRight(whiteChars.c_str());}
634
635#if defined(_MSC_VER) && _MSC_VER >= 1300
646 OdString& trimRight(const __wchar_t* whiteChars){return trimRight((const OdChar*)whiteChars);}
647#endif
648
660
671 OdString& trimLeft(const OdChar* whiteChars);
672
683 inline OdString& trimLeft(const OdString& whiteChars){ return trimLeft(whiteChars.c_str());}
684
685#if defined(_MSC_VER) && _MSC_VER >= 1300
696 OdString& trimLeft(const __wchar_t* whiteChars){return trimLeft((const OdChar*)whiteChars);}
697#endif
707 int replace(OdChar oldChar, OdChar newChar);
708
718 int replace(const OdChar* oldString, const OdChar* newString);
719
729 inline int replace(const OdString& oldString, const OdString& newString){ return replace(oldString.c_str(), newString.c_str());}
730
731#if defined(_MSC_VER) && _MSC_VER >= 1300
732
742 int replace(const __wchar_t* oldString, const __wchar_t* newString){return replace((const OdChar*)oldString, (const OdChar*)newString);}
743#endif
752 int remove(OdChar chRemove);
753
767 int insert(int insertIndex, OdChar insertChar);
768
772
785 int insert(int insertIndex, const OdChar* insertString);
786
799 int insert(int insertIndex, const OdString& insertString){return insert(insertIndex, insertString.c_str());}
800
801#if defined(_MSC_VER) && _MSC_VER >= 1300
814 int insert(int insertIndex, const __wchar_t* insertString){return insert(insertIndex,(const OdChar*)insertString);}
815#endif
824 int deleteChars(int deleteIndex, int count = 1);
825
826
835 int find(OdChar searchChar) const;
836
845 int reverseFind(OdChar searchChar) const;
846
856 int reverseFind(OdChar searchChar, int startIndex) const;
857
869 int find(OdChar searchChar, int startIndex) const;
870
879 int findOneOf(const OdChar* charSet) const;
880
889 int find(const OdChar* searchString) const;
890
900 int find(const OdChar* searchString, int startIndex) const;
901
902#if defined(_MSC_VER) && _MSC_VER >= 1300
911 int findOneOf(const __wchar_t* charSet) const{return findOneOf((const OdChar*)charSet);}
912
921 int findOneOf(const OdString& charSet) const{return findOneOf((const OdChar*)charSet);}
922
923 int find(const __wchar_t* searchString) const{return find((const OdChar*)searchString);}
924
925 int find(const OdString& searchString) const{return find((const OdChar*)searchString);}
926
927 int find(const __wchar_t* searchString, int startIndex) const{return find((const OdChar*)searchString,startIndex);}
928
929 int find(const OdString& searchString, int startIndex) const{return find((const OdChar*)searchString,startIndex);}
930#endif
938 OdString& format(const OdChar* formatString, ...);
939
940#if defined(_MSC_VER) && _MSC_VER >= 1300
948 OdString& format(const __wchar_t* formatString, ...);
949#endif
950
959 OdString& formatV(const OdChar* formatString, va_list argList);
960
961#if defined(_MSC_VER) && _MSC_VER >= 1300
970 inline OdString& formatV(const __wchar_t* formatString, va_list argList)
971 {
972 return formatV((const OdChar*)formatString, argList);
973 }
974#endif
975
987 OdChar* getBuffer(int minBufLength);
988
995 void releaseBuffer(int newLength = -1);
996
1007
1012
1017
1022
1023/* disable wide char functionalities
1024 Constructor. This OdString will receive a copy of the wide character string referenced
1025 by lpsz.
1026 OdString(const OdCharW* lpsz);
1027
1028 Constructor. This OdString will receive a copy of the first nLength wide characters of
1029 the string referenced by lpch.
1030 OdString(const OdCharW* lpch, int nLength);
1031
1032 Assignment operator. This OdString is assigned the value of lpsz.
1033 const OdString& operator=(const OdCharW* lpsz);
1034
1035*/
1036
1037#ifdef NOT_IMPLEMENTED
1038
1055 int collate(const OdChar* otherString) const;
1056
1073 int iCollate(const OdChar* otherString) const;
1074
1082 OdString& ODA_CDECL format(unsigned int formatID, ...);
1083#endif
1084
1085
1086public:
1088
1092 int getAllocLength() const
1093 { return getData()->nAllocLength; }
1094
1102 inline void preallocate(int length)
1103 {
1105 m_pData->nDataLength = 0;
1106 }
1107
1108protected:
1110
1115
1120 { ODA_ASSERT(m_pData!= NULL); return m_pData; }
1121
1125 void init();
1126
1137 void allocCopy(OdString& destString, int copyLength, int copyIndex, int extraLength) const;
1138
1144 void allocBuffer(int length, bool allocAlways = false);
1145
1155 void assignCopy(int sourceLength, const OdChar* source);
1156
1168 void concatCopy(int sourceLength1, const OdChar* source1, int sourceLength2, const OdChar* source2);
1169
1179 void concatInPlace(int sourceLength, const OdChar* source);
1180
1189
1197 void allocBeforeWrite(int newLength);
1198
1212 void release();
1213
1214 static void release(OdStringData* pStringData);
1215
1222 static int safeStrlen(const OdChar* string)
1223 { return (string == NULL) ? (int)0 : (int)odStrLen((const wchar_t*)string); }
1224
1229 static void freeData(OdStringData* pStringData);
1230
1232 {
1233 return !getData()->unicodeBuffer && getData()->ansiString;
1234 }
1235 void syncUnicode() const;
1237 {
1238 if (getData()->ansiString)
1239 return reinterpret_cast<OdAnsiString*>(&getData()->ansiString);
1240 else
1241 return 0;
1242 }
1243 void freeAnsiString()const;
1244 friend class OdAnsiString;
1245public:
1249 struct lessnocase { bool operator()(const OdString& x, const OdString& y) const { return x.iCompare(y) < 0; } };
1250};
1251
1252template<>
1253struct FIRSTDLL_EXPORT std::hash<OdString> {
1254 std::size_t operator()(const OdString& key) const ODRX_NOEXCEPT;
1255};
1256
1259
1260#if defined(_MSC_VER) && _MSC_VER >= 1300
1261inline OdString operator+(const OdString& string1, const __wchar_t* string2)
1262{
1263 return operator+(string1, (const OdChar*)string2);
1264}
1265inline OdString operator+(const __wchar_t* string1, const OdString& string2)
1266{
1267 return operator+((const OdChar*)string1, string2);
1268}
1269#endif
1270
1271inline bool operator==(const OdString& s1, const OdString& s2)
1272 { return s1.compare(s2) == 0; }
1273
1274inline bool operator==(const OdString& s1, const OdChar* s2)
1275 { return s1.compare(s2) == 0; }
1276
1277inline bool operator==(const OdChar* s1, const OdString& s2)
1278 { return s2.compare(s1) == 0; }
1279
1280#if defined(_MSC_VER) && _MSC_VER >= 1300
1281inline bool operator==(const OdString& s1, const __wchar_t* s2)
1282{ return s1.compare((const OdChar*)s2) == 0; }
1283
1284inline bool operator==(const __wchar_t* s1, const OdString& s2)
1285{ return s2.compare((const OdChar*)s1) == 0; }
1286#endif
1287
1288inline bool operator==(const OdString& s1, const char* s2)
1289{ return s1.compare(s2) == 0; }
1290
1291inline bool operator==(const char* s1, const OdString& s2)
1292{ return odStrCmpA((const char*)s2, s1) == 0; }
1293
1294inline bool operator!=(const OdString& s1, const OdString& s2)
1295 { return s1.compare(s2) != 0; }
1296
1297inline bool operator!=(const OdString& s1, const OdChar* s2)
1298 { return s1.compare(s2) != 0; }
1299
1300inline bool operator!=(const OdChar* s1, const OdString& s2)
1301 { return s2.compare(s1) != 0; }
1302
1303#if defined(_MSC_VER) && _MSC_VER >= 1300
1304inline bool operator!=(const OdString& s1, const __wchar_t* s2)
1305{ return s1.compare((const OdChar*)s2) != 0; }
1306
1307inline bool operator!=(const __wchar_t* s1, const OdString& s2)
1308{ return s2.compare((const OdChar*)s1) != 0; }
1309#endif
1310
1311inline bool operator!=(const OdString& s1, const char* s2)
1312{ return s1.compare(s2) != 0; }
1313
1314inline bool operator!=(const char* s1, const OdString& s2)
1315{ return s2.compare(s1) != 0; }
1316
1317inline bool operator<(const OdString& s1, const OdString& s2)
1318 { return s1.compare(s2) < 0; }
1319
1320inline bool operator<(const OdString& s1, const OdChar* s2)
1321 { return s1.compare(s2) < 0; }
1322
1323inline bool operator<(const OdChar* s1, const OdString& s2)
1324 { return s2.compare(s1) > 0; }
1325
1326#if defined(_MSC_VER) && _MSC_VER >= 1300
1327inline bool operator<(const OdString& s1, const __wchar_t* s2)
1328{ return s1.compare((const OdChar*)s2) < 0; }
1329
1330inline bool operator<(const __wchar_t* s1, const OdString& s2)
1331{ return s2.compare((const OdChar*)s1) > 0; }
1332#endif
1333
1334inline bool operator<(const OdString& s1, const char* s2)
1335{ return s1.compare(s2) < 0; }
1336
1337inline bool operator<(const char* s1, const OdString& s2)
1338{ return s2.compare(s1) > 0; }
1339
1340inline bool operator>(const OdString& s1, const OdString& s2)
1341 { return s1.compare(s2) > 0; }
1342
1343inline bool operator>(const OdString& s1, const OdChar* s2)
1344 { return s1.compare(s2) > 0; }
1345
1346inline bool operator>(const OdChar* s1, const OdString& s2)
1347 { return s2.compare(s1) < 0; }
1348
1349#if defined(_MSC_VER) && _MSC_VER >= 1300
1350inline bool operator>(const OdString& s1, const __wchar_t* s2)
1351{ return s1.compare((const OdChar*)s2) > 0; }
1352inline bool operator>(const __wchar_t* s1, const OdString& s2)
1353{ return s2.compare((const OdChar*)s1) < 0; }
1354#endif
1355
1356inline bool operator>(const OdString& s1, const char* s2)
1357{ return s1.compare(s2) > 0; }
1358
1359inline bool operator>(const char* s1, const OdString& s2)
1360{ return s2.compare(s1) < 0; }
1361
1362inline bool operator<=(const OdString& s1, const OdString& s2)
1363 { return s1.compare(s2) <= 0; }
1364
1365inline bool operator<=(const OdString& s1, const OdChar* s2)
1366 { return s1.compare(s2) <= 0; }
1367
1368inline bool operator<=(const OdChar* s1, const OdString& s2)
1369 { return s2.compare(s1) >= 0; }
1370
1371#if defined(_MSC_VER) && _MSC_VER >= 1300
1372inline bool operator<=(const OdString& s1, const __wchar_t* s2)
1373{ return s1.compare((const OdChar*)s2) <= 0; }
1374inline bool operator<=(const __wchar_t* s1, const OdString& s2)
1375{ return s2.compare((const OdChar*)s1) >= 0; }
1376#endif
1377
1378inline bool operator<=(const OdString& s1, const char* s2)
1379{ return s1.compare(s2) <= 0; }
1380
1381inline bool operator<=(const char* s1, const OdString& s2)
1382{ return s2.compare(s1) >= 0; }
1383
1384inline bool operator>=(const OdString& s1, const OdString& s2)
1385 { return s1.compare(s2) >= 0; }
1386
1387inline bool operator>=(const OdString& s1, const OdChar* s2)
1388 { return s1.compare(s2) >= 0; }
1389
1390inline bool operator>=(const OdChar* s1, const OdString& s2)
1391 { return s2.compare(s1) <= 0; }
1392
1393#if defined(_MSC_VER) && _MSC_VER >= 1300
1394inline bool operator>=(const OdString& s1, const __wchar_t* s2)
1395{ return s1.compare((const OdChar*)s2) >= 0; }
1396
1397inline bool operator>=(const __wchar_t* s1, const OdString& s2)
1398{ return s2.compare((const OdChar*)s1) <= 0; }
1399#endif
1400
1401inline bool operator>=(const OdString& s1, const char* s2)
1402{ return s1.compare(s2) >= 0; }
1403
1404inline bool operator>=(const char* s1, const OdString& s2)
1405{ return s2.compare(s1) <= 0; }
1406
1407#if defined(ODA_UNIXOS)
1410class OdW2US
1411{
1412 OdUInt16* _buf;
1413public:
1414 OdW2US(const wchar_t* pStr)
1415 {
1416 size_t len = Od_wcslen(pStr);
1417 _buf = new OdUInt16[len+1];
1418 for (size_t i = 0; i < len; i++)
1419 {
1420 _buf[i] = (OdUInt16)pStr[i];
1421 }
1422 _buf[len] = 0;
1423 }
1424 ~OdW2US()
1425 {
1426 delete[]_buf;
1427 }
1428 operator const OdUInt16*() const { return _buf; }
1429};
1430
1434class OdUS2W
1435{
1436 wchar_t* _buf;
1437public:
1438 OdUS2W(const OdUInt16* pStr)
1439 {
1440 size_t len = 0;
1441 if (const OdUInt16* p = pStr)
1442 {
1443 while (*p++)
1444 len++;
1445 }
1446 _buf = new wchar_t[len+1];
1447 for (size_t i = 0; i < len; i++)
1448 {
1449 _buf[i] = (wchar_t)pStr[i];
1450 }
1451 _buf[len] = 0;
1452 }
1453 ~OdUS2W()
1454 {
1455 delete[] _buf;
1456 }
1457 operator const wchar_t*() const { return _buf; }
1458};
1459
1460#else
1461
1462#define OdUS2W(a) (const wchar_t*)(a)
1463#define OdW2US(a) (const OdUInt16*)(a)
1464
1465#endif
1466
1468
1473{
1474public:
1475 OdConstString(const OdChar* pSource = NULL);
1476 // Destructor of base class OdString is not virtual (critical for performance).
1477 // Therefore ~OdConstString is missing
1478
1480 OdString& operator=(const OdString& pSource);
1482 OdString& operator=(const OdChar* pSource);
1484 OdString& operator=(const char* pSource);
1485 operator const OdChar*() const;
1486
1487protected:
1489};
1490
1492
1493#include "TD_PackPop.h"
1494
1495#endif // __ODSTRING_H__
#define ODA_ASSERT(exp)
Definition DebugStuff.h:57
OdCodePageId
Definition OdCodePage.h:31
@ CP_CNT
Definition OdCodePage.h:78
int OdRefCounter
Definition OdMutex.h:478
#define odStrICmp
#define odStrLen(str)
#define odStrCmp(str, str2)
#define odStrCmpA(str, str2)
#define Od_wcslen
unsigned short OdUInt16
char16_t OdChar16_t
#define ODRX_NOEXCEPT
wchar_t OdChar
bool operator>=(const OdString &s1, const OdString &s2)
Definition OdString.h:1384
#define OdW2US(a)
Definition OdString.h:1463
bool operator!=(const OdString &s1, const OdString &s2)
Definition OdString.h:1294
bool operator==(const OdString &s1, const OdString &s2)
Definition OdString.h:1271
bool operator<=(const OdString &s1, const OdString &s2)
Definition OdString.h:1362
OdChar OdCharW
Definition OdString.h:1257
#define OdUS2W(a)
Definition OdString.h:1462
bool operator<(const OdString &s1, const OdString &s2)
Definition OdString.h:1317
bool operator>(const OdString &s1, const OdString &s2)
Definition OdString.h:1340
OdString OdString
Definition OdString.h:1258
#define updateConstStringDiagnostic(pAddr)
Definition OdString.h:199
#define FIRSTDLL_EXPORT
Definition RootExport.h:39
#define FIRSTDLL_EXPORT_STATIC
Definition RootExport.h:40
OdTrVisMiniVec4d< DataType > operator+(const OdTrVisMiniVec4d< DataType > &v1, const OdTrVisMiniVec4d< DataType > &v2)
OdConstString & operator=(const OdConstString &pSource)
OdConstString(const OdChar *pSource=NULL)
OdString & operator=(const OdChar *pSource)
OdString & operator=(OdChar ch)
OdString & operator=(const char *pSource)
OdString & operator=(const OdString &pSource)
OdString & operator=(const OdAnsiString &pSource)
OdStringData m_data
Definition OdString.h:1488
OdString & operator+=(const OdChar *string)
OdChar * getBufferSetLength(int length)
int replace(OdChar oldChar, OdChar newChar)
int compare(const OdString &otherString) const
Definition OdString.h:350
OdString & trimLeft(const OdString &whiteChars)
Definition OdString.h:683
OdString & operator+=(const OdString &string)
static void release(OdStringData *pStringData)
OdString & formatV(const OdChar *formatString, va_list argList)
OdString & operator=(OdChar ch)
void assignCopy(int sourceLength, const OdChar *source)
OdString(const OdChar *source)
int compare(const char *otherString) const
OdString & trimLeft()
void copyBeforeWrite()
OdString mid(int startIndex, int length) const
OdString(const OdChar16_t *lpch, OdCodePageId codepage=CP_CNT)
int compare(const OdChar *otherString) const
Definition OdString.h:328
OdString & trimRight(const OdString &whiteChars)
Definition OdString.h:633
int iCompare(const OdChar *otherString) const
Definition OdString.h:403
int insert(int insertIndex, const OdString &insertString)
Definition OdString.h:799
OdString & format(const OdChar *formatString,...)
OdString & trimLeft(OdChar whiteChar)
int find(const OdChar *searchString) const
OdString & operator=(const OdString &source)
OdString & operator=(const OdChar16_t *source)
int replace(const OdChar *oldString, const OdChar *newString)
OdString & trimLeft(const OdChar *whiteChars)
void syncUnicode() const
OdString(OdStringData *pData)
void empty()
OdChar getAt(int charIndex) const
Definition OdString.h:161
int remove(OdChar chRemove)
OdString & trimRight(const OdChar *whiteChars)
void init()
OdString & operator=(const OdChar *source)
int find(const OdChar *searchString, int startIndex) const
friend FIRSTDLL_EXPORT OdString operator+(const OdString &string1, const OdString &string2)
int iCompare(const OdString &otherString) const
Definition OdString.h:425
OdString & makeLower()
int find(OdChar searchChar, int startIndex) const
void concatInPlace(int sourceLength, const OdChar *source)
OdString & operator=(const OdAnsiString &source)
bool isEmpty() const
Definition OdString.h:146
OdChar * getBuffer(int minBufLength)
OdString mid(int startIndex) const
OdString & operator=(const char *source)
OdString(OdChar ch, int length)
OdString & trimRight()
void concatCopy(int sourceLength1, const OdChar *source1, int sourceLength2, const OdChar *source2)
void unlockBuffer()
OdString(const OdString &source)
friend FIRSTDLL_EXPORT OdString operator+(OdChar ch, const OdString &string)
int reverseFind(OdChar searchChar) const
OdString(const char *lpch, int nLength, OdCodePageId codepage=CP_CNT)
void allocCopy(OdString &destString, int copyLength, int copyIndex, int extraLength) const
void release()
void allocBuffer(int length, bool allocAlways=false)
void setAt(int charIndex, OdChar ch)
OdString left(int length) const
const OdChar * c_str() const
Definition OdString.h:205
OdString spanExcluding(const OdChar *charSet) const
friend FIRSTDLL_EXPORT OdString operator+(const OdString &string1, const OdChar *string2)
static void freeData(OdStringData *pStringData)
int getLengthA() const
FIRSTDLL_EXPORT_STATIC static const OdString kEmpty
Definition OdString.h:100
OdString right(int length) const
void freeExtra()
OdString spanIncluding(const OdString &charSet) const
Definition OdString.h:496
void releaseBuffer(int newLength=-1)
int replace(const OdString &oldString, const OdString &newString)
Definition OdString.h:729
OdStringData * getData() const
Definition OdString.h:1119
void preallocate(int length)
Definition OdString.h:1102
OdString spanIncluding(const OdChar *charSet) const
void allocBeforeWrite(int newLength)
int reverseFind(OdChar searchChar, int startIndex) const
OdString(const char *lpch, OdCodePageId codepage=CP_CNT)
OdString & operator+=(OdChar ch)
friend FIRSTDLL_EXPORT OdString operator+(const OdString &string, OdChar ch)
int insert(int insertIndex, OdChar insertChar)
OdString(const OdChar *source, int length)
OdString(const OdAnsiString &)
OdString & makeReverse()
int getAllocLength() const
Definition OdString.h:1092
static FIRSTDLL_EXPORT_STATIC OdStringData kEmptyData
Definition OdString.h:1109
bool isUnicodeNotInSync() const
Definition OdString.h:1231
friend FIRSTDLL_EXPORT OdString operator+(const OdChar *string1, const OdString &string2)
OdString spanExcluding(const OdString &charSet) const
Definition OdString.h:537
OdStringData * m_pData
Definition OdString.h:1114
OdString & trimRight(OdChar whiteChar)
friend class OdAnsiString
Definition OdString.h:1244
int deleteChars(int deleteIndex, int count=1)
OdChar * lockBuffer()
static int safeStrlen(const OdChar *string)
Definition OdString.h:1222
OdString & operator+=(const char *string)
int insert(int insertIndex, const OdChar *insertString)
OdChar operator[](int charIndex) const
Definition OdString.h:179
int find(OdChar searchChar) const
OdAnsiString * getAnsiString() const
Definition OdString.h:1236
int findOneOf(const OdChar *charSet) const
int getLength() const
Definition OdString.h:135
OdString & makeUpper()
void freeAnsiString() const
GLsizei GLsizei * count
Definition gles2_ext.h:276
GLsizei GLsizei GLchar * source
Definition gles2_ext.h:282
GLuint GLsizei GLsizei * length
Definition gles2_ext.h:274
GLint GLint GLint GLsizei GLsizei GLenum format
Definition gles2_ext.h:111
GLfloat x
Definition gles2_ext.h:314
GLfloat GLfloat y
Definition gles2_ext.h:316
bool operator()(const OdString &x, const OdString &y) const
Definition OdString.h:1249
int nAllocLength
Definition OdString.h:75
OdChar * unicodeBuffer
Definition OdString.h:80
int nDataLength
Definition OdString.h:70
OdRefCounter nRefs
Definition OdString.h:65
char * ansiString
Definition OdString.h:85
std::size_t operator()(const OdString &key) const ODRX_NOEXCEPT