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(); }
421  int Compare(FX_BSTR str) const;
422 
433  bool Equal(FX_BSTR str) const;
434 
444  bool EqualNoCase(FX_BSTR str) const;
445 
446 //<<<+++OPENSOURCE_MUST_BEGIN LIC==FOXIT
447 #ifndef _NO_LPCSTR_SUPPORT_
448 //<<<+++OPENSOURCE_MUST_END
456  bool operator == (FX_LPCSTR str) const { return Equal(str); }
457 //<<<+++OPENSOURCE_MUST_BEGIN LIC==FOXIT
458 #endif
459 //<<<+++OPENSOURCE_MUST_END
467  bool operator == (FX_BSTR str) const { return Equal(str); }
475  bool operator == (const CFX_ByteString& str) const;
476 //<<<+++OPENSOURCE_MUST_BEGIN LIC==FOXIT
477 #ifndef _NO_LPCSTR_SUPPORT_
478 //<<<+++OPENSOURCE_MUST_END
486  bool operator != (FX_LPCSTR str) const { return !Equal(str); }
487 //<<<+++OPENSOURCE_MUST_BEGIN LIC==FOXIT
488 #endif
489 //<<<+++OPENSOURCE_MUST_END
497  bool operator != (FX_BSTR str) const { return !Equal(str); }
505  bool operator != (const CFX_ByteString& str) const { return !operator==(str); }
506 
514  bool operator< (const CFX_ByteString& rhs) const;
515 
521  void Empty();
522 
538  const CFX_ByteString& operator = (FX_BSTR bstrc);
546  const CFX_ByteString& operator = (const CFX_ByteString& stringSrc);
554  const CFX_ByteString& operator = (const CFX_BinaryBuf& buf);
555 
564  void Load(FX_LPCBYTE str, FX_STRSIZE len);
565 
589  const CFX_ByteString& operator += (const CFX_ByteString& str);
597  const CFX_ByteString& operator += (FX_BSTR bstrc);
598 
606  FX_BYTE GetAt(FX_STRSIZE nIndex) const { return m_pData ? m_pData->m_String[nIndex] : 0; }
614  FX_BYTE operator[](FX_STRSIZE nIndex) const { return m_pData ? m_pData->m_String[nIndex] : 0; }
623  void SetAt(FX_STRSIZE nIndex, FX_CHAR ch);
624 
633  FX_STRSIZE Insert(FX_STRSIZE index, FX_CHAR ch);
634 
643  FX_STRSIZE Delete(FX_STRSIZE index, FX_STRSIZE count = 1);
660  void Format(FX_LPCSTR lpszFormat, ... );
671  void FormatV(FX_LPCSTR lpszFormat, va_list argList);
683  void Reserve(FX_STRSIZE len);
684 
697 
707 
718  void ReleaseBuffer(FX_STRSIZE len = -1);
719 
727  CFX_ByteString Mid(FX_STRSIZE first) const;
736  CFX_ByteString Mid(FX_STRSIZE first, FX_STRSIZE count) const;
744  CFX_ByteString Left(FX_STRSIZE count) const;
752  CFX_ByteString Right(FX_STRSIZE count) const;
761  FX_STRSIZE Find(FX_BSTR lpszSub, FX_STRSIZE start=0) const;
770  FX_STRSIZE Find(FX_CHAR ch, FX_STRSIZE start=0) const;
778  FX_STRSIZE ReverseFind(FX_CHAR ch) const;
779 
785  void MakeLower();
791  void MakeUpper();
792 
798  void TrimRight();
806  void TrimRight(FX_CHAR chTarget);
814  void TrimRight(FX_BSTR lpszTargets);
820  void TrimLeft();
828  void TrimLeft(FX_CHAR chTarget);
836  void TrimLeft(FX_BSTR lpszTargets);
837 
846  FX_STRSIZE Replace(FX_BSTR lpszOld, FX_BSTR lpszNew);
855 
861  CFX_WideString UTF8Decode() const;
862 
872  void ConvertFrom(const CFX_WideString& str, CFX_CharMap* pCharMap = NULL);
880  FX_DWORD GetID(FX_STRSIZE start_pos = 0) const;
888  static CFX_ByteString LoadFromFile(FX_BSTR file_path);
889 
891 #define FXFORMAT_SIGNED 1
892 
893 #define FXFORMAT_HEX 2
894 
895 #define FXFORMAT_CAPITAL 4
896 
912  static CFX_ByteString FormatInteger(FX_INT32 i, FX_DWORD flags = 0);
920  static CFX_ByteString FormatInteger64(FX_INT64 i);
921 
932  static CFX_ByteString FormatFloat(FX_FLOAT f, int precision = 0);
933 
934  protected:
935  /* Pointer to ref counted byte string data. */
936  struct CFX_StringData* m_pData;
937 
938  void AllocCopy(CFX_ByteString& dest, FX_STRSIZE nCopyLen, FX_STRSIZE nCopyIndex, FX_STRSIZE nExtraLen) const;
939  void AssignCopy(FX_STRSIZE nSrcLen, FX_LPCSTR lpszSrcData);
940  void ConcatCopy(FX_STRSIZE nSrc1Len, FX_LPCSTR lpszSrc1Data, FX_STRSIZE nSrc2Len, FX_LPCSTR lpszSrc2Data);
941  void ConcatInPlace(FX_STRSIZE nSrcLen, FX_LPCSTR lpszSrcData);
942  void CopyBeforeWrite();
943  void AllocBeforeWrite(FX_STRSIZE nLen);
944 };
945 
947 {
948  m_Ptr = (FX_LPCBYTE)src;
949  m_Length = src.GetLength();
950 }
951 
953 {
954  m_Ptr = (FX_LPCBYTE)src;
955  m_Length = src.GetLength();
956  return *this;
957 }
958 
971 
980 inline CFX_ByteString operator + (FX_BSTR str1, FX_BSTR str2) { return CFX_ByteString(str1, str2); }
981 //<<<+++OPENSOURCE_MUST_BEGIN LIC==FOXIT
982 #ifndef _NO_LPCSTR_SUPPORT_
983 //<<<+++OPENSOURCE_MUST_END
992 inline CFX_ByteString operator + (FX_BSTR str1, FX_LPCSTR str2) { return CFX_ByteString(str1, str2); }
1001 inline CFX_ByteString operator + (FX_LPCSTR str1,FX_BSTR str2) { return CFX_ByteString(str1, str2); }
1002 //<<<+++OPENSOURCE_MUST_BEGIN LIC==FOXIT
1003 #endif
1004 //<<<+++OPENSOURCE_MUST_END
1023 
1032 inline CFX_ByteString operator + (const CFX_ByteString& str1, const CFX_ByteString& str2) { return CFX_ByteString(str1, str2); }
1041 inline CFX_ByteString operator + (const CFX_ByteString& str1, FX_CHAR ch) { return CFX_ByteString(str1, CFX_ByteStringC(ch)); }
1050 inline CFX_ByteString operator + (FX_CHAR ch, const CFX_ByteString& str2) { return CFX_ByteString(CFX_ByteStringC(ch), str2); }
1051 //<<<+++OPENSOURCE_MUST_BEGIN LIC==FOXIT
1052 #ifndef _NO_LPCSTR_SUPPORT_
1053 //<<<+++OPENSOURCE_MUST_END
1062 inline CFX_ByteString operator + (const CFX_ByteString& str1, FX_LPCSTR str2) { return CFX_ByteString(str1, str2); }
1071 inline CFX_ByteString operator + (FX_LPCSTR str1, const CFX_ByteString& str2) { return CFX_ByteString(str1, str2); }
1072 //<<<+++OPENSOURCE_MUST_BEGIN LIC==FOXIT
1073 #endif
1074 //<<<+++OPENSOURCE_MUST_END
1083 inline CFX_ByteString operator + (const CFX_ByteString& str1, FX_BSTR str2) { return CFX_ByteString(str1, str2); }
1092 inline CFX_ByteString operator + (FX_BSTR str1, const CFX_ByteString& str2) { return CFX_ByteString(str1, str2); }
1093 
1102 class CFX_StringBufBase : public CFX_Object
1103 {
1104  public:
1110  explicit CFX_StringBufBase(FX_STRSIZE limit) { m_Size = 0; m_Limit = limit; }
1111 
1117  FX_CHAR* GetPtr() const { return (FX_CHAR*)(this + 1); }
1123  FX_STRSIZE GetSize() const { return m_Size; }
1124 
1130  void Empty() { m_Size = 0; }
1131 
1139  void Copy(FX_BSTR str);
1140 
1148  void Append(FX_BSTR str);
1149 
1160  void Append(int i, FX_DWORD flags = 0);
1161 
1167  CFX_ByteStringC GetStringC() const { return CFX_ByteStringC((FX_CHAR*)(this + 1), m_Size); }
1173  CFX_ByteString GetString() const { return CFX_ByteString((FX_CHAR*)(this + 1), m_Size); }
1174 
1175  protected:
1176  /* The buffer limit. */
1177  FX_STRSIZE m_Limit;
1178  /* The string size. */
1179  FX_STRSIZE m_Size;
1180  // the real buffer follows
1181 };
1182 
1186 template<FX_STRSIZE limit>
1188 {
1189  public:
1194 
1201 };
1202 
1205 
1206 //*****************************************************************************
1207 //* CFX_WideStringC - constant wide string
1208 //*****************************************************************************
1214 class CFX_WideStringC : public CFX_Object
1215 {
1216  public:
1221  {
1222  m_Ptr = NULL;
1223  m_Length = 0;
1224  }
1225 //<<<+++OPENSOURCE_MUST_BEGIN LIC==FOXIT
1226 #ifndef _NO_LPCSTR_SUPPORT_
1227 //<<<+++OPENSOURCE_MUST_END
1234  {
1235  m_Ptr = ptr;
1236  m_Length = ptr ? (FX_STRSIZE)FXSYS_wcslen(ptr) : 0;
1237  }
1238 //<<<+++OPENSOURCE_MUST_BEGIN LIC==FOXIT
1239 #endif
1240 //<<<+++OPENSOURCE_MUST_END
1247  {
1248  m_Ptr = &ch;
1249  m_Length = 1;
1250  }
1258  {
1259  m_Ptr = ptr;
1260  if (len == -1)
1261  m_Length = (FX_STRSIZE)FXSYS_wcslen(ptr);
1262  else
1263  m_Length = len;
1264  }
1271  {
1272  m_Ptr = src.m_Ptr;
1273  m_Length = src.m_Length;
1274  }
1280  CFX_WideStringC(const CFX_WideString& src);
1281 
1290  {
1291  m_Ptr = src;
1292  m_Length = (FX_STRSIZE)FXSYS_wcslen(src);
1293  return *this;
1294  }
1303  {
1304  m_Ptr = src.m_Ptr;
1305  m_Length = src.m_Length;
1306  return *this;
1307  }
1316 
1324  bool operator == (const CFX_WideStringC& str) const
1325  {
1326  return str.m_Length == m_Length && FXSYS_memcmp32(str.m_Ptr, m_Ptr, m_Length*sizeof(FX_WCHAR)) == 0;
1327  }
1335  bool operator != (const CFX_WideStringC& str) const
1336  {
1337  return str.m_Length != m_Length || FXSYS_memcmp32(str.m_Ptr, m_Ptr, m_Length*sizeof(FX_WCHAR)) != 0;
1338  }
1339 
1345  FX_LPCWSTR GetPtr() const { return m_Ptr; }
1351  FX_STRSIZE GetLength() const { return m_Length; }
1357  bool IsEmpty() const { return m_Length == 0; }
1358 
1366  FX_WCHAR GetAt(FX_STRSIZE index) const { return m_Ptr[index]; }
1367 
1376  {
1377  if (count < 1) return CFX_WideStringC();
1378  if (count > m_Length) count = m_Length;
1379  return CFX_WideStringC(m_Ptr, count);
1380  }
1381 
1390  CFX_WideStringC Mid(FX_STRSIZE index, FX_STRSIZE count = -1) const
1391  {
1392  if (index < 0) index = 0;
1393  if (index > m_Length) return CFX_WideStringC();
1394  if (count < 0 || count > m_Length - index) count = m_Length - index;
1395  return CFX_WideStringC(m_Ptr + index, count);
1396  }
1397 
1406  {
1407  if (count < 1) return CFX_WideStringC();
1408  if (count > m_Length) count = m_Length;
1409  return CFX_WideStringC(m_Ptr + m_Length - count, count);
1410  }
1411 
1412  protected:
1413  /* The constant byte string pointer. */
1414  FX_LPCWSTR m_Ptr;
1415  /* the length in bytes of the byte string. */
1416  FX_STRSIZE m_Length;
1417 
1418  private:
1419  /*
1420  * new operator forbidden. Cannot allocate a CFX_WideStringC in heap.
1421  */
1422  void* operator new (size_t) throw() { return NULL; }
1423 };
1424 
1426 typedef const CFX_WideStringC& FX_WSTR;
1427 
1437 #define FX_WSTRC(wstr) CFX_WideStringC((FX_LPCWSTR)wstr, sizeof(wstr) / sizeof(FX_WCHAR) - 1)
1438 
1439 //*****************************************************************************
1440 //* CFX_WideString - wide string
1441 //*****************************************************************************
1444 {
1446  long m_nRefs;
1453 };
1454 
1461 class CFX_WideString : public CFX_Object
1462 {
1463  public:
1467  CFX_WideString() { m_pData = NULL; }
1473  CFX_WideString(const CFX_WideString& str);
1480  CFX_WideString(FX_LPCWSTR ptr, FX_STRSIZE len = -1) { InitStr(ptr, len); }
1481 
1493  CFX_WideString(const CFX_WideStringC& str);
1500  CFX_WideString(const CFX_WideStringC& str1, const CFX_WideStringC& str2);
1504  ~CFX_WideString();
1505 
1515  static CFX_WideString FromLocal(const char* str, FX_STRSIZE len = -1);
1524  static CFX_WideString FromUTF8(const char* str, FX_STRSIZE len = -1);
1533  static CFX_WideString FromUTF16LE(const unsigned short* str, FX_STRSIZE len = -1);
1534 
1543  static CFX_WideString FromUTF16BE(const unsigned short* str, FX_STRSIZE len = -1);
1544 
1552  static FX_STRSIZE WStringLength(const unsigned short* str);
1553 
1557  operator FX_LPCWSTR() const { return m_pData ? m_pData->m_String : (FX_WCHAR*)L""; }
1558 
1564  void Empty();
1570  FX_BOOL IsEmpty() const { return !GetLength(); }
1571 
1577  FX_STRSIZE GetLength() const { return m_pData ? m_pData->m_nDataLength : 0; }
1578 
1587 
1595  const CFX_WideString& operator =(const CFX_WideString& stringSrc);
1603  const CFX_WideString& operator =(const CFX_WideStringC& stringSrc);
1604 
1613 
1629  const CFX_WideString& operator += (const CFX_WideString& str);
1637  const CFX_WideString& operator += (const CFX_WideStringC& str);
1638 
1646  FX_WCHAR GetAt(FX_STRSIZE nIndex) const { return m_pData ? m_pData->m_String[nIndex] : 0; }
1654  FX_WCHAR operator[](FX_STRSIZE nIndex) const { return m_pData ? m_pData->m_String[nIndex] : 0; }
1663  void SetAt(FX_STRSIZE nIndex, FX_WCHAR ch);
1664 
1676  int Compare(FX_LPCWSTR str) const;
1688  int Compare(const CFX_WideString& str) const;
1689 
1701  int CompareNoCase(FX_LPCWSTR str) const;
1702 
1713  bool Equal(const CFX_WideStringC& str) const;
1714 
1722  CFX_WideString Mid(FX_STRSIZE first) const;
1732  CFX_WideString Mid(FX_STRSIZE first, FX_STRSIZE count) const;
1740  CFX_WideString Left(FX_STRSIZE count) const;
1748  CFX_WideString Right(FX_STRSIZE count) const;
1749 
1758  FX_STRSIZE Insert(FX_STRSIZE index, FX_WCHAR ch);
1767  FX_STRSIZE Delete(FX_STRSIZE index, FX_STRSIZE count = 1);
1775  void Format(FX_LPCWSTR lpszFormat, ... );
1786  void FormatV(FX_LPCWSTR lpszFormat, va_list argList);
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 FX_STRSIZE FX_ftoa(FX_FLOAT f, FX_LPSTR buf, int precision = 0);
2257 
2301 #define FXWCHAR_LTR 0
2302 
2303 #define FXWCHAR_RTL 1
2304 
2305 #define FXWCHAR_UNKNOWN 2
2306 
2315 int FXWCHAR_GetDirection(FX_WCHAR wchar);
2317 //<<<+++OPENSOURCE_END
2318 
2323 
2341 {
2342  return FX_UTF8Encode(wsStr.GetPtr(), wsStr.GetLength());
2343 }
2352 {
2353  return FX_UTF8Encode((FX_LPCWSTR)wsStr, wsStr.GetLength());
2354 }
2355 
2369 {
2370  return ((first & 0xFC00) == 0xD800 && (second & 0xFC00) == 0xDC00);
2371 }
2372 
2385  FX_WCHAR second)
2386 {
2387  const FX_DWORD mask = (1 << 10) - 1;
2388  return (((first & mask) << 10) | (second & mask)) + 0x10000;
2389  // This function should not be called when the condition is
2390  // false, but we provide a sensible default in case it is.
2391 }
2392 
2407  FX_WCHAR& first,
2408  FX_WCHAR& second)
2409 {
2410  // 0x10000 = 0xFFFF+1
2411  if (unicode < 0x10000 || unicode > 0x10FFFF)
2412  return false;
2413 
2414  /* high surrogate = top 10 bits added to D800 */
2415  first = (FX_WCHAR)(0xD800 - (0x10000 >> 10) + ((unicode) >> 10));
2416  /* low surrogate = bottom 10 bits added to DC00 */
2417  second = (FX_WCHAR)(0xDC00 + ((unicode)&0x3FF));
2418  return true;
2419 }
2420 
2423 //*****************************************************************************
2424 //* CFX_ByteStringL - long term byte string
2425 //*****************************************************************************
2426 class CFX_ByteStringL : public CFX_ByteStringC
2427 {
2428  public:
2429  CFX_ByteStringL() : CFX_ByteStringC() {}
2430  ~CFX_ByteStringL() {}
2431 
2432  void Empty(IFX_Allocator* pAllocator);
2433 
2434  FX_LPSTR AllocBuffer(FX_STRSIZE length, IFX_Allocator* pAllocator);
2435 
2436  void Set(FX_BSTR src, IFX_Allocator* pAllocator);
2437 };
2438 
2439 //*****************************************************************************
2440 //* CFX_WideStringL - long term wide string
2441 //*****************************************************************************
2442 class CFX_WideStringL : public CFX_WideStringC
2443 {
2444  public:
2445  CFX_WideStringL() : CFX_WideStringC() {}
2446  ~CFX_WideStringL() {}
2447 
2448  void Empty(IFX_Allocator* pAllocator);
2449 
2450  void Set(FX_WSTR src, IFX_Allocator* pAllocator);
2451 
2452  int GetInteger() const;
2453  FX_FLOAT GetFloat() const;
2454 
2455  void TrimRight(FX_LPCWSTR lpszTargets);
2456 };
2457 
2458 void FX_UTF8Encode(FX_LPCWSTR pwsStr, FX_STRSIZE len, CFX_ByteStringL &utf8Str, IFX_Allocator* pAllocator = NULL);
2459 //<<<+++OPENSOURCE_END
2460 
2461 //<<<+++OPENSOURCE_MUST_BEGIN
2462 #endif // _FX_STRING_H_
2463 //<<<+++OPENSOURCE_MUST_END
2464 
2467 //<<<+++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:606
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:1167
FX_STRSIZE m_nAllocLength
Length of allocation.
Definition: fx_string.h:1450
FX_WCHAR GetAt(FX_STRSIZE nIndex) const
Retrieves a single wide character specified by an index number.
Definition: fx_string.h:1646
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:732
CFX_WideStringC()
Constructs a null constant string.
Definition: fx_string.h:1220
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:726
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:1405
CONSTANT WIDE STRING CLASS.
Definition: fx_string.h:1214
bool IsEmpty() const
Determines whether current string object is empty.
Definition: fx_string.h:1357
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:1375
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:1351
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:1390
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:1130
wchar_t const * FX_LPCWSTR
Pointer to constant Unicode characters.
Definition: fx_system.h:736
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:614
#define FXSYS_strlen
Get the length of a ANSIC string.
Definition: fx_system.h:879
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:1123
CFX_WideString(FX_LPCWSTR ptr, FX_STRSIZE len=-1)
Construct from a wide character string.
Definition: fx_string.h:1480
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:703
CFX_StringBufTemplate< 256 > CFX_StringBuf256
A fixed 256-byte string buffer.
Definition: fx_string.h:1204
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:1289
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...
bool operator !=(const CFX_WideStringC &str) const
Comparison(!=) operator overload. Case-sensitive.
Definition: fx_string.h:1335
WIDE STRING CLASS.
Definition: fx_string.h:1461
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:1270
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.
FX_STRSIZE FX_ftoa(FX_FLOAT f, FX_LPSTR buf, int precision=0)
Convert float to byte 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:1443
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:1452
FX_STRSIZE GetLength() const
Get number of characters, not bytes. Trailing zero not counted.
Definition: fx_string.h:1577
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:1467
A fixed string buffer holding up to certain number of characters.
Definition: fx_string.h:1102
int FX_INT32
32-bit signed integer.
Definition: fx_system.h:683
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:1187
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:1366
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:691
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:1246
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:705
#define FXSYS_wcslen
Get the length of a wide-character string.
Definition: fx_system.h:1028
const CFX_WideString & operator+=(FX_LPCWSTR str)
Concatenation(+=) operator overload. Concatenate a wide character string.
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:1173
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:1654
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:1200
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 FormatInteger64(FX_INT64 i)
Convert from Integer64.
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:1448
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:980
Foxit allocator interface.
Definition: fx_memory.h:997
Definition: fx_basic.h:956
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:701
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:685
CFX_StringBufBase(FX_STRSIZE limit)
A Constructor.
Definition: fx_string.h:1110
bool IsEmpty() const
Check whether current string object is empty.
Definition: fx_string.h:233
FX_BOOL FX_CreateUtf16SurrogatePairFromCodePoint(FX_DWORD unicode, FX_WCHAR &first, FX_WCHAR &second)
Creates UTF16 surrogate pair from a Unicode code point.
Definition: fx_string.h:2406
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.
bool operator !=(FX_LPCSTR str) const
Comparison(!=) operator overload. case-sensitive.
Definition: fx_string.h:486
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:1426
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:1233
bool operator==(const CFX_WideStringC &str) const
Comparison(==) operator overload. Case-sensitive.
Definition: fx_string.h:1324
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:1446
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:669
bool operator !=(const CFX_ByteStringC &str) const
Comparison(!=) operator overload. case-sensitive.
Definition: fx_string.h:183
FX_DWORD FX_CreateCodePointFromUtf16SurrogatePair(FX_WCHAR first, FX_WCHAR second)
Creates a Unicode code point from UTF16 surrogate pair.
Definition: fx_string.h:2384
FX_CHAR * GetPtr() const
Get a C-style string pointer to the string buffer.
Definition: fx_string.h:1117
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:734
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:792
FX_BOOL IsEmpty() const
Check whether current string object is empty.
Definition: fx_string.h:1570
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:2368
FX_LPCWSTR GetPtr() const
Get a constant wide string pointer to the wide string.
Definition: fx_string.h:1345
int FXWCHAR_GetDirection(FX_WCHAR wchar)
Get text direction.
CFX_StringBufTemplate()
A constructor.
Definition: fx_string.h:1193
CFX_WideStringC(FX_LPCWSTR ptr, FX_STRSIZE len)
Construct from a character string.
Definition: fx_string.h:1257
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:665
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:456
void Format(FX_LPCWSTR lpszFormat,...)
Format a number of parameters into this wide string.