| CFx SDK Documentation
    2020SP3
    | 
 
 
 
Go to the documentation of this file.
   28 #ifndef __ODSTRING_H__ 
   29 #define __ODSTRING_H__ 
   39 #define odaIsValidString(lpch)    (true) 
  114 #if defined(_MSC_VER) && _MSC_VER >= 1300 
  132     if (isUnicodeNotInSync())
 
  134     return getData()->nDataLength; 
 
  143     return (getData()->nDataLength == 0 && 
 
  144       (getData()->ansiString == 0 || getAnsiString()->isEmpty()));
 
  159     if (isUnicodeNotInSync())
 
  163     ODA_ASSERT(charIndex < getData()->nDataLength);
 
  164     return getData()->unicodeBuffer[charIndex];
 
  176     return getAt(charIndex);
 
  188 #if defined(_MSC_VER) && defined(_WIN32) && defined(_DEBUG) && defined(ODA_LINT) 
  189 #define UPDATECONSTSTRINGDIAGNISTIC 
  194   #define updateConstStringDiagnostic(pAddr) 
  202     if (isUnicodeNotInSync())
 
  204     const OdChar* pRet = getData()->unicodeBuffer;
 
  217 #if defined(_MSC_VER) && _MSC_VER >= 1300 
  218   operator const __wchar_t*() 
const 
  220     return reinterpret_cast<const __wchar_t*
>(c_str());
 
  224   operator const char*() 
const;
 
  232 #if defined(_MSC_VER) && _MSC_VER >= 1300 
  270 #if defined(_MSC_VER) && _MSC_VER >= 1300 
  279   OdString& operator+=(
const __wchar_t* 
string){ 
return operator+=((
const OdChar*)
string); }
 
  321     if (isUnicodeNotInSync())
 
  323     return odStrCmp((
const wchar_t*)getData()->unicodeBuffer, (
const wchar_t*)otherString);
 
  343 #if defined(_MSC_VER) && _MSC_VER >= 1300 
  359   int compare(
const __wchar_t* otherString)
 const { 
return compare((
const OdChar*)otherString);}
 
  396     if (isUnicodeNotInSync())
 
  398     return odStrICmp(getData()->unicodeBuffer, otherString); 
 
  417 #if defined(_MSC_VER) && _MSC_VER >= 1300 
  433   __forceinline 
int iCompare(
const __wchar_t* otherString)
 const {
return iCompare((
const OdChar*)otherString);}
 
  489 #if defined(_MSC_VER) && _MSC_VER >= 1300 
  501   OdString spanIncluding(
const __wchar_t* charSet)
 const{
return spanIncluding((
const OdChar*)charSet);}
 
  530 #if defined(_MSC_VER) && _MSC_VER >= 1300 
  542   OdString spanExcluding(
const __wchar_t* charSet)
 const{
return spanExcluding((
const OdChar*)charSet);}
 
  626 #if defined(_MSC_VER) && _MSC_VER >= 1300 
  637   OdString& trimRight(
const __wchar_t* whiteChars){
return trimRight((
const OdChar*)whiteChars);}
 
  676 #if defined(_MSC_VER) && _MSC_VER >= 1300 
  687   OdString& trimLeft(
const __wchar_t* whiteChars){
return trimLeft((
const OdChar*)whiteChars);}
 
  722 #if defined(_MSC_VER) && _MSC_VER >= 1300 
  733   int replace(
const __wchar_t* oldString, 
const __wchar_t* newString){
return replace((
const OdChar*)oldString, (
const OdChar*)newString);}
 
  792 #if defined(_MSC_VER) && _MSC_VER >= 1300 
  805   int insert(
int insertIndex, 
const __wchar_t* insertString){
return insert(insertIndex,(
const OdChar*)insertString);}
 
  893 #if defined(_MSC_VER) && _MSC_VER >= 1300 
  902   int findOneOf(
const __wchar_t* charSet)
 const{
return findOneOf((
const OdChar*)charSet);}
 
  912   int findOneOf(
const OdString& charSet)
 const{
return findOneOf((
const OdChar*)charSet);}
 
  914   int find(
const __wchar_t* searchString)
 const{
return find((
const OdChar*)searchString);}
 
  916   int find(
const OdString& searchString)
 const{
return find((
const OdChar*)searchString);}
 
  918   int find(
const __wchar_t* searchString, 
int startIndex)
 const{
return find((
const OdChar*)searchString,startIndex);}
 
  920   int find(
const OdString& searchString, 
int startIndex)
 const{
return find((
const OdChar*)searchString,startIndex);}
 
  931 #if defined(_MSC_VER) && _MSC_VER >= 1300 
  952 #if defined(_MSC_VER) && _MSC_VER >= 1300 
  961   inline OdString& formatV(
const __wchar_t* formatString, va_list argList)
 
  963     return formatV((
const OdChar*)formatString, argList);
 
 1026 #ifdef NOT_IMPLEMENTED 
 1044   int collate(
const OdChar* otherString) 
const;
 
 1062   int iCollate(
const OdChar* otherString) 
const;
 
 1082   { 
return getData()->nAllocLength; }
 
 1199   { 
return (
string == 
NULL) ? (int)0 : (
int)
odStrLen((
const wchar_t*)
string); }
 
 1209     return !getData()->unicodeBuffer && getData()->ansiString;
 
 1214     if (getData()->ansiString)
 
 1215       return reinterpret_cast<OdAnsiString*
>(&getData()->ansiString);
 
 1220   friend class OdAnsiString;
 
 1227 #if defined(_MSC_VER) && _MSC_VER >= 1300 
 1228 inline OdString operator+(
const OdString& string1, 
const __wchar_t* string2)
 
 1230   return operator+(string1, (
const OdChar*)string2);
 
 1232 inline OdString operator+(
const __wchar_t* string1, 
const OdString& string2)
 
 1234   return operator+((
const OdChar*)string1, string2);
 
 1239   { 
return s1.
compare(s2) == 0; }
 
 1242   { 
return s1.
compare(s2) == 0; }
 
 1245   { 
return s2.
compare(s1) == 0; }
 
 1247 #if defined(_MSC_VER) && _MSC_VER >= 1300 
 1256 { 
return s1.
compare(s2) == 0; }
 
 1259 { 
return odStrCmpA((
const char*)s2, s1) == 0; }
 
 1262   { 
return s1.
compare(s2) != 0; }
 
 1265   { 
return s1.
compare(s2) != 0; }
 
 1268   { 
return s2.
compare(s1) != 0; }
 
 1270 #if defined(_MSC_VER) && _MSC_VER >= 1300 
 1279 { 
return s1.
compare(s2) != 0; }
 
 1282 { 
return s2.
compare(s1) != 0; }
 
 1285   { 
return s1.
compare(s2) < 0; }
 
 1288   { 
return s1.
compare(s2) < 0; }
 
 1291   { 
return s2.
compare(s1) > 0; }
 
 1293 #if defined(_MSC_VER) && _MSC_VER >= 1300 
 1302 { 
return s1.
compare(s2) < 0; }
 
 1305 { 
return s2.
compare(s1) > 0; }
 
 1308   { 
return s1.
compare(s2) > 0; }
 
 1311   { 
return s1.
compare(s2) > 0; }
 
 1314   { 
return s2.
compare(s1) < 0; }
 
 1316 #if defined(_MSC_VER) && _MSC_VER >= 1300 
 1324 { 
return s1.
compare(s2) > 0; }
 
 1327 { 
return s2.
compare(s1) < 0; }
 
 1330   { 
return s1.
compare(s2) <= 0; }
 
 1333   { 
return s1.
compare(s2) <= 0; }
 
 1336   { 
return s2.
compare(s1) >= 0; }
 
 1338 #if defined(_MSC_VER) && _MSC_VER >= 1300 
 1346 { 
return s1.
compare(s2) <= 0; }
 
 1349 { 
return s2.
compare(s1) >= 0; }
 
 1352   { 
return s1.
compare(s2) >= 0; }
 
 1355   { 
return s1.
compare(s2) >= 0; }
 
 1358   { 
return s2.
compare(s1) <= 0; }
 
 1360 #if defined(_MSC_VER) && _MSC_VER >= 1300 
 1369 { 
return s1.
compare(s2) >= 0; }
 
 1372 { 
return s2.
compare(s1) <= 0; }
 
 1374 #if defined(ODA_UNIXOS) 
 1381   OdW2US(
const wchar_t* pStr)
 
 1385     for (
size_t i = 0; i < len; i++)
 
 1395   operator const OdUInt16*() 
const { 
return _buf; }
 
 1413     _buf = 
new wchar_t[len+1];
 
 1414     for (
size_t i = 0; i < len; i++)
 
 1416       _buf[i] = (wchar_t)pStr[i];
 
 1424   operator const wchar_t*() 
const { 
return _buf; }
 
 1429 #define OdUS2W(a) (const wchar_t*)(a) 
 1430 #define OdW2US(a) (const OdUInt16*)(a) 
 1462 #endif // __ODSTRING_H__ 
  
bool operator<=(const OdString &s1, const OdString &s2)
OdConstString(const OdChar *pSource=NULL)
static void release(OdStringData *pStringData)
OdString & operator=(const OdChar *pSource)
OdString & operator+=(const OdString &string)
int compare(const OdChar *otherString) const
OdChar getAt(int charIndex) const
OdString mid(int startIndex) const
OdString & operator=(const char *source)
int replace(const OdString &oldString, const OdString &newString)
OdString spanIncluding(const OdChar *charSet) const
int deleteChars(int deleteIndex, int count=1)
bool operator!=(const OdString &s1, const OdString &s2)
GLsizei GLsizei GLchar * source
void allocBuffer(int length, bool allocAlways=false)
OdString & operator=(const OdString &pSource)
friend FIRSTDLL_EXPORT OdString operator+(const OdString &string1, const OdString &string2)
int find(OdChar searchChar) const
void setAt(int charIndex, OdChar ch)
OdChar * getBuffer(int minBufLength)
int find(const OdChar *searchString, int startIndex) const
friend FIRSTDLL_EXPORT OdString operator+(const OdString &string, OdChar ch)
OdString & formatV(const OdChar *formatString, va_list argList)
int getAllocLength() const
friend FIRSTDLL_EXPORT OdString operator+(const OdString &string1, const OdChar *string2)
OdStringData * getData() const
OdString & trimLeft(const OdChar *whiteChars)
friend FIRSTDLL_EXPORT OdString operator+(const OdChar *string1, const OdString &string2)
OdString & operator+=(const char *string)
int insert(int insertIndex, const OdString &insertString)
friend FIRSTDLL_EXPORT OdString operator+(OdChar ch, const OdString &string)
void releaseBuffer(int newLength=-1)
int compare(const OdString &otherString) const
bool isUnicodeNotInSync() const
OdChar operator[](int charIndex) const
int insert(int insertIndex, const OdChar *insertString)
OdString & operator=(OdChar ch)
OdString(const OdChar *source)
OdChar * getBufferSetLength(int length)
OdString(const OdString &source)
OdConstString & operator=(const OdConstString &pSource)
OdString & trimRight(const OdChar *whiteChars)
#define FIRSTDLL_EXPORT_STATIC
void assignCopy(int sourceLength, const OdChar *source)
OdString & operator+=(const OdChar *string)
int reverseFind(OdChar searchChar) const
int replace(const OdChar *oldString, const OdChar *newString)
int iCompare(const OdString &otherString) const
OdString & operator=(OdChar ch)
OdString left(int length) const
OdString & operator=(const char *pSource)
bool operator>(const OdString &s1, const OdString &s2)
OdString spanIncluding(const OdString &charSet) const
void allocCopy(OdString &destString, int copyLength, int copyIndex, int extraLength) const
bool operator>=(const OdString &s1, const OdString &s2)
int find(OdChar searchChar, int startIndex) const
GLuint GLsizei GLsizei * length
OdString mid(int startIndex, int length) const
#define updateConstStringDiagnostic(pAddr)
void concatCopy(int sourceLength1, const OdChar *source1, int sourceLength2, const OdChar *source2)
void freeAnsiString() const
OdString & trimRight(const OdString &whiteChars)
bool operator<(const OdString &s1, const OdString &s2)
int insert(int insertIndex, OdChar insertChar)
OdString & operator=(const OdChar *source)
int remove(OdChar chRemove)
OdString(const char *lpch, OdCodePageId codepage=CP_CNT)
OdString spanExcluding(const OdString &charSet) const
OdString(const char *lpch, int nLength, OdCodePageId codepage=CP_CNT)
OdString & format(const OdChar *formatString,...)
int compare(const char *otherString) const
OdString & trimLeft(const OdString &whiteChars)
OdString & operator+=(OdChar ch)
OdString & operator=(const OdAnsiString &pSource)
static FIRSTDLL_EXPORT_STATIC OdStringData kEmptyData
OdString & operator=(const OdString &source)
bool operator==(const OdString &s1, const OdString &s2)
int iCompare(const OdChar *otherString) const
GLint GLint GLint GLsizei GLsizei GLenum format
OdString & operator=(const OdAnsiString &source)
OdAnsiString * getAnsiString() const
FIRSTDLL_EXPORT_STATIC static const OdString kEmpty
OdString(const OdAnsiString &)
int find(const OdChar *searchString) const
OdString(OdStringData *pData)
const OdChar * c_str() const
static int safeStrlen(const OdChar *string)
void allocBeforeWrite(int newLength)
static void freeData(OdStringData *pStringData)
OdString(const OdChar *source, int length)
int findOneOf(const OdChar *charSet) const
OdString right(int length) const
OdString spanExcluding(const OdChar *charSet) const
OdString(OdChar ch, int length)
OdString & trimLeft(OdChar whiteChar)
OdString & trimRight(OdChar whiteChar)
void concatInPlace(int sourceLength, const OdChar *source)
int reverseFind(OdChar searchChar, int startIndex) const
int replace(OdChar oldChar, OdChar newChar)