Foxit PDF SDK
fx_string.h
浏览该文件的文档.
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 - 常量字节字符串
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  /* 常量字节字符串指针。 */
273  FX_LPCBYTE m_Ptr;
274  /* 字节字符串的字节长度。 */
275  FX_STRSIZE m_Length;
276 
277  private:
278  /*
279  * 禁止使用"new"运算符。不能在堆中分配CFX_ByteStringC。
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 - 字节串
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 
432  bool Equal(FX_BSTR str) const;
433 
443  bool EqualNoCase(FX_BSTR str) const;
444 
445 //<<<+++OPENSOURCE_MUST_BEGIN LIC==FOXIT
446 #ifndef _NO_LPCSTR_SUPPORT_
447 //<<<+++OPENSOURCE_MUST_END
455  bool operator == (FX_LPCSTR str) const { return Equal(str); }
456 //<<<+++OPENSOURCE_MUST_BEGIN LIC==FOXIT
457 #endif
458 //<<<+++OPENSOURCE_MUST_END
466  bool operator == (FX_BSTR str) const { return Equal(str); }
474  bool operator == (const CFX_ByteString& str) const;
475 //<<<+++OPENSOURCE_MUST_BEGIN LIC==FOXIT
476 #ifndef _NO_LPCSTR_SUPPORT_
477 //<<<+++OPENSOURCE_MUST_END
485  bool operator != (FX_LPCSTR str) const { return !Equal(str); }
486 //<<<+++OPENSOURCE_MUST_BEGIN LIC==FOXIT
487 #endif
488 //<<<+++OPENSOURCE_MUST_END
496  bool operator != (FX_BSTR str) const { return !Equal(str); }
504  bool operator != (const CFX_ByteString& str) const { return !operator==(str); }
505 
513  bool operator< (const CFX_ByteString& rhs) const;
514 
520  void Empty();
521 
537  const CFX_ByteString& operator = (FX_BSTR bstrc);
545  const CFX_ByteString& operator = (const CFX_ByteString& stringSrc);
553  const CFX_ByteString& operator = (const CFX_BinaryBuf& buf);
554 
563  void Load(FX_LPCBYTE str, FX_STRSIZE len);
564 
588  const CFX_ByteString& operator += (const CFX_ByteString& str);
596  const CFX_ByteString& operator += (FX_BSTR bstrc);
597 
605  FX_BYTE GetAt(FX_STRSIZE nIndex) const { return m_pData ? m_pData->m_String[nIndex] : 0; }
613  FX_BYTE operator[](FX_STRSIZE nIndex) const { return m_pData ? m_pData->m_String[nIndex] : 0; }
622  void SetAt(FX_STRSIZE nIndex, FX_CHAR ch);
623 
632  FX_STRSIZE Insert(FX_STRSIZE index, FX_CHAR ch);
633 
642  FX_STRSIZE Delete(FX_STRSIZE index, FX_STRSIZE count = 1);
659  void Format(FX_LPCSTR lpszFormat, ... );
670  void FormatV(FX_LPCSTR lpszFormat, va_list argList);
682  void Reserve(FX_STRSIZE len);
683 
695 
704 
715  void ReleaseBuffer(FX_STRSIZE len = -1);
716 
724  CFX_ByteString Mid(FX_STRSIZE first) const;
733  CFX_ByteString Mid(FX_STRSIZE first, FX_STRSIZE count) const;
741  CFX_ByteString Left(FX_STRSIZE count) const;
749  CFX_ByteString Right(FX_STRSIZE count) const;
758  FX_STRSIZE Find(FX_BSTR lpszSub, FX_STRSIZE start=0) const;
767  FX_STRSIZE Find(FX_CHAR ch, FX_STRSIZE start=0) const;
775  FX_STRSIZE ReverseFind(FX_CHAR ch) const;
776 
782  void MakeLower();
788  void MakeUpper();
789 
795  void TrimRight();
803  void TrimRight(FX_CHAR chTarget);
811  void TrimRight(FX_BSTR lpszTargets);
817  void TrimLeft();
825  void TrimLeft(FX_CHAR chTarget);
833  void TrimLeft(FX_BSTR lpszTargets);
834 
843  FX_STRSIZE Replace(FX_BSTR lpszOld, FX_BSTR lpszNew);
852 
858  CFX_WideString UTF8Decode() const;
859 
869  void ConvertFrom(const CFX_WideString& str, CFX_CharMap* pCharMap = NULL);
877  FX_DWORD GetID(FX_STRSIZE start_pos = 0) const;
885  static CFX_ByteString LoadFromFile(FX_BSTR file_path);
886 
888 #define FXFORMAT_SIGNED 1
889 
890 #define FXFORMAT_HEX 2
891 
892 #define FXFORMAT_CAPITAL 4
893 
909  static CFX_ByteString FormatInteger(FX_INT32 i, FX_DWORD flags = 0);
917  static CFX_ByteString FormatInteger64(FX_INT64 i);
918 
929  static CFX_ByteString FormatFloat(FX_FLOAT f, int precision = 0);
930 
931  protected:
932  /* 指向引用计数字节字符串数据的指针。 */
933  struct CFX_StringData* m_pData;
934 
935  void AllocCopy(CFX_ByteString& dest, FX_STRSIZE nCopyLen, FX_STRSIZE nCopyIndex, FX_STRSIZE nExtraLen) const;
936  void AssignCopy(FX_STRSIZE nSrcLen, FX_LPCSTR lpszSrcData);
937  void ConcatCopy(FX_STRSIZE nSrc1Len, FX_LPCSTR lpszSrc1Data, FX_STRSIZE nSrc2Len, FX_LPCSTR lpszSrc2Data);
938  void ConcatInPlace(FX_STRSIZE nSrcLen, FX_LPCSTR lpszSrcData);
939  void CopyBeforeWrite();
940  void AllocBeforeWrite(FX_STRSIZE nLen);
941 };
942 
944 {
945  m_Ptr = (FX_LPCBYTE)src;
946  m_Length = src.GetLength();
947 }
948 
950 {
951  m_Ptr = (FX_LPCBYTE)src;
952  m_Length = src.GetLength();
953  return *this;
954 }
955 
968 
977 inline CFX_ByteString operator + (FX_BSTR str1, FX_BSTR str2) { return CFX_ByteString(str1, str2); }
978 //<<<+++OPENSOURCE_MUST_BEGIN LIC==FOXIT
979 #ifndef _NO_LPCSTR_SUPPORT_
980 //<<<+++OPENSOURCE_MUST_END
989 inline CFX_ByteString operator + (FX_BSTR str1, FX_LPCSTR str2) { return CFX_ByteString(str1, str2); }
998 inline CFX_ByteString operator + (FX_LPCSTR str1,FX_BSTR str2) { return CFX_ByteString(str1, str2); }
999 //<<<+++OPENSOURCE_MUST_BEGIN LIC==FOXIT
1000 #endif
1001 //<<<+++OPENSOURCE_MUST_END
1020 
1029 inline CFX_ByteString operator + (const CFX_ByteString& str1, const CFX_ByteString& str2) { return CFX_ByteString(str1, str2); }
1038 inline CFX_ByteString operator + (const CFX_ByteString& str1, FX_CHAR ch) { return CFX_ByteString(str1, CFX_ByteStringC(ch)); }
1047 inline CFX_ByteString operator + (FX_CHAR ch, const CFX_ByteString& str2) { return CFX_ByteString(CFX_ByteStringC(ch), str2); }
1048 //<<<+++OPENSOURCE_MUST_BEGIN LIC==FOXIT
1049 #ifndef _NO_LPCSTR_SUPPORT_
1050 //<<<+++OPENSOURCE_MUST_END
1059 inline CFX_ByteString operator + (const CFX_ByteString& str1, FX_LPCSTR str2) { return CFX_ByteString(str1, str2); }
1068 inline CFX_ByteString operator + (FX_LPCSTR str1, const CFX_ByteString& str2) { return CFX_ByteString(str1, str2); }
1069 //<<<+++OPENSOURCE_MUST_BEGIN LIC==FOXIT
1070 #endif
1071 //<<<+++OPENSOURCE_MUST_END
1080 inline CFX_ByteString operator + (const CFX_ByteString& str1, FX_BSTR str2) { return CFX_ByteString(str1, str2); }
1089 inline CFX_ByteString operator + (FX_BSTR str1, const CFX_ByteString& str2) { return CFX_ByteString(str1, str2); }
1090 
1099 class CFX_StringBufBase : public CFX_Object
1100 {
1101  public:
1107  explicit CFX_StringBufBase(FX_STRSIZE limit) { m_Size = 0; m_Limit = limit; }
1108 
1114  FX_CHAR* GetPtr() const { return (FX_CHAR*)(this + 1); }
1120  FX_STRSIZE GetSize() const { return m_Size; }
1121 
1127  void Empty() { m_Size = 0; }
1128 
1136  void Copy(FX_BSTR str);
1137 
1145  void Append(FX_BSTR str);
1146 
1157  void Append(int i, FX_DWORD flags = 0);
1158 
1164  CFX_ByteStringC GetStringC() const { return CFX_ByteStringC((FX_CHAR*)(this + 1), m_Size); }
1170  CFX_ByteString GetString() const { return CFX_ByteString((FX_CHAR*)(this + 1), m_Size); }
1171 
1172  protected:
1173  /* 缓冲区限制。 */
1174  FX_STRSIZE m_Limit;
1175  /* 字符串大小。 */
1176  FX_STRSIZE m_Size;
1177 };
1178 
1182 template<FX_STRSIZE limit>
1184 {
1185  public:
1190 
1197 };
1198 
1201 
1202 //*****************************************************************************
1203 //* CFX_WideStringC - 常量宽字符串
1204 //*****************************************************************************
1210 class CFX_WideStringC : public CFX_Object
1211 {
1212  public:
1217  {
1218  m_Ptr = NULL;
1219  m_Length = 0;
1220  }
1221 //<<<+++OPENSOURCE_MUST_BEGIN LIC==FOXIT
1222 #ifndef _NO_LPCSTR_SUPPORT_
1223 //<<<+++OPENSOURCE_MUST_END
1230  {
1231  m_Ptr = ptr;
1232  m_Length = ptr ? (FX_STRSIZE)FXSYS_wcslen(ptr) : 0;
1233  }
1234 //<<<+++OPENSOURCE_MUST_BEGIN LIC==FOXIT
1235 #endif
1236 //<<<+++OPENSOURCE_MUST_END
1243  {
1244  m_Ptr = &ch;
1245  m_Length = 1;
1246  }
1254  {
1255  m_Ptr = ptr;
1256  if (len == -1)
1257  m_Length = (FX_STRSIZE)FXSYS_wcslen(ptr);
1258  else
1259  m_Length = len;
1260  }
1267  {
1268  m_Ptr = src.m_Ptr;
1269  m_Length = src.m_Length;
1270  }
1276  CFX_WideStringC(const CFX_WideString& src);
1277 
1286  {
1287  m_Ptr = src;
1288  m_Length = (FX_STRSIZE)FXSYS_wcslen(src);
1289  return *this;
1290  }
1299  {
1300  m_Ptr = src.m_Ptr;
1301  m_Length = src.m_Length;
1302  return *this;
1303  }
1312 
1320  bool operator == (const CFX_WideStringC& str) const
1321  {
1322  return str.m_Length == m_Length && FXSYS_memcmp32(str.m_Ptr, m_Ptr, m_Length*sizeof(FX_WCHAR)) == 0;
1323  }
1331  bool operator != (const CFX_WideStringC& str) const
1332  {
1333  return str.m_Length != m_Length || FXSYS_memcmp32(str.m_Ptr, m_Ptr, m_Length*sizeof(FX_WCHAR)) != 0;
1334  }
1335 
1341  FX_LPCWSTR GetPtr() const { return m_Ptr; }
1347  FX_STRSIZE GetLength() const { return m_Length; }
1353  bool IsEmpty() const { return m_Length == 0; }
1354 
1362  FX_WCHAR GetAt(FX_STRSIZE index) const { return m_Ptr[index]; }
1363 
1372  {
1373  if (count < 1) return CFX_WideStringC();
1374  if (count > m_Length) count = m_Length;
1375  return CFX_WideStringC(m_Ptr, count);
1376  }
1377 
1386  CFX_WideStringC Mid(FX_STRSIZE index, FX_STRSIZE count = -1) const
1387  {
1388  if (index < 0) index = 0;
1389  if (index > m_Length) return CFX_WideStringC();
1390  if (count < 0 || count > m_Length - index) count = m_Length - index;
1391  return CFX_WideStringC(m_Ptr + index, count);
1392  }
1393 
1402  {
1403  if (count < 1) return CFX_WideStringC();
1404  if (count > m_Length) count = m_Length;
1405  return CFX_WideStringC(m_Ptr + m_Length - count, count);
1406  }
1407 
1408  protected:
1409  /* 常量字节字符串指针。 */
1410  FX_LPCWSTR m_Ptr;
1411  /* 字节字符串的字节长度。 */
1412  FX_STRSIZE m_Length;
1413 
1414  private:
1415  /*
1416  * 禁止new操作符。不能在堆中分配CFX_WideStringC。
1417  */
1418  void* operator new (size_t) throw() { return NULL; }
1419 };
1420 
1422 typedef const CFX_WideStringC& FX_WSTR;
1423 
1433 #define FX_WSTRC(wstr) CFX_WideStringC((FX_LPCWSTR)wstr, sizeof(wstr) / sizeof(FX_WCHAR) - 1)
1434 
1435 //*****************************************************************************
1436 //* CFX_WideString - 宽字符串
1437 //*****************************************************************************
1440 {
1442  long m_nRefs;
1449 };
1450 
1457 class CFX_WideString : public CFX_Object
1458 {
1459  public:
1463  CFX_WideString() { m_pData = NULL; }
1469  CFX_WideString(const CFX_WideString& str);
1476  CFX_WideString(FX_LPCWSTR ptr, FX_STRSIZE len = -1) { InitStr(ptr, len); }
1477 
1489  CFX_WideString(const CFX_WideStringC& str);
1496  CFX_WideString(const CFX_WideStringC& str1, const CFX_WideStringC& str2);
1500  ~CFX_WideString();
1501 
1511  static CFX_WideString FromLocal(const char* str, FX_STRSIZE len = -1);
1520  static CFX_WideString FromUTF8(const char* str, FX_STRSIZE len = -1);
1529  static CFX_WideString FromUTF16LE(const unsigned short* str, FX_STRSIZE len = -1);
1530 
1539  static CFX_WideString FromUTF16BE(const unsigned short* str, FX_STRSIZE len = -1);
1540 
1548  static FX_STRSIZE WStringLength(const unsigned short* str);
1549 
1553  operator FX_LPCWSTR() const { return m_pData ? m_pData->m_String : (FX_WCHAR*)L""; }
1554 
1560  void Empty();
1566  FX_BOOL IsEmpty() const { return !GetLength(); }
1567 
1573  FX_STRSIZE GetLength() const { return m_pData ? m_pData->m_nDataLength : 0; }
1574 
1583 
1591  const CFX_WideString& operator =(const CFX_WideString& stringSrc);
1599  const CFX_WideString& operator =(const CFX_WideStringC& stringSrc);
1600 
1609 
1625  const CFX_WideString& operator += (const CFX_WideString& str);
1633  const CFX_WideString& operator += (const CFX_WideStringC& str);
1634 
1642  FX_WCHAR GetAt(FX_STRSIZE nIndex) const { return m_pData ? m_pData->m_String[nIndex] : 0; }
1650  FX_WCHAR operator[](FX_STRSIZE nIndex) const { return m_pData ? m_pData->m_String[nIndex] : 0; }
1659  void SetAt(FX_STRSIZE nIndex, FX_WCHAR ch);
1660 
1672  int Compare(FX_LPCWSTR str) const;
1684  int Compare(const CFX_WideString& str) const;
1685 
1697  int CompareNoCase(FX_LPCWSTR str) const;
1698 
1708  bool Equal(const CFX_WideStringC& str) const;
1709 
1717  CFX_WideString Mid(FX_STRSIZE first) const;
1727  CFX_WideString Mid(FX_STRSIZE first, FX_STRSIZE count) const;
1735  CFX_WideString Left(FX_STRSIZE count) const;
1743  CFX_WideString Right(FX_STRSIZE count) const;
1744 
1753  FX_STRSIZE Insert(FX_STRSIZE index, FX_WCHAR ch);
1762  FX_STRSIZE Delete(FX_STRSIZE index, FX_STRSIZE count = 1);
1770  void Format(FX_LPCWSTR lpszFormat, ... );
1781  void FormatV(FX_LPCWSTR lpszFormat, va_list argList);
1787  void MakeLower();
1793  void MakeUpper();
1794 
1800  void TrimRight();
1808  void TrimRight(FX_WCHAR chTarget);
1816  void TrimRight(FX_LPCWSTR lpszTargets);
1817 
1823  void TrimLeft();
1831  void TrimLeft(FX_WCHAR chTarget);
1839  void TrimLeft(FX_LPCWSTR lpszTargets);
1840 
1850  void Reserve(FX_STRSIZE len);
1874  void ReleaseBuffer(FX_STRSIZE len = -1);
1875 
1881  int GetInteger() const;
1882 
1888  FX_FLOAT GetFloat() const;
1889 
1898  FX_STRSIZE Find(FX_LPCWSTR lpszSub, FX_STRSIZE start=0) const;
1907  FX_STRSIZE Find(FX_WCHAR ch, FX_STRSIZE start=0) const;
1908 
1917  FX_STRSIZE Replace(FX_LPCWSTR lpszOld, FX_LPCWSTR lpszNew);
1926 
1932  CFX_ByteString UTF8Encode() const;
1940  CFX_ByteString UTF16LE_Encode(FX_BOOL bTerminate = true) const;
1941 
1952  void ConvertFrom(const CFX_ByteString& str, CFX_CharMap* pCharMap = NULL);
1953 
1954  protected:
1955  void InitStr(FX_LPCWSTR ptr, int len);
1956 
1957  /* 指向引用计数宽字符串数据的指针。 */
1958  CFX_StringDataW* m_pData;
1959 
1960  void CopyBeforeWrite();
1961  void AllocBeforeWrite(FX_STRSIZE nLen);
1962 
1963  void ConcatInPlace(FX_STRSIZE nSrcLen, FX_LPCWSTR lpszSrcData);
1964  void ConcatCopy(FX_STRSIZE nSrc1Len, FX_LPCWSTR lpszSrc1Data, FX_STRSIZE nSrc2Len, FX_LPCWSTR lpszSrc2Data);
1965  void AssignCopy(FX_STRSIZE nSrcLen, FX_LPCWSTR lpszSrcData);
1966  void AllocCopy(CFX_WideString& dest, FX_STRSIZE nCopyLen, FX_STRSIZE nCopyIndex, FX_STRSIZE nExtraLen) const;
1967 };
1968 
1970 {
1971  m_Ptr = (FX_LPCWSTR)src;
1972  m_Length = src.GetLength();
1973 }
1974 
1976 {
1977  m_Ptr = (FX_LPCWSTR)src;
1978  m_Length = src.GetLength();
1979  return *this;
1980 }
1981 
1995 
2004 inline CFX_WideString operator + (const CFX_WideStringC& str1, const CFX_WideStringC& str2) { return CFX_WideString(str1, str2); }
2005 #ifndef _NO_LPCSTR_SUPPORT_
2006 
2014 inline CFX_WideString operator + (const CFX_WideStringC& str1, FX_LPCWSTR str2) { return CFX_WideString(str1, str2); }
2023 inline CFX_WideString operator + (FX_LPCWSTR str1,const CFX_WideStringC& str2) { return CFX_WideString(str1, str2); }
2024 #endif
2025 
2042 inline CFX_WideString operator + (FX_WCHAR ch, const CFX_WideStringC& str2) { return CFX_WideString(ch, str2); }
2043 
2052 inline CFX_WideString operator + (const CFX_WideString& str1, const CFX_WideString& str2) { return CFX_WideString(str1, str2); }
2061 inline CFX_WideString operator + (const CFX_WideString& str1, FX_WCHAR ch) { return CFX_WideString(str1, CFX_WideStringC(ch)); }
2070 inline CFX_WideString operator + (FX_WCHAR ch, const CFX_WideString& str2) { return CFX_WideString(ch, str2); }
2071 #ifndef _NO_LPCSTR_SUPPORT_
2072 
2080 inline CFX_WideString operator + (const CFX_WideString& str1, FX_LPCWSTR str2) { return CFX_WideString(str1, str2); }
2089 inline CFX_WideString operator + (FX_LPCWSTR str1, const CFX_WideString& str2) { return CFX_WideString(str1, str2); }
2090 #endif
2091 
2099 inline CFX_WideString operator + (const CFX_WideString& str1, const CFX_WideStringC& str2) { return CFX_WideString(str1, str2); }
2108 inline CFX_WideString operator + (const CFX_WideStringC& str1, const CFX_WideString& str2) { return CFX_WideString(str1, str2); }
2109 
2116 
2125 bool operator==(const CFX_WideString& s1, const CFX_WideString& s2);
2134 bool operator==(const CFX_WideString& s1, const CFX_WideStringC& s2);
2143 bool operator==(const CFX_WideStringC& s1, const CFX_WideString& s2);
2152 bool operator== (const CFX_WideString& s1, FX_LPCWSTR s2);
2161 bool operator==(FX_LPCWSTR s1, const CFX_WideString& s2);
2162 
2171 bool operator!=(const CFX_WideString& s1, const CFX_WideString& s2);
2180 bool operator!=(const CFX_WideString& s1, const CFX_WideStringC& s2);
2189 bool operator!=(const CFX_WideStringC& s1, const CFX_WideString& s2);
2198 bool operator!= (const CFX_WideString& s1, FX_LPCWSTR s2);
2207 bool operator!=(FX_LPCWSTR s1, const CFX_WideString& s2);
2208 
2217 bool operator< (const CFX_WideString& lhs, const CFX_WideString& rhs);
2218 
2229 FX_FLOAT FX_atof(FX_BSTR str);
2240 void FX_atonum(FX_BSTR str, FX_BOOL& bInteger, void* pData, int sizeOfData = 4);
2241 
2251 FX_STRSIZE FX_ftoa(FX_FLOAT f, FX_LPSTR buf, int precision = 0);
2252 
2296 #define FXWCHAR_LTR 0
2297 
2298 #define FXWCHAR_RTL 1
2299 
2300 #define FXWCHAR_UNKNOWN 2
2301 
2310 int FXWCHAR_GetDirection(FX_WCHAR wchar);
2312 //<<<+++OPENSOURCE_END
2313 
2318 
2336 {
2337  return FX_UTF8Encode(wsStr.GetPtr(), wsStr.GetLength());
2338 }
2347 {
2348  return FX_UTF8Encode((FX_LPCWSTR)wsStr, wsStr.GetLength());
2349 }
2350 
2364 {
2365  return ((first & 0xFC00) == 0xD800 && (second & 0xFC00) == 0xDC00);
2366 }
2367 
2380  FX_WCHAR second)
2381 {
2382  const FX_DWORD mask = (1 << 10) - 1;
2383  return (((first & mask) << 10) | (second & mask)) + 0x10000;
2384 }
2385 
2399  FX_WCHAR& first,
2400  FX_WCHAR& second)
2401 {
2402  // 0x10000 = 0xFFFF+1
2403  if (unicode < 0x10000 || unicode > 0x10FFFF)
2404  return false;
2405 
2406  /* 代理对第一位 = 高10位加上 D800 */
2407  first = (FX_WCHAR)(0xD800 - (0x10000 >> 10) + ((unicode) >> 10));
2408  /* 代理对第二位 = 低10位加上 DC00 */
2409  second = (FX_WCHAR)(0xDC00 + ((unicode)&0x3FF));
2410  return true;
2411 }
2412 
2415 //*****************************************************************************
2416 //* CFX_ByteStringL - 长期字节字符串
2417 //*****************************************************************************
2418 class CFX_ByteStringL : public CFX_ByteStringC
2419 {
2420  public:
2421  CFX_ByteStringL() : CFX_ByteStringC() {}
2422  ~CFX_ByteStringL() {}
2423 
2424  void Empty(IFX_Allocator* pAllocator);
2425 
2426  FX_LPSTR AllocBuffer(FX_STRSIZE length, IFX_Allocator* pAllocator);
2427 
2428  void Set(FX_BSTR src, IFX_Allocator* pAllocator);
2429 };
2430 
2431 //*****************************************************************************
2432 //* CFX_WideStringL - 长期宽字符串
2433 //*****************************************************************************
2434 class CFX_WideStringL : public CFX_WideStringC
2435 {
2436  public:
2437  CFX_WideStringL() : CFX_WideStringC() {}
2438  ~CFX_WideStringL() {}
2439 
2440  void Empty(IFX_Allocator* pAllocator);
2441  FX_LPWSTR AllocBuffer(FX_STRSIZE length, IFX_Allocator* pAllocator);
2442 
2443  void Set(FX_WSTR src, IFX_Allocator* pAllocator);
2444 
2445  int GetInteger() const;
2446  FX_FLOAT GetFloat() const;
2447 
2448  void TrimRight(FX_LPCWSTR lpszTargets);
2449 };
2450 
2451 void FX_UTF8Encode(FX_LPCWSTR pwsStr, FX_STRSIZE len, CFX_ByteStringL &utf8Str, IFX_Allocator* pAllocator = NULL);
2452 //<<<+++OPENSOURCE_END
2453 
2454 //<<<+++OPENSOURCE_MUST_BEGIN
2455 #endif // _FX_STRING_H_
2456 //<<<+++OPENSOURCE_MUST_END
2457 
2460 //<<<+++OPENSOURCE_END
bool operator<(const CFX_WideString &lhs, const CFX_WideString &rhs)
比较(<)操作符重载。区分大小写。
FX_BYTE GetAt(FX_STRSIZE nIndex) const
获取由索引号指定的单个字节。
Definition: fx_string.h:605
CFX_ByteStringC(FX_LPCBYTE ptr, FX_STRSIZE size)
从字节字符串构造。
Definition: fx_string.h:68
为更高效追加而设计的动态二进制缓冲区。
Definition: fx_basic.h:52
int CompareNoCase(FX_LPCWSTR str) const
将字符串与宽字符字符串进行比较。不区分大小写。
CFX_ByteStringC GetStringC() const
获取非缓冲字节字符串。
Definition: fx_string.h:1164
FX_STRSIZE m_nAllocLength
分配长度。
Definition: fx_string.h:1446
FX_WCHAR GetAt(FX_STRSIZE nIndex) const
检索由索引号指定的单个宽字符。
Definition: fx_string.h:1642
FX_STRSIZE Delete(FX_STRSIZE index, FX_STRSIZE count=1)
从指定位置开始删除一个或多个字符。
wchar_t FX_WCHAR
编译器相关的Unicode字符(Microsoft编译器为16位,gcc为32位)。
Definition: fx_system.h:732
CFX_WideStringC()
构造空的常量字符串。
Definition: fx_string.h:1216
FX_STRSIZE Insert(FX_STRSIZE index, FX_WCHAR ch)
在指定位置之前插入宽字符。
const CFX_ByteStringC & FX_BSTR
常量CFX_ByteStringC对象的引用。
Definition: fx_string.h:285
FX_FLOAT GetFloat() const
转换为其他数据类型。
static CFX_ByteString FromUnicode(FX_LPCWSTR ptr, FX_STRSIZE len=-1)
从Unicode字符串创建CFX_ByteString对象。从Unicode转换为系统多字节字符集。
void TrimRight()
从字节字符串的右侧修剪空白字符。
void ReleaseBuffer(FX_STRSIZE len=-1)
释放由函数CFX_WideString::GetBuffer或 CFX_WideString::LockBuffer获取的缓冲区,并设置修改后字符串的长度。
unsigned long FX_DWORD
32位无符号整数。
Definition: fx_system.h:726
CFX_WideStringC Right(FX_STRSIZE count) const
从此CFX_WideStringC对象中提取最后(最右边)count个宽字符作为子字符串。
Definition: fx_string.h:1401
常量宽字符串类
Definition: fx_string.h:1210
bool IsEmpty() const
判断当前字符串对象是否为空。
Definition: fx_string.h:1353
FX_CHAR m_String[1]
实际数据(实际上是可变大小的数组)。
Definition: fx_string.h:311
CFX_WideStringC Left(FX_STRSIZE count) const
从此CFX_WideStringC对象中提取第一个(最左边)count个宽字符作为子字符串。
Definition: fx_string.h:1371
long m_nRefs
引用计数。
Definition: fx_string.h:305
FX_STRSIZE Find(FX_LPCWSTR lpszSub, FX_STRSIZE start=0) const
从指定位置查找子字符串。只找到第一次出现。
FX_STRSIZE GetLength() const
获取字节字符串的长度。
Definition: fx_string.h:1347
FX_STRSIZE GetLength() const
获取字节字符串的长度。
Definition: fx_string.h:227
CFX_WideStringC Mid(FX_STRSIZE index, FX_STRSIZE count=-1) const
从此CFX_WideStringC对象中提取长度为count字节的子字符串,从位置index(基于零)开始。
Definition: fx_string.h:1386
CFX_ByteStringC(FX_LPCSTR ptr)
从字符字符串构造。
Definition: fx_string.h:81
FX_FLOAT FX_atof(FX_BSTR str)
将非缓冲字节字符串转换为浮点数。
CFX_ByteStringC(FX_LPCSTR ptr, FX_STRSIZE len)
从字符字符串构造。
Definition: fx_string.h:105
bool Equal(const CFX_WideStringC &str) const
检查当前字符串是否等于另一个字符串。
bool operator==(const CFX_ByteStringC &str) const
比较(==)运算符重载。区分大小写。
Definition: fx_string.h:172
FX_LPSTR LockBuffer()
锁定并获取当前字符串缓冲区,以便调用者可以修改返回的缓冲区。
void Empty()
将此字符串设置为空。
Definition: fx_string.h:1127
wchar_t const * FX_LPCWSTR
指向常量Unicode字符的指针。
Definition: fx_system.h:736
void TrimLeft()
从字节字符串的左侧修剪空白字符。
FX_STRSIZE Delete(FX_STRSIZE index, FX_STRSIZE count=1)
从指定位置开始删除一个或多个宽字符。
FX_BYTE operator[](FX_STRSIZE nIndex) const
下标([])运算符重载。它检索由nIndex中基于零的索引指定的单个字节。
Definition: fx_string.h:613
#define FXSYS_strlen
获取ANSIC字符串的长度。
Definition: fx_system.h:879
FX_LPWSTR GetBuffer(FX_STRSIZE len)
获取已分配指定数量字符的缓冲区。
FX_STRSIZE GetSize() const
获取字符串的长度。
Definition: fx_string.h:1120
CFX_WideString(FX_LPCWSTR ptr, FX_STRSIZE len=-1)
从宽字符字符串构造。
Definition: fx_string.h:1476
void Empty()
将此字符串设置为空。
FX_INT32 FXSYS_memcmp32(const void *buf1, const void *buf2, size_t size)
比较两个缓冲区中的数据。
char * FX_LPSTR
指向8位Windows (ANSI) 字符的指针。
Definition: fx_system.h:703
CFX_StringBufTemplate< 256 > CFX_StringBuf256
固定的256字节字符串缓冲区。
Definition: fx_string.h:1200
FX_LPSTR GetBuffer(FX_STRSIZE len)
获取分配了指定字节数的缓冲区。
void Load(FX_LPCBYTE str, FX_STRSIZE len)
从字节字符串加载。
FX_STRSIZE Remove(FX_WCHAR ch)
移除特定字符的所有出现。
CFX_ByteStringC(const CFX_ByteStringC &src)
复制构造函数
Definition: fx_string.h:118
CFX_WideStringC & operator=(FX_LPCWSTR src)
赋值(=)运算符重载。来自字符串。
Definition: fx_string.h:1285
void ConvertFrom(const CFX_WideString &str, CFX_CharMap *pCharMap=NULL)
使用指定的字符映射器将unicode数据加载到此字节字符串中。 如果未指定字符映射器,将使用系统默认映射器。
bool operator !=(const CFX_WideStringC &str) const
比较(!=)运算符重载。区分大小写。
Definition: fx_string.h:1331
宽字符串类
Definition: fx_string.h:1457
void Empty()
将此字符串设置为空。
void TrimLeft()
从宽字符串的左侧修剪空白字符。
CFX_WideStringC(const CFX_WideStringC &src)
复制构造函数
Definition: fx_string.h:1266
void MakeUpper()
将英文字母的大小写更改为大写。
static FX_STRSIZE WStringLength(const unsigned short *str)
字符串的长度。
FX_LPCBYTE GetPtr() const
获取指向字节字符串的常量字节字符串指针。
Definition: fx_string.h:215
FX_BOOL FXWCHAR_IsWordBreak(FX_WCHAR wchar)
检查Unicode是否可以断词。
FX_STRSIZE Replace(FX_LPCWSTR lpszOld, FX_LPCWSTR lpszNew)
用新的子字符串替换字符串中的所有模式。
FX_STRSIZE FX_ftoa(FX_FLOAT f, FX_LPSTR buf, int precision=0)
将浮点数转换为字节字符串。
static CFX_WideString FromUTF8(const char *str, FX_STRSIZE len=-1)
从UTF-8字符串(ASCII字符串兼容)创建宽字符串。
void TrimRight()
从宽字符串的右侧修剪空白字符。
此类表示宽字符串对象的数据。
Definition: fx_string.h:1439
FX_WCHAR FXWCHAR_GetUpper(FX_WCHAR wchar)
转换为大写字母。
FX_WCHAR FXWCHAR_GetLower(FX_WCHAR wchar)
转换为小写字母。
FX_WCHAR m_String[1]
实际数据(实际上是可变大小的数组)。
Definition: fx_string.h:1448
FX_STRSIZE GetLength() const
获取字符数,不是字节数。不计算尾随零。
Definition: fx_string.h:1573
FX_STRSIZE Remove(FX_CHAR ch)
删除特定字符的所有出现。
void Reserve(FX_STRSIZE len)
保留可以容纳指定字节数的缓冲区。
FX_BOOL FXWCHAR_IsSpace(FX_WCHAR wchar)
检查Unicode是否为空格。
CFX_WideString()
构造空的宽字符串。
Definition: fx_string.h:1463
固定字符串缓冲区,最多容纳特定数量的字符。
Definition: fx_string.h:1099
int FX_INT32
32位有符号整数。
Definition: fx_system.h:683
void * FXSYS_memset32(void *dst, FX_INT32 v, size_t size)
将缓冲区数据设置为指定值。
int FX_STRSIZE
字符串大小限制为 2^31-1。
Definition: fx_string.h:35
固定字符串缓冲区模板。
Definition: fx_string.h:1183
bool EqualNoCase(FX_BSTR str) const
检查当前字符串是否等于另一个字符串,不考虑大小写。
FX_STRSIZE m_nAllocLength
分配长度。
Definition: fx_string.h:309
const CFX_ByteString & operator+=(FX_CHAR ch)
连接(+=)运算符重载。连接单个字符。
FX_WCHAR GetAt(FX_STRSIZE index) const
检索由索引号指定的单个字节。
Definition: fx_string.h:1362
int Compare(FX_LPCWSTR str) const
将当前字符串与宽字符字符串进行比较。区分大小写。
CFX_ByteStringC()
构造一个空的常量字符串。
Definition: fx_string.h:57
int FX_BOOL
布尔变量(应为TRUE或FALSE)。
Definition: fx_system.h:691
int Compare(FX_BSTR str) const
将字符串与另一个字符串进行比较。区分大小写。
CFX_WideStringC(FX_WCHAR &ch)
从单个字符构造。
Definition: fx_string.h:1242
void Format(FX_LPCSTR lpszFormat,...)
将一些参数格式化到此字节字符串中。
char const * FX_LPCSTR
指向常量8位Windows (ANSI) 字符的指针。
Definition: fx_system.h:705
#define FXSYS_wcslen
获取宽字符字符串的长度。
Definition: fx_system.h:1028
const CFX_WideString & operator+=(FX_LPCWSTR str)
连接(+=)运算符重载。连接宽字符字符串。
CFX_ByteString UTF16LE_Encode(FX_BOOL bTerminate=true) const
进行UTF16LE编码。
static CFX_WideString FromLocal(const char *str, FX_STRSIZE len=-1)
从系统多字节字符集创建宽字符串。
CFX_ByteString Left(FX_STRSIZE count) const
从此CFX_ByteString对象中提取第一个(最左边)count个字节作为子字符串。
FX_DWORD GetID(FX_STRSIZE start_pos=0) const
获取字符串的DWORD标识符。有关详细信息,请参阅函数CFX_ByteStringC::GetID。
CFX_ByteString GetString() const
获取缓冲字节字符串。
Definition: fx_string.h:1170
void SetAt(FX_STRSIZE nIndex, FX_CHAR ch)
覆盖由索引号指定的单个字节。
FX_STRSIZE GetLength() const
获取字节字符串中的字节数(不计算任何可能的终止符)。
Definition: fx_string.h:402
FX_STRSIZE m_nDataLength
数据长度(不包括终止符)。
Definition: fx_string.h:307
FX_WCHAR operator[](FX_STRSIZE nIndex) const
下标([])运算符重载。它检索由nIndex中零基索引指定的宽字符。
Definition: fx_string.h:1650
此类表示字节字符串对象的数据。
Definition: fx_string.h:302
~CFX_WideString()
析构函数。
bool IsEmpty() const
检查当前字符串对象是否为空。
Definition: fx_string.h:409
FX_CHAR m_Buffer[limit]
固定字符串缓冲区。
Definition: fx_string.h:1196
CFX_ByteString UTF8Encode() const
进行UTF8编码。
void MakeLower()
将英文字母的大小写更改为小写。
CFX_ByteStringC Mid(FX_STRSIZE index, FX_STRSIZE count=-1) const
此方法从此CFX_ByteStringC对象中提取长度为count字节的子字符串, 从位置index(基于零)开始。
Definition: fx_string.h:263
static CFX_ByteString FormatInteger64(FX_INT64 i)
从Integer64转换。
static CFX_ByteString FormatFloat(FX_FLOAT f, int precision=0)
从浮点数转换。
FX_STRSIZE m_nDataLength
数据长度(不包括终止符)。
Definition: fx_string.h:1444
CFX_ByteString Mid(FX_STRSIZE first) const
从此CFX_ByteString对象中提取子字符串,从位置nFirst(基于零)开始到最后。
CFX_ByteString operator+(FX_BSTR str1, FX_BSTR str2)
连接非缓冲字节字符串和非缓冲字节字符串。
Definition: fx_string.h:977
Foxit分配器接口。
Definition: fx_memory.h:994
Definition: fx_basic.h:937
void ConvertFrom(const CFX_ByteString &str, CFX_CharMap *pCharMap=NULL)
使用指定的字符映射器将MBCS数据加载到此宽字符串中。
char FX_CHAR
8位Windows (ANSI) 字符。
Definition: fx_system.h:701
void FX_atonum(FX_BSTR str, FX_BOOL &bInteger, void *pData, int sizeOfData=4)
将非缓冲字节字符串转换为数字。
FX_LPCSTR GetCStr() const
获取指向字节字符串的常量字符字符串指针。
Definition: fx_string.h:221
float FX_FLOAT
32位浮点数。
Definition: fx_system.h:685
CFX_StringBufBase(FX_STRSIZE limit)
构造函数
Definition: fx_string.h:1107
bool IsEmpty() const
检查当前字符串对象是否为空。
Definition: fx_string.h:233
FX_BOOL FX_CreateUtf16SurrogatePairFromCodePoint(FX_DWORD unicode, FX_WCHAR &first, FX_WCHAR &second)
从Unicode代码点创建UTF16代理对。
Definition: fx_string.h:2398
FX_STRSIZE ReverseFind(FX_CHAR ch) const
从字符串末尾查找字符
bool operator<(const CFX_ByteString &rhs) const
比较(<)运算符重载。区分大小写。
void FormatV(FX_LPCSTR lpszFormat, va_list argList)
使用va_list将一些参数格式化到此字节字符串中。
CFX_ByteString FX_UTF8Encode(FX_LPCWSTR pwsStr, FX_STRSIZE len)
将宽字符串编码为UTF-8字符串。
void SetAt(FX_STRSIZE nIndex, FX_WCHAR ch)
覆写由索引号指定的单个宽字符。
void Append(FX_BSTR str)
追加非缓冲字节字符串。
bool operator !=(FX_LPCSTR str) const
比较(!=)运算符重载。区分大小写。
Definition: fx_string.h:485
CFX_ByteStringC & operator=(FX_LPCSTR src)
赋值(=)运算符重载。来自字符字符串。
Definition: fx_string.h:137
FX_BYTE GetAt(FX_STRSIZE index) const
此方法检索由索引号指定的单个字节。
Definition: fx_string.h:252
static CFX_ByteString LoadFromFile(FX_BSTR file_path)
加载文件的全部内容。
常量字节字符串类
Definition: fx_string.h:51
CFX_ByteString()
构造一个空的字节字符串。
Definition: fx_string.h:323
const CFX_WideStringC & FX_WSTR
常量CFX_WideStringC对象的引用的类型定义。
Definition: fx_string.h:1422
bool operator!=(const CFX_WideString &s1, const CFX_WideString &s2)
比较(!=)操作符重载。区分大小写。
FX_STRSIZE Replace(FX_BSTR lpszOld, FX_BSTR lpszNew)
将字符串中的所有模式替换为新的子字符串。
void Reserve(FX_STRSIZE len)
保留可容纳指定数量字符的缓冲区。
static CFX_ByteString FormatInteger(FX_INT32 i, FX_DWORD flags=0)
从整数转换。
CFX_WideStringC(FX_LPCWSTR ptr)
从字符串构造。
Definition: fx_string.h:1229
bool operator==(const CFX_WideStringC &str) const
比较(==)运算符重载。区分大小写。
Definition: fx_string.h:1320
FX_STRSIZE Find(FX_BSTR lpszSub, FX_STRSIZE start=0) const
从指定位置查找子字符串。仅找到第一次出现的位置。
CFX_ByteString Right(FX_STRSIZE count) const
从此CFX_ByteString对象中提取最后(最右边)count个字节作为子字符串。
long m_nRefs
引用计数。
Definition: fx_string.h:1442
CFX_WideString UTF8Decode() const
解码UTF-8 unicode字符串(假设此字节字符串是UTF-8编码的)。
static CFX_WideString FromUTF16BE(const unsigned short *str, FX_STRSIZE len=-1)
从UTF16BE编码字符串创建宽字符串。
void MakeUpper()
将英文字母的大小写更改为大写。
字节字符串类
Definition: fx_string.h:317
int GetInteger() const
转换为其他数据类型。
unsigned char const * FX_LPCBYTE
指向常量FX_BYTE的指针。
Definition: fx_system.h:669
bool operator !=(const CFX_ByteStringC &str) const
比较(!=)运算符重载。区分大小写。
Definition: fx_string.h:183
FX_DWORD FX_CreateCodePointFromUtf16SurrogatePair(FX_WCHAR first, FX_WCHAR second)
从UTF16代理对创建Unicode代码点。
Definition: fx_string.h:2379
FX_CHAR * GetPtr() const
获取指向字符串缓冲区的C风格字符串指针。
Definition: fx_string.h:1114
FX_LPWSTR LockBuffer()
锁定并获取当前字符串缓冲区,以便调用者可以修改返回的缓冲区。 调用者可以修改返回的缓冲区,并在修改完成后调用CFX_WideString::ReleaseBuffer。
static CFX_WideString FromUTF16LE(const unsigned short *str, FX_STRSIZE len=-1)
从UTF16LE编码字符串创建宽字符串。
wchar_t * FX_LPWSTR
指向Unicode字符的指针。
Definition: fx_system.h:734
CFX_WideString Right(FX_STRSIZE count) const
从此CFX_WideString对象中提取最后(最右边)count个宽字符作为子字符串。
void MakeLower()
将英文字母的大小写更改为小写。
#define NULL
空指针值。
Definition: fx_system.h:792
FX_BOOL IsEmpty() const
检查当前字符串对象是否为空。
Definition: fx_string.h:1566
bool Equal(FX_BSTR str) const
检查当前字符串是否等于另一个字符串。区分大小写。
CFX_WideString Left(FX_STRSIZE count) const
从此CFX_WideString对象中提取前(最左边)count个宽字符作为子字符串。
void Copy(FX_BSTR str)
从非缓冲字节字符串复制。
bool operator==(const CFX_WideString &s1, const CFX_WideString &s2)
比较(==)操作符重载。区分大小写。
void ReleaseBuffer(FX_STRSIZE len=-1)
释放由函数CFX_ByteString::GetBuffer或 CFX_ByteString::LockBuffer获取的缓冲区,并设置修改后字符串的长度。
const CFX_WideString & operator=(FX_LPCWSTR str)
赋值(=)运算符重载。来自宽字符字符串。
void FormatV(FX_LPCWSTR lpszFormat, va_list argList)
使用va_list将多个参数格式化到此宽字符串中。
FX_BOOL FX_IsUtf16SurrogatePair(FX_WCHAR first, FX_WCHAR second)
确定参数是否构成UTF-16代理对。
Definition: fx_string.h:2363
FX_LPCWSTR GetPtr() const
获取指向宽字符串的常量宽字符串指针。
Definition: fx_string.h:1341
int FXWCHAR_GetDirection(FX_WCHAR wchar)
获取文本方向。
CFX_StringBufTemplate()
构造函数。
Definition: fx_string.h:1189
CFX_WideStringC(FX_LPCWSTR ptr, FX_STRSIZE len)
从字符串构造。
Definition: fx_string.h:1253
CFX_ByteStringC(const FX_CHAR &ch)
从单个字符构造。
Definition: fx_string.h:94
FX_STRSIZE Insert(FX_STRSIZE index, FX_CHAR ch)
在指定位置之前插入字符。
const CFX_ByteString & operator=(FX_LPCSTR str)
赋值(=)运算符重载。来自字符字符串。
CFX_WideString Mid(FX_STRSIZE first) const
从此CFX_WideString对象中提取子字符串,从位置nFirst(零基)开始到结束。
unsigned char FX_BYTE
字节(8位)。
Definition: fx_system.h:665
FX_DWORD GetID(FX_STRSIZE start_pos=0) const
从特定位置获取字符串的DWORD标识符。
bool operator==(FX_LPCSTR str) const
比较(==)运算符重载。区分大小写。
Definition: fx_string.h:455
void Format(FX_LPCWSTR lpszFormat,...)
将多个参数格式化到此宽字符串中。