Foxit PDF SDK
fx_string.h
Go to the documentation of this file.
1 
16 //<<<+++OPENSOURCE
17 //<<<+++OPENSOURCE_LICENSE
18 //<<<+++OPENSOURCE_BEGIN LIC==FOXIT||LIC==GOOGLE
19 
25 //<<<+++OPENSOURCE_MUST_BEGIN
26 #ifndef _FX_STRING_H_
27 #define _FX_STRING_H_
28 //<<<+++OPENSOURCE_MUST_END
29 
30 class CFX_ByteStringC;
31 class CFX_ByteString;
32 class CFX_WideStringC;
33 class CFX_WideString;
34 struct CFX_CharMap;
36 
38 typedef int FX_STRSIZE;
39 
40 class CFX_ByteStringL;
41 class CFX_WideStringL;
42 
43 //*****************************************************************************
44 //* CFX_ByteStringC - constant byte string
45 //*****************************************************************************
51 class CFX_ByteStringC : public CFX_Object
52 {
53  public:
58  {
59  m_Ptr = NULL;
60  m_Length = 0;
61  }
69  {
70  m_Ptr = ptr;
71  m_Length = size;
72  }
73 //<<<+++OPENSOURCE_MUST_BEGIN LIC==FOXIT
74 #ifndef _NO_LPCSTR_SUPPORT_
75 //<<<+++OPENSOURCE_MUST_END
82  {
83  m_Ptr = (FX_LPCBYTE)ptr;
84  m_Length = ptr ? (FX_STRSIZE)FXSYS_strlen(ptr) : 0;
85  }
86 //<<<+++OPENSOURCE_MUST_BEGIN LIC==FOXIT
87 #endif
88 //<<<+++OPENSOURCE_MUST_END
94  explicit CFX_ByteStringC(const FX_CHAR& ch)
95  {
96  m_Ptr = (FX_LPCBYTE)&ch;
97  m_Length = 1;
98  }
106  {
107  m_Ptr = (FX_LPCBYTE)ptr;
108  if (len == -1)
109  m_Length = (FX_STRSIZE)FXSYS_strlen(ptr);
110  else
111  m_Length = len;
112  }
119  {
120  m_Ptr = src.m_Ptr;
121  m_Length = src.m_Length;
122  }
128  CFX_ByteStringC(const CFX_ByteString& src);
129 
138  {
139  m_Ptr = (FX_LPCBYTE)src;
140  m_Length = m_Ptr ? (FX_STRSIZE)FXSYS_strlen(src) : 0;
141  return *this;
142  }
151  {
152  m_Ptr = src.m_Ptr;
153  m_Length = src.m_Length;
154  return *this;
155  }
164 
172  bool operator == (const CFX_ByteStringC& str) const
173  {
174  return str.m_Length == m_Length && FXSYS_memcmp32(str.m_Ptr, m_Ptr, m_Length) == 0;
175  }
183  bool operator != (const CFX_ByteStringC& str) const
184  {
185  return str.m_Length != m_Length || FXSYS_memcmp32(str.m_Ptr, m_Ptr, m_Length) != 0;
186  }
187 
189 #define FXBSTR_ID(c1, c2, c3, c4) ((c1 << 24) | (c2 << 16) | (c3 << 8) | (c4))
190 
208  FX_DWORD GetID(FX_STRSIZE start_pos = 0) const;
209 
215  FX_LPCBYTE GetPtr() const { return m_Ptr; }
221  FX_LPCSTR GetCStr() const { return (FX_LPCSTR)m_Ptr; }
227  FX_STRSIZE GetLength() const { return m_Length; }
233  bool IsEmpty() const { return m_Length == 0; }
234 
243  operator FX_LPCBYTE() const { return m_Ptr; }
244 
252  FX_BYTE GetAt(FX_STRSIZE index) const { return m_Ptr[index]; }
253 
263  CFX_ByteStringC Mid(FX_STRSIZE index, FX_STRSIZE count = -1) const
264  {
265  if (index < 0) index = 0;
266  if (index > m_Length) return CFX_ByteStringC();
267  if (count < 0 || count > m_Length - index) count = m_Length - index;
268  return CFX_ByteStringC(m_Ptr + index, count);
269  }
270 
271  protected:
272  /* The constant byte string pointer. */
273  FX_LPCBYTE m_Ptr;
274  /* The length in bytes of the byte string. */
275  FX_STRSIZE m_Length;
276 
277  private:
278  /*
279  * "new" operator forbidden. Cannot allocate a CFX_ByteStringC in heap.
280  */
281  void* operator new (size_t) throw() { return NULL; }
282 };
283 
285 typedef const CFX_ByteStringC& FX_BSTR;
286 
296 #define FX_BSTRC(str) CFX_ByteStringC(str, sizeof str-1)
297 
298 //*****************************************************************************
299 //* CFX_ByteString - byte string
300 //*****************************************************************************
303 {
305  long m_nRefs;
312 };
313 
317 class CFX_ByteString : public CFX_Object
318 {
319  public:
323  CFX_ByteString() { m_pData = NULL; }
329  CFX_ByteString(const CFX_ByteString& str);
335  explicit CFX_ByteString(char ch);
342  CFX_ByteString(FX_LPCSTR ptr, FX_STRSIZE len=-1);
355  CFX_ByteString(FX_BSTR bstrc);
362  CFX_ByteString(FX_BSTR bstrc1, FX_BSTR bstrc2);
366  ~CFX_ByteString();
367 
376  static CFX_ByteString FromUnicode(FX_LPCWSTR ptr, FX_STRSIZE len = -1);
384  static CFX_ByteString FromUnicode(const CFX_WideString& str);
385 
386 //<<<+++OPENSOURCE_MUST_END
387 
391  operator FX_LPCSTR() const { return m_pData ? m_pData->m_String : ""; }
395  operator FX_LPCBYTE() const { return m_pData ? (FX_LPCBYTE)m_pData->m_String : NULL; }
396 
402  FX_STRSIZE GetLength() const { return m_pData ? m_pData->m_nDataLength : 0; }
403 
409  bool IsEmpty() const { return !GetLength(); }
410 
422  int Compare(FX_BSTR str) const;
423 
434  bool Equal(FX_BSTR str) const;
435 
445  bool EqualNoCase(FX_BSTR str) const;
446 
447 //<<<+++OPENSOURCE_MUST_BEGIN LIC==FOXIT
448 #ifndef _NO_LPCSTR_SUPPORT_
449 //<<<+++OPENSOURCE_MUST_END
457  bool operator == (FX_LPCSTR str) const { return Equal(str); }
458 //<<<+++OPENSOURCE_MUST_BEGIN LIC==FOXIT
459 #endif
460 //<<<+++OPENSOURCE_MUST_END
468  bool operator == (FX_BSTR str) const { return Equal(str); }
476  bool operator == (const CFX_ByteString& str) const;
477 //<<<+++OPENSOURCE_MUST_BEGIN LIC==FOXIT
478 #ifndef _NO_LPCSTR_SUPPORT_
479 //<<<+++OPENSOURCE_MUST_END
487  bool operator != (FX_LPCSTR str) const { return !Equal(str); }
488 //<<<+++OPENSOURCE_MUST_BEGIN LIC==FOXIT
489 #endif
490 //<<<+++OPENSOURCE_MUST_END
498  bool operator != (FX_BSTR str) const { return !Equal(str); }
506  bool operator != (const CFX_ByteString& str) const { return !operator==(str); }
507 
515  bool operator< (const CFX_ByteString& rhs) const;
516 
522  void Empty();
523 
539  const CFX_ByteString& operator = (FX_BSTR bstrc);
547  const CFX_ByteString& operator = (const CFX_ByteString& stringSrc);
555  const CFX_ByteString& operator = (const CFX_BinaryBuf& buf);
556 
565  void Load(FX_LPCBYTE str, FX_STRSIZE len);
566 
590  const CFX_ByteString& operator += (const CFX_ByteString& str);
598  const CFX_ByteString& operator += (FX_BSTR bstrc);
599 
607  FX_BYTE GetAt(FX_STRSIZE nIndex) const { return m_pData ? m_pData->m_String[nIndex] : 0; }
615  FX_BYTE operator[](FX_STRSIZE nIndex) const { return m_pData ? m_pData->m_String[nIndex] : 0; }
624  void SetAt(FX_STRSIZE nIndex, FX_CHAR ch);
625 
634  FX_STRSIZE Insert(FX_STRSIZE index, FX_CHAR ch);
635 
644  FX_STRSIZE Delete(FX_STRSIZE index, FX_STRSIZE count = 1);
645 
662  void Format(FX_LPCSTR lpszFormat, ... );
673  void FormatV(FX_LPCSTR lpszFormat, va_list argList);
674 
686  void Reserve(FX_STRSIZE len);
687 
700 
710 
721  void ReleaseBuffer(FX_STRSIZE len = -1);
722 
730  CFX_ByteString Mid(FX_STRSIZE first) const;
739  CFX_ByteString Mid(FX_STRSIZE first, FX_STRSIZE count) const;
747  CFX_ByteString Left(FX_STRSIZE count) const;
755  CFX_ByteString Right(FX_STRSIZE count) const;
756 
765  FX_STRSIZE Find(FX_BSTR lpszSub, FX_STRSIZE start=0) const;
774  FX_STRSIZE Find(FX_CHAR ch, FX_STRSIZE start=0) const;
782  FX_STRSIZE ReverseFind(FX_CHAR ch) const;
783 
789  void MakeLower();
795  void MakeUpper();
796 
802  void TrimRight();
810  void TrimRight(FX_CHAR chTarget);
818  void TrimRight(FX_BSTR lpszTargets);
824  void TrimLeft();
832  void TrimLeft(FX_CHAR chTarget);
840  void TrimLeft(FX_BSTR lpszTargets);
841 
850  FX_STRSIZE Replace(FX_BSTR lpszOld, FX_BSTR lpszNew);
851 
860 
866  CFX_WideString UTF8Decode() const;
867 
877  void ConvertFrom(const CFX_WideString& str, CFX_CharMap* pCharMap = NULL);
878 
886  FX_DWORD GetID(FX_STRSIZE start_pos = 0) const;
887 
895  static CFX_ByteString LoadFromFile(FX_BSTR file_path);
896 
898 #define FXFORMAT_SIGNED 1
899 
900 #define FXFORMAT_HEX 2
901 
902 #define FXFORMAT_CAPITAL 4
903 
919  static CFX_ByteString FormatInteger(FX_INT32 i, FX_DWORD flags = 0);
930  static CFX_ByteString FormatFloat(FX_FLOAT f, int precision = 0);
931 
932  protected:
933  /* Pointer to ref counted byte string data. */
934  struct CFX_StringData* m_pData;
935 
936  void AllocCopy(CFX_ByteString& dest, FX_STRSIZE nCopyLen, FX_STRSIZE nCopyIndex, FX_STRSIZE nExtraLen) const;
937  void AssignCopy(FX_STRSIZE nSrcLen, FX_LPCSTR lpszSrcData);
938  void ConcatCopy(FX_STRSIZE nSrc1Len, FX_LPCSTR lpszSrc1Data, FX_STRSIZE nSrc2Len, FX_LPCSTR lpszSrc2Data);
939  void ConcatInPlace(FX_STRSIZE nSrcLen, FX_LPCSTR lpszSrcData);
940  void CopyBeforeWrite();
941  void AllocBeforeWrite(FX_STRSIZE nLen);
942 };
943 
945 {
946  m_Ptr = (FX_LPCBYTE)src;
947  m_Length = src.GetLength();
948 }
949 
951 {
952  m_Ptr = (FX_LPCBYTE)src;
953  m_Length = src.GetLength();
954  return *this;
955 }
956 
969 
978 inline CFX_ByteString operator + (FX_BSTR str1, FX_BSTR str2) { return CFX_ByteString(str1, str2); }
979 //<<<+++OPENSOURCE_MUST_BEGIN LIC==FOXIT
980 #ifndef _NO_LPCSTR_SUPPORT_
981 //<<<+++OPENSOURCE_MUST_END
990 inline CFX_ByteString operator + (FX_BSTR str1, FX_LPCSTR str2) { return CFX_ByteString(str1, str2); }
999 inline CFX_ByteString operator + (FX_LPCSTR str1,FX_BSTR str2) { return CFX_ByteString(str1, str2); }
1000 //<<<+++OPENSOURCE_MUST_BEGIN LIC==FOXIT
1001 #endif
1002 //<<<+++OPENSOURCE_MUST_END
1021 
1030 inline CFX_ByteString operator + (const CFX_ByteString& str1, const CFX_ByteString& str2) { return CFX_ByteString(str1, str2); }
1039 inline CFX_ByteString operator + (const CFX_ByteString& str1, FX_CHAR ch) { return CFX_ByteString(str1, CFX_ByteStringC(ch)); }
1048 inline CFX_ByteString operator + (FX_CHAR ch, const CFX_ByteString& str2) { return CFX_ByteString(CFX_ByteStringC(ch), str2); }
1049 //<<<+++OPENSOURCE_MUST_BEGIN LIC==FOXIT
1050 #ifndef _NO_LPCSTR_SUPPORT_
1051 //<<<+++OPENSOURCE_MUST_END
1060 inline CFX_ByteString operator + (const CFX_ByteString& str1, FX_LPCSTR str2) { return CFX_ByteString(str1, str2); }
1069 inline CFX_ByteString operator + (FX_LPCSTR str1, const CFX_ByteString& str2) { return CFX_ByteString(str1, str2); }
1070 //<<<+++OPENSOURCE_MUST_BEGIN LIC==FOXIT
1071 #endif
1072 //<<<+++OPENSOURCE_MUST_END
1081 inline CFX_ByteString operator + (const CFX_ByteString& str1, FX_BSTR str2) { return CFX_ByteString(str1, str2); }
1090 inline CFX_ByteString operator + (FX_BSTR str1, const CFX_ByteString& str2) { return CFX_ByteString(str1, str2); }
1091 
1100 class CFX_StringBufBase : public CFX_Object
1101 {
1102  public:
1108  explicit CFX_StringBufBase(FX_STRSIZE limit) { m_Size = 0; m_Limit = limit; }
1109 
1115  FX_CHAR* GetPtr() const { return (FX_CHAR*)(this + 1); }
1121  FX_STRSIZE GetSize() const { return m_Size; }
1122 
1128  void Empty() { m_Size = 0; }
1129 
1137  void Copy(FX_BSTR str);
1138 
1146  void Append(FX_BSTR str);
1147 
1158  void Append(int i, FX_DWORD flags = 0);
1159 
1165  CFX_ByteStringC GetStringC() const { return CFX_ByteStringC((FX_CHAR*)(this + 1), m_Size); }
1171  CFX_ByteString GetString() const { return CFX_ByteString((FX_CHAR*)(this + 1), m_Size); }
1172 
1173  protected:
1174  /* The buffer limit. */
1175  FX_STRSIZE m_Limit;
1176  /* The string size. */
1177  FX_STRSIZE m_Size;
1178  // the real buffer follows
1179 };
1180 
1184 template<FX_STRSIZE limit>
1186 {
1187  public:
1192 
1199 };
1200 
1203 
1204 //*****************************************************************************
1205 //* CFX_WideStringC - constant wide string
1206 //*****************************************************************************
1212 class CFX_WideStringC : public CFX_Object
1213 {
1214  public:
1219  {
1220  m_Ptr = NULL;
1221  m_Length = 0;
1222  }
1223 //<<<+++OPENSOURCE_MUST_BEGIN LIC==FOXIT
1224 #ifndef _NO_LPCSTR_SUPPORT_
1225 //<<<+++OPENSOURCE_MUST_END
1232  {
1233  m_Ptr = ptr;
1234  m_Length = ptr ? (FX_STRSIZE)FXSYS_wcslen(ptr) : 0;
1235  }
1236 //<<<+++OPENSOURCE_MUST_BEGIN LIC==FOXIT
1237 #endif
1238 //<<<+++OPENSOURCE_MUST_END
1245  {
1246  m_Ptr = &ch;
1247  m_Length = 1;
1248  }
1256  {
1257  m_Ptr = ptr;
1258  if (len == -1)
1259  m_Length = (FX_STRSIZE)FXSYS_wcslen(ptr);
1260  else
1261  m_Length = len;
1262  }
1269  {
1270  m_Ptr = src.m_Ptr;
1271  m_Length = src.m_Length;
1272  }
1278  CFX_WideStringC(const CFX_WideString& src);
1279 
1288  {
1289  m_Ptr = src;
1290  m_Length = (FX_STRSIZE)FXSYS_wcslen(src);
1291  return *this;
1292  }
1301  {
1302  m_Ptr = src.m_Ptr;
1303  m_Length = src.m_Length;
1304  return *this;
1305  }
1314 
1322  bool operator == (const CFX_WideStringC& str) const
1323  {
1324  return str.m_Length == m_Length && FXSYS_memcmp32(str.m_Ptr, m_Ptr, m_Length*sizeof(FX_WCHAR)) == 0;
1325  }
1333  bool operator != (const CFX_WideStringC& str) const
1334  {
1335  return str.m_Length != m_Length || FXSYS_memcmp32(str.m_Ptr, m_Ptr, m_Length*sizeof(FX_WCHAR)) != 0;
1336  }
1337 
1343  FX_LPCWSTR GetPtr() const { return m_Ptr; }
1349  FX_STRSIZE GetLength() const { return m_Length; }
1355  bool IsEmpty() const { return m_Length == 0; }
1356 
1364  FX_WCHAR GetAt(FX_STRSIZE index) const { return m_Ptr[index]; }
1365 
1374  {
1375  if (count < 1) return CFX_WideStringC();
1376  if (count > m_Length) count = m_Length;
1377  return CFX_WideStringC(m_Ptr, count);
1378  }
1379 
1388  CFX_WideStringC Mid(FX_STRSIZE index, FX_STRSIZE count = -1) const
1389  {
1390  if (index < 0) index = 0;
1391  if (index > m_Length) return CFX_WideStringC();
1392  if (count < 0 || count > m_Length - index) count = m_Length - index;
1393  return CFX_WideStringC(m_Ptr + index, count);
1394  }
1395 
1404  {
1405  if (count < 1) return CFX_WideStringC();
1406  if (count > m_Length) count = m_Length;
1407  return CFX_WideStringC(m_Ptr + m_Length - count, count);
1408  }
1409 
1410  protected:
1411  /* The constant byte string pointer. */
1412  FX_LPCWSTR m_Ptr;
1413  /* the length in bytes of the byte string. */
1414  FX_STRSIZE m_Length;
1415 
1416  private:
1417  /*
1418  * new operator forbidden. Cannot allocate a CFX_WideStringC in heap.
1419  */
1420  void* operator new (size_t) throw() { return NULL; }
1421 };
1422 
1424 typedef const CFX_WideStringC& FX_WSTR;
1425 
1435 #define FX_WSTRC(wstr) CFX_WideStringC((FX_LPCWSTR)wstr, sizeof(wstr) / sizeof(FX_WCHAR) - 1)
1436 
1437 //*****************************************************************************
1438 //* CFX_WideString - wide string
1439 //*****************************************************************************
1442 {
1444  long m_nRefs;
1451 };
1452 
1459 class CFX_WideString : public CFX_Object
1460 {
1461  public:
1465  CFX_WideString() { m_pData = NULL; }
1471  CFX_WideString(const CFX_WideString& str);
1478  CFX_WideString(FX_LPCWSTR ptr, FX_STRSIZE len = -1) { InitStr(ptr, len); }
1479 
1491  CFX_WideString(const CFX_WideStringC& str);
1498  CFX_WideString(const CFX_WideStringC& str1, const CFX_WideStringC& str2);
1502  ~CFX_WideString();
1503 
1513  static CFX_WideString FromLocal(const char* str, FX_STRSIZE len = -1);
1522  static CFX_WideString FromUTF8(const char* str, FX_STRSIZE len = -1);
1531  static CFX_WideString FromUTF16LE(const unsigned short* str, FX_STRSIZE len = -1);
1532 
1541  static CFX_WideString FromUTF16BE(const unsigned short* str, FX_STRSIZE len = -1);
1542 
1550  static FX_STRSIZE WStringLength(const unsigned short* str);
1551 
1555  operator FX_LPCWSTR() const { return m_pData ? m_pData->m_String : (FX_WCHAR*)L""; }
1556 
1562  void Empty();
1568  FX_BOOL IsEmpty() const { return !GetLength(); }
1569 
1575  FX_STRSIZE GetLength() const { return m_pData ? m_pData->m_nDataLength : 0; }
1576 
1585 
1593  const CFX_WideString& operator =(const CFX_WideString& stringSrc);
1601  const CFX_WideString& operator =(const CFX_WideStringC& stringSrc);
1602 
1611 
1627  const CFX_WideString& operator += (const CFX_WideString& str);
1635  const CFX_WideString& operator += (const CFX_WideStringC& str);
1636 
1644  FX_WCHAR GetAt(FX_STRSIZE nIndex) const { return m_pData ? m_pData->m_String[nIndex] : 0; }
1652  FX_WCHAR operator[](FX_STRSIZE nIndex) const { return m_pData ? m_pData->m_String[nIndex] : 0; }
1661  void SetAt(FX_STRSIZE nIndex, FX_WCHAR ch);
1662 
1674  int Compare(FX_LPCWSTR str) const;
1686  int Compare(const CFX_WideString& str) const;
1687 
1699  int CompareNoCase(FX_LPCWSTR str) const;
1700 
1711  bool Equal(const CFX_WideStringC& str) const;
1712 
1720  CFX_WideString Mid(FX_STRSIZE first) const;
1730  CFX_WideString Mid(FX_STRSIZE first, FX_STRSIZE count) const;
1738  CFX_WideString Left(FX_STRSIZE count) const;
1746  CFX_WideString Right(FX_STRSIZE count) const;
1747 
1756  FX_STRSIZE Insert(FX_STRSIZE index, FX_WCHAR ch);
1765  FX_STRSIZE Delete(FX_STRSIZE index, FX_STRSIZE count = 1);
1766 
1774  void Format(FX_LPCWSTR lpszFormat, ... );
1785  void FormatV(FX_LPCWSTR lpszFormat, va_list argList);
1786 
1792  void MakeLower();
1798  void MakeUpper();
1799 
1805  void TrimRight();
1813  void TrimRight(FX_WCHAR chTarget);
1821  void TrimRight(FX_LPCWSTR lpszTargets);
1822 
1828  void TrimLeft();
1836  void TrimLeft(FX_WCHAR chTarget);
1844  void TrimLeft(FX_LPCWSTR lpszTargets);
1845 
1855  void Reserve(FX_STRSIZE len);
1879  void ReleaseBuffer(FX_STRSIZE len = -1);
1880 
1886  int GetInteger() const;
1887 
1893  FX_FLOAT GetFloat() const;
1894 
1903  FX_STRSIZE Find(FX_LPCWSTR lpszSub, FX_STRSIZE start=0) const;
1912  FX_STRSIZE Find(FX_WCHAR ch, FX_STRSIZE start=0) const;
1913 
1922  FX_STRSIZE Replace(FX_LPCWSTR lpszOld, FX_LPCWSTR lpszNew);
1931 
1937  CFX_ByteString UTF8Encode() const;
1945  CFX_ByteString UTF16LE_Encode(FX_BOOL bTerminate = true) const;
1946 
1957  void ConvertFrom(const CFX_ByteString& str, CFX_CharMap* pCharMap = NULL);
1958 
1959  protected:
1960  void InitStr(FX_LPCWSTR ptr, int len);
1961 
1962  /* Pointer to ref counted wide string data. */
1963  CFX_StringDataW* m_pData;
1964 
1965  void CopyBeforeWrite();
1966  void AllocBeforeWrite(FX_STRSIZE nLen);
1967 
1968  void ConcatInPlace(FX_STRSIZE nSrcLen, FX_LPCWSTR lpszSrcData);
1969  void ConcatCopy(FX_STRSIZE nSrc1Len, FX_LPCWSTR lpszSrc1Data, FX_STRSIZE nSrc2Len, FX_LPCWSTR lpszSrc2Data);
1970  void AssignCopy(FX_STRSIZE nSrcLen, FX_LPCWSTR lpszSrcData);
1971  void AllocCopy(CFX_WideString& dest, FX_STRSIZE nCopyLen, FX_STRSIZE nCopyIndex, FX_STRSIZE nExtraLen) const;
1972 };
1973 
1975 {
1976  m_Ptr = (FX_LPCWSTR)src;
1977  m_Length = src.GetLength();
1978 }
1979 
1981 {
1982  m_Ptr = (FX_LPCWSTR)src;
1983  m_Length = src.GetLength();
1984  return *this;
1985 }
1986 
2000 
2009 inline CFX_WideString operator + (const CFX_WideStringC& str1, const CFX_WideStringC& str2) { return CFX_WideString(str1, str2); }
2010 #ifndef _NO_LPCSTR_SUPPORT_
2011 
2019 inline CFX_WideString operator + (const CFX_WideStringC& str1, FX_LPCWSTR str2) { return CFX_WideString(str1, str2); }
2028 inline CFX_WideString operator + (FX_LPCWSTR str1,const CFX_WideStringC& str2) { return CFX_WideString(str1, str2); }
2029 #endif
2030 
2047 inline CFX_WideString operator + (FX_WCHAR ch, const CFX_WideStringC& str2) { return CFX_WideString(ch, str2); }
2048 
2057 inline CFX_WideString operator + (const CFX_WideString& str1, const CFX_WideString& str2) { return CFX_WideString(str1, str2); }
2066 inline CFX_WideString operator + (const CFX_WideString& str1, FX_WCHAR ch) { return CFX_WideString(str1, CFX_WideStringC(ch)); }
2075 inline CFX_WideString operator + (FX_WCHAR ch, const CFX_WideString& str2) { return CFX_WideString(ch, str2); }
2076 #ifndef _NO_LPCSTR_SUPPORT_
2077 
2085 inline CFX_WideString operator + (const CFX_WideString& str1, FX_LPCWSTR str2) { return CFX_WideString(str1, str2); }
2094 inline CFX_WideString operator + (FX_LPCWSTR str1, const CFX_WideString& str2) { return CFX_WideString(str1, str2); }
2095 #endif
2096 
2104 inline CFX_WideString operator + (const CFX_WideString& str1, const CFX_WideStringC& str2) { return CFX_WideString(str1, str2); }
2113 inline CFX_WideString operator + (const CFX_WideStringC& str1, const CFX_WideString& str2) { return CFX_WideString(str1, str2); }
2114 
2121 
2130 bool operator==(const CFX_WideString& s1, const CFX_WideString& s2);
2139 bool operator==(const CFX_WideString& s1, const CFX_WideStringC& s2);
2148 bool operator==(const CFX_WideStringC& s1, const CFX_WideString& s2);
2157 bool operator== (const CFX_WideString& s1, FX_LPCWSTR s2);
2166 bool operator==(FX_LPCWSTR s1, const CFX_WideString& s2);
2167 
2176 bool operator!=(const CFX_WideString& s1, const CFX_WideString& s2);
2185 bool operator!=(const CFX_WideString& s1, const CFX_WideStringC& s2);
2194 bool operator!=(const CFX_WideStringC& s1, const CFX_WideString& s2);
2203 bool operator!= (const CFX_WideString& s1, FX_LPCWSTR s2);
2212 bool operator!=(FX_LPCWSTR s1, const CFX_WideString& s2);
2213 
2222 bool operator< (const CFX_WideString& lhs, const CFX_WideString& rhs);
2223 
2234 FX_FLOAT FX_atof(FX_BSTR str);
2245 void FX_atonum(FX_BSTR str, FX_BOOL& bInteger, void* pData, int sizeOfData = 4);
2246 
2256 
2300 #define FXWCHAR_LTR 0
2301 
2302 #define FXWCHAR_RTL 1
2303 
2304 #define FXWCHAR_UNKNOWN 2
2305 
2313 int FXWCHAR_GetDirection(FX_WCHAR wchar);
2315 //<<<+++OPENSOURCE_END
2316 
2321 
2338 inline CFX_ByteString FX_UTF8Encode(FX_WSTR wsStr) {return FX_UTF8Encode(wsStr.GetPtr(), wsStr.GetLength());}
2346 inline CFX_ByteString FX_UTF8Encode(const CFX_WideString &wsStr) {return FX_UTF8Encode((FX_LPCWSTR)wsStr, wsStr.GetLength());}
2347 
2361 {
2362  return ((first & 0xFC00) == 0xD800 && (second & 0xFC00) == 0xDC00);
2363 }
2364 
2377  FX_WCHAR second)
2378 {
2379  const FX_DWORD mask = (1 << 10) - 1;
2380  return (((first & mask) << 10) | (second & mask)) + 0x10000;
2381  // This function should not be called when the condition is
2382  // false, but we provide a sensible default in case it is.
2383 }
2384 
2387 //*****************************************************************************
2388 //* CFX_ByteStringL - long term byte string
2389 //*****************************************************************************
2390 class CFX_ByteStringL : public CFX_ByteStringC
2391 {
2392  public:
2393  CFX_ByteStringL() : CFX_ByteStringC() {}
2394  ~CFX_ByteStringL() {}
2395 
2396  void Empty(IFX_Allocator* pAllocator);
2397 
2398  FX_LPSTR AllocBuffer(FX_STRSIZE length, IFX_Allocator* pAllocator);
2399 
2400  void Set(FX_BSTR src, IFX_Allocator* pAllocator);
2401 };
2402 
2403 //*****************************************************************************
2404 //* CFX_WideStringL - long term wide string
2405 //*****************************************************************************
2406 class CFX_WideStringL : public CFX_WideStringC
2407 {
2408  public:
2409  CFX_WideStringL() : CFX_WideStringC() {}
2410  ~CFX_WideStringL() {}
2411 
2412  void Empty(IFX_Allocator* pAllocator);
2413 
2414  void Set(FX_WSTR src, IFX_Allocator* pAllocator);
2415 
2416  int GetInteger() const;
2417  FX_FLOAT GetFloat() const;
2418 
2419  void TrimRight(FX_LPCWSTR lpszTargets);
2420 };
2421 
2422 void FX_UTF8Encode(FX_LPCWSTR pwsStr, FX_STRSIZE len, CFX_ByteStringL &utf8Str, IFX_Allocator* pAllocator = NULL);
2423 //<<<+++OPENSOURCE_END
2424 
2425 //<<<+++OPENSOURCE_MUST_BEGIN
2426 #endif // _FX_STRING_H_
2427 //<<<+++OPENSOURCE_MUST_END
2428 
2431 //<<<+++OPENSOURCE_END
bool operator<(const CFX_WideString &lhs, const CFX_WideString &rhs)
Comparison(<) operator overload. Case-sensitive.
FX_BYTE GetAt(FX_STRSIZE nIndex) const
Get a single byte specified by an index number.
Definition: fx_string.h:607
CFX_ByteStringC(FX_LPCBYTE ptr, FX_STRSIZE size)
Constructs from a byte string.
Definition: fx_string.h:68
Dynamic binary buffers designed for more efficient appending.
Definition: fx_basic.h:52
int CompareNoCase(FX_LPCWSTR str) const
Compare the the string with a wide character string. No case-insensitive.
CFX_ByteStringC GetStringC() const
Get a non-buffered byte string.
Definition: fx_string.h:1165
FX_STRSIZE m_nAllocLength
Length of allocation.
Definition: fx_string.h:1448
FX_WCHAR GetAt(FX_STRSIZE nIndex) const
Retrieves a single wide character specified by an index number.
Definition: fx_string.h:1644
FX_STRSIZE Delete(FX_STRSIZE index, FX_STRSIZE count=1)
Delete one or more characters starting from specific position.
wchar_t FX_WCHAR
Compiler dependant Unicode character (16-bit for Microsoft Compiler, 32-bit for gcc).
Definition: fx_system.h:712
CFX_WideStringC()
Constructs a null constant string.
Definition: fx_string.h:1218
FX_STRSIZE Insert(FX_STRSIZE index, FX_WCHAR ch)
Insert a wide character before specific position.
const CFX_ByteStringC & FX_BSTR
A reference to a constant CFX_ByteStringC object.
Definition: fx_string.h:285
FX_FLOAT GetFloat() const
Convert to other data type.
static CFX_ByteString FromUnicode(FX_LPCWSTR ptr, FX_STRSIZE len=-1)
Create a CFX_ByteString object from a Unicode string. Convert from Unicode to system multi-byte chars...
void TrimRight()
Trim white spaces from the right side of the byte string.
void ReleaseBuffer(FX_STRSIZE len=-1)
Release the buffer fetched by function CFX_WideString::GetBuffer or CFX_WideString::LockBuffer,...
unsigned long FX_DWORD
32-bit unsigned integer.
Definition: fx_system.h:706
CFX_WideStringC Right(FX_STRSIZE count) const
Extracts the last (rightmost) count wide characters from this CFX_WideStringC object as a sub-string.
Definition: fx_string.h:1403
CONSTANT WIDE STRING CLASS.
Definition: fx_string.h:1212
bool IsEmpty() const
Determines whether current string object is empty.
Definition: fx_string.h:1355
FX_CHAR m_String[1]
Real data (actually a variable-sized array).
Definition: fx_string.h:311
CFX_WideStringC Left(FX_STRSIZE count) const
Extracts the first (leftmost) count wide characters from this CFX_WideStringC object as a sub-string.
Definition: fx_string.h:1373
long m_nRefs
Reference count.
Definition: fx_string.h:305
FX_STRSIZE Find(FX_LPCWSTR lpszSub, FX_STRSIZE start=0) const
Find a sub-string, from specific position. Only first occurrence is found.
FX_STRSIZE GetLength() const
Get the length of the byte string.
Definition: fx_string.h:1349
FX_STRSIZE GetLength() const
Get the length of the byte string.
Definition: fx_string.h:227
CFX_WideStringC Mid(FX_STRSIZE index, FX_STRSIZE count=-1) const
Extracts a substring of length count bytes from this CFX_WideStringC object, starting at position ind...
Definition: fx_string.h:1388
bool operator!=(const CFX_WideStringC &str) const
Comparison(!=) operator overload. Case-sensitive.
Definition: fx_string.h:1333
CFX_ByteStringC(FX_LPCSTR ptr)
Construct from a character string.
Definition: fx_string.h:81
FX_FLOAT FX_atof(FX_BSTR str)
Convert a non-buffered byte string to a floating-point number.
CFX_ByteStringC(FX_LPCSTR ptr, FX_STRSIZE len)
Construct from a character string.
Definition: fx_string.h:105
bool Equal(const CFX_WideStringC &str) const
Check if current string is equal to another.
bool operator==(const CFX_ByteStringC &str) const
Comparison(==) operator overload. case-sensitive.
Definition: fx_string.h:172
FX_LPSTR LockBuffer()
Lock and get the current string buffer, so the caller can modify the returned buffer.
void Empty()
Set this string to be empty.
Definition: fx_string.h:1128
wchar_t const * FX_LPCWSTR
Pointer to constant Unicode characters.
Definition: fx_system.h:716
bool operator!=(const CFX_ByteStringC &str) const
Comparison(!=) operator overload. case-sensitive.
Definition: fx_string.h:183
void TrimLeft()
Trim white spaces from the left side of the byte string.
FX_STRSIZE Delete(FX_STRSIZE index, FX_STRSIZE count=1)
Delete one or more wide characters starting from specific position.
FX_BYTE operator[](FX_STRSIZE nIndex) const
Subscript([]) operator overload. It retrieves a single byte specified by the zero-based index in nInd...
Definition: fx_string.h:615
#define FXSYS_strlen
Get the length of a ANSIC string.
Definition: fx_system.h:871
FX_LPWSTR GetBuffer(FX_STRSIZE len)
Get a buffer with specific number of characters allocated.
FX_STRSIZE GetSize() const
Gets the length of the string.
Definition: fx_string.h:1121
CFX_WideString(FX_LPCWSTR ptr, FX_STRSIZE len=-1)
Construct from a wide character string.
Definition: fx_string.h:1478
void Empty()
Set this string to be empty.
FX_INT32 FXSYS_memcmp32(const void *buf1, const void *buf2, size_t size)
Compare data in two buffers.
char * FX_LPSTR
Pointer to 8-bit Windows (ANSI) characters.
Definition: fx_system.h:685
CFX_StringBufTemplate< 256 > CFX_StringBuf256
A fixed 256-byte string buffer.
Definition: fx_string.h:1202
FX_LPSTR GetBuffer(FX_STRSIZE len)
Get a buffer with specific number of bytes allocated.
void Load(FX_LPCBYTE str, FX_STRSIZE len)
Load from a byte string.
FX_STRSIZE Remove(FX_WCHAR ch)
Remove all occurrence of a particular character.
CFX_ByteStringC(const CFX_ByteStringC &src)
Copy constructor.
Definition: fx_string.h:118
CFX_WideStringC & operator=(FX_LPCWSTR src)
Assignment(=) operator overload. From a character string.
Definition: fx_string.h:1287
void ConvertFrom(const CFX_WideString &str, CFX_CharMap *pCharMap=NULL)
Load unicode data into this byte string, using specified character mapper. If no character mapper spe...
WIDE STRING CLASS.
Definition: fx_string.h:1459
void Empty()
Set this string to be empty.
void TrimLeft()
Trim white spaces from the left side of the wide string.
CFX_WideStringC(const CFX_WideStringC &src)
Copy constructor.
Definition: fx_string.h:1268
void MakeUpper()
Change case of English letters to upper.
static FX_STRSIZE WStringLength(const unsigned short *str)
Length of string.
FX_LPCBYTE GetPtr() const
Get a constant byte string pointer to the byte string.
Definition: fx_string.h:215
FX_BOOL FXWCHAR_IsWordBreak(FX_WCHAR wchar)
Check if the unicode can break a word.
FX_STRSIZE Replace(FX_LPCWSTR lpszOld, FX_LPCWSTR lpszNew)
Replace all patterns in the string with a new sub-string.
static CFX_WideString FromUTF8(const char *str, FX_STRSIZE len=-1)
Create a wide string from UTF-8 string (ASCII string compatible).
void TrimRight()
Trim white spaces from the right side of the wide string.
This class represents the data of a wide string object.
Definition: fx_string.h:1441
FX_WCHAR FXWCHAR_GetUpper(FX_WCHAR wchar)
Convert to upper-case letter.
FX_WCHAR FXWCHAR_GetLower(FX_WCHAR wchar)
Convert to lower-case letter.
FX_WCHAR m_String[1]
Real data (actually a variable-sized array).
Definition: fx_string.h:1450
FX_STRSIZE GetLength() const
Get number of characters, not bytes. Trailing zero not counted.
Definition: fx_string.h:1575
FX_STRSIZE Remove(FX_CHAR ch)
Remove all occurrence of a particular character.
void Reserve(FX_STRSIZE len)
Reserve a buffer that can hold specific number of bytes.
FX_BOOL FXWCHAR_IsSpace(FX_WCHAR wchar)
Check if the unicode is space.
CFX_WideString()
Construct a null wide string.
Definition: fx_string.h:1465
A fixed string buffer holding up to certain number of characters.
Definition: fx_string.h:1100
int FX_INT32
32-bit signed integer.
Definition: fx_system.h:665
void * FXSYS_memset32(void *dst, FX_INT32 v, size_t size)
Set buffer data to specified value.
int FX_STRSIZE
String size is limited to 2^31-1.
Definition: fx_string.h:35
A fixed string buffer template.
Definition: fx_string.h:1185
bool EqualNoCase(FX_BSTR str) const
Check if current string is equal to another one, not considering case.
FX_STRSIZE m_nAllocLength
Length of allocation.
Definition: fx_string.h:309
const CFX_ByteString & operator+=(FX_CHAR ch)
Concatenation(+=) operator overload. Concatenate a single character.
FX_WCHAR GetAt(FX_STRSIZE index) const
Retrieves a single byte specified by an index number.
Definition: fx_string.h:1364
int Compare(FX_LPCWSTR str) const
Compare current string with a wide character string. Case-sensitive.
CFX_ByteStringC()
Constructs a null constant string.
Definition: fx_string.h:57
int FX_BOOL
Boolean variable (should be TRUE or FALSE).
Definition: fx_system.h:673
int Compare(FX_BSTR str) const
Compare the the string with another. Case-sensitive.
CFX_WideStringC(FX_WCHAR &ch)
Construct from a single character.
Definition: fx_string.h:1244
void Format(FX_LPCSTR lpszFormat,...)
Format a number of parameters into this byte string.
char const * FX_LPCSTR
Pointer to constant 8-bit Windows (ANSI) characters.
Definition: fx_system.h:687
#define FXSYS_wcslen
Get the length of a wide-character string.
Definition: fx_system.h:1020
const CFX_WideString & operator+=(FX_LPCWSTR str)
Concatenation(+=) operator overload. Concatenate a wide character string.
bool operator!=(FX_LPCSTR str) const
Comparison(!=) operator overload. case-sensitive.
Definition: fx_string.h:487
CFX_ByteString UTF16LE_Encode(FX_BOOL bTerminate=true) const
Do UTF16LE encoding.
static CFX_WideString FromLocal(const char *str, FX_STRSIZE len=-1)
Create a wide string from system multi-byte charset.
CFX_ByteString Left(FX_STRSIZE count) const
Extracts the first (leftmost) count bytes from this CFX_ByteString object as a sub-string.
FX_DWORD GetID(FX_STRSIZE start_pos=0) const
Get a DWORD identifier of the string. See function CFX_ByteStringC::GetID for details.
CFX_ByteString GetString() const
Get a buffered byte string.
Definition: fx_string.h:1171
void SetAt(FX_STRSIZE nIndex, FX_CHAR ch)
Overwrites a single byte specified by an index number.
FX_STRSIZE GetLength() const
Get number of bytes in the byte string (not counting any possible terminator).
Definition: fx_string.h:402
FX_STRSIZE m_nDataLength
Length of data (excluding terminator).
Definition: fx_string.h:307
FX_WCHAR operator[](FX_STRSIZE nIndex) const
Subscript([]) operator overload. It retrieves a wide character specified by the zero-based index in n...
Definition: fx_string.h:1652
This class represents the data of a byte string object.
Definition: fx_string.h:302
~CFX_WideString()
The Destructor.
bool IsEmpty() const
Check whether current string object is empty.
Definition: fx_string.h:409
FX_CHAR m_Buffer[limit]
The fixed string buffer.
Definition: fx_string.h:1198
CFX_ByteString UTF8Encode() const
Do UTF8 encoding.
void MakeLower()
Change case of English letters to lower.
CFX_ByteStringC Mid(FX_STRSIZE index, FX_STRSIZE count=-1) const
This method extracts a substring of length count bytes from this CFX_ByteStringC object,...
Definition: fx_string.h:263
static CFX_ByteString FormatFloat(FX_FLOAT f, int precision=0)
Convert from floating-point number.
FX_STRSIZE m_nDataLength
Length of data (excluding terminator).
Definition: fx_string.h:1446
CFX_ByteString Mid(FX_STRSIZE first) const
Extracts a substring from this CFX_ByteString object, starting at position nFirst (zero-based) to las...
CFX_ByteString operator+(FX_BSTR str1, FX_BSTR str2)
Concatenate a non-buffered byte string and a non-buffered byte string.
Definition: fx_string.h:978
Foxit allocator interface.
Definition: fx_memory.h:961
Definition: fx_basic.h:947
void ConvertFrom(const CFX_ByteString &str, CFX_CharMap *pCharMap=NULL)
Load MBCS data into this wide string, using specified character mapper.
char FX_CHAR
8-bit Windows (ANSI) character.
Definition: fx_system.h:683
void FX_atonum(FX_BSTR str, FX_BOOL &bInteger, void *pData, int sizeOfData=4)
Convert a non-buffered byte string to a number.
FX_LPCSTR GetCStr() const
Get a constant character string pointer to the byte string.
Definition: fx_string.h:221
float FX_FLOAT
32-bit floating-point number.
Definition: fx_system.h:667
CFX_StringBufBase(FX_STRSIZE limit)
A Constructor.
Definition: fx_string.h:1108
bool IsEmpty() const
Check whether current string object is empty.
Definition: fx_string.h:233
FX_STRSIZE FX_ftoa(FX_FLOAT f, FX_LPSTR buf)
Convert float to byte string.
FX_STRSIZE ReverseFind(FX_CHAR ch) const
Find a character from end of the string.
bool operator<(const CFX_ByteString &rhs) const
Comparison(<) operator overload. case-sensitive.
void FormatV(FX_LPCSTR lpszFormat, va_list argList)
Format a number of parameters into this byte string, using va_list.
CFX_ByteString FX_UTF8Encode(FX_LPCWSTR pwsStr, FX_STRSIZE len)
Encode a wide string into a UTF-8 string.
void SetAt(FX_STRSIZE nIndex, FX_WCHAR ch)
Overwrites a single wide character specified by an index number.
void Append(FX_BSTR str)
Append a non-buffered byte string.
CFX_ByteStringC & operator=(FX_LPCSTR src)
Assignment(=) operator overload. From a character string.
Definition: fx_string.h:137
FX_BYTE GetAt(FX_STRSIZE index) const
This method retrieves a single byte specified by an index number.
Definition: fx_string.h:252
static CFX_ByteString LoadFromFile(FX_BSTR file_path)
Load the whole content of a file.
CONSTANT BYTE STRING CLASS.
Definition: fx_string.h:51
CFX_ByteString()
Construct a null byte string.
Definition: fx_string.h:323
const CFX_WideStringC & FX_WSTR
Type definition for a reference to a constant CFX_WideStringC object.
Definition: fx_string.h:1424
bool operator!=(const CFX_WideString &s1, const CFX_WideString &s2)
Comparison(!=) operator overload. Case-sensitive.
FX_STRSIZE Replace(FX_BSTR lpszOld, FX_BSTR lpszNew)
Replace all patterns in the string with a new sub-string.
void Reserve(FX_STRSIZE len)
Reserve a buffer that can hold specific number of characters.
static CFX_ByteString FormatInteger(FX_INT32 i, FX_DWORD flags=0)
Convert from Integer.
CFX_WideStringC(FX_LPCWSTR ptr)
Construct from a character string.
Definition: fx_string.h:1231
bool operator==(const CFX_WideStringC &str) const
Comparison(==) operator overload. Case-sensitive.
Definition: fx_string.h:1322
FX_STRSIZE Find(FX_BSTR lpszSub, FX_STRSIZE start=0) const
Find a sub-string, from specific position. Only first occurrence is found.
CFX_ByteString Right(FX_STRSIZE count) const
Extracts the last (rightmost) count bytes from this CFX_ByteString object as a sub-string.
long m_nRefs
Reference count.
Definition: fx_string.h:1444
CFX_WideString UTF8Decode() const
Decode a UTF-8 unicode string (assume this byte string is UTF-8 encoded).
static CFX_WideString FromUTF16BE(const unsigned short *str, FX_STRSIZE len=-1)
Create a wide string from UTF16BE encoded string.
void MakeUpper()
Change case of English letters to upper.
BYTE STRING CLASS.
Definition: fx_string.h:317
int GetInteger() const
Convert to other data type.
unsigned char const * FX_LPCBYTE
Pointer to a constant FX_BYTE.
Definition: fx_system.h:651
FX_DWORD FX_CreateCodePointFromUtf16SurrogatePair(FX_WCHAR first, FX_WCHAR second)
Creates a Unicode code point from UTF16 surrogate pair.
Definition: fx_string.h:2376
FX_CHAR * GetPtr() const
Get a C-style string pointer to the string buffer.
Definition: fx_string.h:1115
FX_LPWSTR LockBuffer()
Lock and get the current string buffer, so the caller can modify the returned buffer....
static CFX_WideString FromUTF16LE(const unsigned short *str, FX_STRSIZE len=-1)
Create a wide string from UTF16LE encoded string.
wchar_t * FX_LPWSTR
Pointer to Unicode characters.
Definition: fx_system.h:714
CFX_WideString Right(FX_STRSIZE count) const
Extracts the last (rightmost) count wide characters from this CFX_WideString object as a sub-string.
void MakeLower()
Change case of English letters to lower.
#define NULL
The null-pointer value.
Definition: fx_system.h:771
FX_BOOL IsEmpty() const
Check whether current string object is empty.
Definition: fx_string.h:1568
bool Equal(FX_BSTR str) const
Check if current string is equal to another one. Case-sensitive.
CFX_WideString Left(FX_STRSIZE count) const
Extracts the first (leftmost) count wide characters from this CFX_WideString object as a sub-string.
void Copy(FX_BSTR str)
Copy from a non-buffered byte string.
bool operator==(const CFX_WideString &s1, const CFX_WideString &s2)
Comparison(==) operator overload. Case-sensitive.
void ReleaseBuffer(FX_STRSIZE len=-1)
Release the buffer fetched by function CFX_ByteString::GetBuffer or CFX_ByteString::LockBuffer,...
const CFX_WideString & operator=(FX_LPCWSTR str)
Assignment(=) operator overload. From a wide character string.
void FormatV(FX_LPCWSTR lpszFormat, va_list argList)
Format a number of parameters into this wide string. using va_list.
FX_BOOL FX_IsUtf16SurrogatePair(FX_WCHAR first, FX_WCHAR second)
Determines if the arguments constitute UTF-16 surrogate pair.
Definition: fx_string.h:2360
FX_LPCWSTR GetPtr() const
Get a constant wide string pointer to the wide string.
Definition: fx_string.h:1343
int FXWCHAR_GetDirection(FX_WCHAR wchar)
Get text direction.
CFX_StringBufTemplate()
A constructor.
Definition: fx_string.h:1191
CFX_WideStringC(FX_LPCWSTR ptr, FX_STRSIZE len)
Construct from a character string.
Definition: fx_string.h:1255
CFX_ByteStringC(const FX_CHAR &ch)
Construct from a single character.
Definition: fx_string.h:94
FX_STRSIZE Insert(FX_STRSIZE index, FX_CHAR ch)
Insert a character before specific position.
const CFX_ByteString & operator=(FX_LPCSTR str)
Assignment(=) operator overload. From a character string.
CFX_WideString Mid(FX_STRSIZE first) const
Extracts a substring from this CFX_WideString object, starting at position nFirst (zero-based) to las...
unsigned char FX_BYTE
Byte (8 bits).
Definition: fx_system.h:647
FX_DWORD GetID(FX_STRSIZE start_pos=0) const
Get a DWORD identifier of the string, from a particular position.
bool operator==(FX_LPCSTR str) const
Comparison(==) operator overload. case-sensitive.
Definition: fx_string.h:457
void Format(FX_LPCWSTR lpszFormat,...)
Format a number of parameters into this wide string.