CFx SDK Documentation 2024 SP0
Loading...
Searching...
No Matches
FxString.h
Go to the documentation of this file.
1//
2// (C) Copyright 2005-2023 by Graebert GmbH.
3//
4// Permission to use, copy, modify, and distribute this software in
5// object code form for any purpose and without fee is hereby granted,
6// provided that the above copyright notice appears in all copies and
7// that both that copyright notice and the limited warranty and
8// restricted rights notice below appear in all supporting
9// documentation.
10//
11// GRAEBERT PROVIDES THIS PROGRAM "AS IS" AND WITH ALL FAULTS.
12// GRAEBERT SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTY OF
13// MERCHANTABILITY OR FITNESS FOR A PARTICULAR USE. GRAEBERT GMBH
14// DOES NOT WARRANT THAT THE OPERATION OF THE PROGRAM WILL BE
15// UNINTERRUPTED OR ERROR FREE.
16
17#pragma once
18
19#include "FxPragmaPush.h"
20
21#include "DDKERNEL.h"
22
23#include <OdString.h>
24
25#include <vector>
26
27namespace Wt
28{
29 class WString;
30}
31
32class QString;
33
34class CFxString;
35typedef std::vector<CFxString> CFxStringArray;
36typedef std::string CFxAnsiStringClass;
37
38class CFxStringPrivate;
39
48 {
49public:
50
51 friend class CFxStringPrivate;
52
56
59 CFxString( const CFxString& stringSrc );
60
63 CFxString( const OdString& stringSrc );
64 CFxString( const OdString& stringSrc, unsigned int codePage );
65
68 CFxString( const QString& stringSrc );
69 CFxString( const QString& stringSrc, unsigned int codePage );
70
73 CFxString( const Wt::WString& stringSrc );
74 CFxString( const Wt::WString& stringSrc, unsigned int codePage );
75
78 CFxString( const OdAnsiString& stringSrc );
79 CFxString( const OdAnsiString& stringSrc, unsigned int codePage );
80
83 CFxString( char ch, int nRepeat );
84 CFxString( char ch, int nRepeat, unsigned int codePage );
85
88 // no default conversion from ASCII string.
89 //CFxString( const char* lpsz, unsigned int codePage = CP_ACP );
90
93 CFxString( OdChar ch, int nRepeat );
94 CFxString( OdChar ch, int nRepeat, unsigned int codePage );
95#if defined(_MSC_VER) && _MSC_VER >= 1300 && !defined(_WIN32_WCE)
96 CFxString( __wchar_t ch, int nRepeat );
97 CFxString( __wchar_t ch, int nRepeat, unsigned int codePage );
98#endif
99
102 CFxString( const OdChar* lpsz );
103 CFxString( const OdChar* lpsz, unsigned int codePage );
104#if defined(_MSC_VER) && _MSC_VER >= 1300 && !defined(_WIN32_WCE)
105 CFxString( const __wchar_t* lpsz);
106 CFxString( const __wchar_t* lpsz, unsigned int codePage );
107#endif
110
113 int getAllocLength() const;
114
117 int getLength() const;
118
125 bool isNull() const;
126
129 bool isEmpty() const;
130
133#ifndef SWIG
134 [[deprecated("please use clear instead!")]]
135#endif
136 void empty();
137
140 void clear();
141
144 char getAtA( int nIndex ) const;
145
148#if defined (_NATIVE_WCHAR_T_DEFINED)
149#define getAtW getAtWW
150#else
151#define getAtW getAtWU
152#endif
153#if defined(_MSC_VER) && _MSC_VER >= 1300 && !defined(_WIN32_WCE)
154 __wchar_t getAtWW( int nIndex ) const;
155#else
156#define getAtWW getAtWU
157#endif
158 OdChar getAtWU( int nIndex ) const;
159
162 void setAtA( int nIndex, char ch );
163
166#if defined(_MSC_VER) && _MSC_VER >= 1300 && !defined(_WIN32_WCE)
167 void setAtW( int nIndex, __wchar_t ch );
168#endif
169 void setAtW( int nIndex, OdChar ch );
170
173 const char* ansi_str() const;
174 static CFxString from_ansi_str(const char* data);
176
178 static CFxString from_utf8_str(const char* data);
180
181
184#if defined (_NATIVE_WCHAR_T_DEFINED)
185#define wide_str wide_strW
186#else
187#ifdef _MSC_VER
188#define wide_str wide_strU
189#else
190#define wide_str wide_strW
191#endif //_MSC_VER
192#endif
193#if defined(_MSC_VER) && _MSC_VER >= 1300 && !defined(_WIN32_WCE)
194 const __wchar_t* wide_strW() const;
195#else
196#define wide_strW wide_strU
197#endif
198 const OdChar* wide_strU() const;
199
203#if defined (_NATIVE_WCHAR_T_DEFINED)
204 inline operator LPCWSTR() const { return wide_strW();}
205#else
206 #ifdef _MSC_VER
207 inline operator LPCWSTR() const { return wide_strU();}
208 #else
209 inline operator const wchar_t *() const { return wide_strW();}
210 #endif //_MSC_VER
211#endif
212
215// operator const OdAnsiString&() const;
216
219 operator OdString() const;
220
223 operator const QString&() const;
224
227 operator const Wt::WString&() const;
228
231 const CFxString& operator=( const CFxString& stringSrc );
232
235 const CFxString& operator=( const OdAnsiString& stringSrc );
236
239 const CFxString& operator=( const OdString& stringSrc );
240
243 const CFxString& operator=( char ch );
244
247#if defined(_MSC_VER) && _MSC_VER >= 1300 && !defined(_WIN32_WCE)
248 const CFxString& operator=( __wchar_t ch );
249#endif
251
254 const CFxString& operator=( const char* lpsz );
255
258#if defined(_MSC_VER) && _MSC_VER >= 1300 && !defined(_WIN32_WCE)
259 const CFxString& operator=( const __wchar_t* lpsz );
260#endif
261 const CFxString& operator=( const OdChar* lpsz );
262
272 const CFxString& operator+=( const CFxString& stringSrc );
273
283 const CFxString& operator+=( char ch );
284
294#if defined(_MSC_VER) && _MSC_VER >= 1300 && !defined(_WIN32_WCE)
295 const CFxString& operator+=( __wchar_t ch );
296#endif
298
308 const CFxString& operator+=( const char* lpsz );
309
319#if defined(_MSC_VER) && _MSC_VER >= 1300 && !defined(_WIN32_WCE)
320 const CFxString& operator+=( const __wchar_t* lpsz );
321#endif
322 const CFxString& operator+=( const OdChar* lpsz );
323 const CFxString& operator+=( const OdString& str );
324
325 friend DDKERNEL_API CFxString operator+( const CFxString& string1, const CFxString& string2 );
326 friend DDKERNEL_API CFxString operator+( const CFxString& stringSrc, char ch );
327#if defined(_MSC_VER) && _MSC_VER >= 1300 && !defined(_WIN32_WCE)
328 friend DDKERNEL_API CFxString operator+( const CFxString& stringSrc, __wchar_t ch );
329#endif
330 friend DDKERNEL_API CFxString operator+( const CFxString& stringSrc, OdChar ch );
331
332 // no automatic conversion from ASCII
333 //friend DDKERNEL_API CFxString operator+( char ch, const CFxString& stringSrc );
334#if defined(_MSC_VER) && _MSC_VER >= 1300 && !defined(_WIN32_WCE)
335 friend DDKERNEL_API CFxString operator+( __wchar_t ch, const CFxString& stringSrc );
336#endif
337 friend DDKERNEL_API CFxString operator+( OdChar ch, const CFxString& stringSrc );
338 friend DDKERNEL_API CFxString operator+( const CFxString& stringSrc, const char* lpsz );
339#if defined(_MSC_VER) && _MSC_VER >= 1300 && !defined(_WIN32_WCE)
340 friend DDKERNEL_API CFxString operator+( const CFxString& stringSrc, const __wchar_t* lpsz );
341#endif
342 friend DDKERNEL_API CFxString operator+( const CFxString& stringSrc, const OdChar* lpsz );
343
344 // no automatic conversion from ASCII
345 //friend DDKERNEL_API CFxString operator+( const char* lpsz, const CFxString& stringSrc );
346#if defined(_MSC_VER) && _MSC_VER >= 1300 && !defined(_WIN32_WCE)
347 friend DDKERNEL_API CFxString operator+( const __wchar_t* lpsz, const CFxString& stringSrc );
348#endif
349 friend DDKERNEL_API CFxString operator+( const OdChar* lpsz, const CFxString& stringSrc );
350
355 int compareA( const char* lpsz ) const;
356
361#if defined(_MSC_VER) && _MSC_VER >= 1300 && !defined(_WIN32_WCE)
362 int compare( const __wchar_t* lpsz ) const;
363#endif
364 int compare( const OdChar* lpsz ) const;
365 int compare( const CFxString & lpsz ) const;
366
369 int compareNoCaseA( const char *lpsz ) const;
370
373#if defined(_MSC_VER) && _MSC_VER >= 1300 && !defined(_WIN32_WCE)
374 int compareNoCase( const __wchar_t *lpsz ) const;
375#endif
376 int compareNoCase( const OdChar *lpsz ) const;
377
380 int compareNoCase(const CFxString & stringSrc) const;
381
384 bool equalNoCase( const OdChar* lpsz ) const;
385#if defined(_MSC_VER) && _MSC_VER >= 1300 && !defined(_WIN32_WCE)
386 bool equalNoCase( const __wchar_t* lpsz ) const;
387#endif
388
391 bool equalNoCase(const CFxString & stringSrc) const;
392
393
396#if defined(_MSC_VER) && _MSC_VER >= 1300 && !defined(_WIN32_WCE)
397 bool startsWith(const __wchar_t * s) const;
398#endif
399 bool startsWith(const OdChar * s) const;
400 bool startsWith(const char *s) const;
401#if defined(_MSC_VER) && _MSC_VER >= 1300 && !defined(_WIN32_WCE)
402 bool startsWith(const __wchar_t &c) const;
403#endif
404 bool startsWith(const OdChar &c) const;
405 bool startsWith(const char &c) const;
406
409#if defined(_MSC_VER) && _MSC_VER >= 1300 && !defined(_WIN32_WCE)
410 bool startsWithNoCase(const __wchar_t * s) const;
411#endif
412 bool startsWithNoCase(const OdChar * s) const;
413 bool startsWithNoCase(const char *s) const;
414#if defined(_MSC_VER) && _MSC_VER >= 1300 && !defined(_WIN32_WCE)
415 bool startsWithNoCase(const __wchar_t &c) const;
416#endif
417 bool startsWithNoCase(const OdChar &c) const;
418 bool startsWithNoCase(const char &c) const;
419
422 CFxString mid( int nFirst, int nCount ) const;
423
426 CFxString mid( int nFirst ) const;
427
430 CFxString left( int nCount ) const;
431
434 CFxString right( int nCount ) const;
435
442 CFxString spanIncludingA(const char* lpszCharSet) const;
443
450#if defined(_MSC_VER) && _MSC_VER >= 1300 && !defined(_WIN32_WCE)
451 CFxString spanIncluding(const __wchar_t* lpszCharSet) const;
452#endif
453 CFxString spanIncluding(const OdChar* lpszCharSet) const;
454
461 CFxString spanExcludingA(const char* lpszCharSet) const;
462
469#if defined(_MSC_VER) && _MSC_VER >= 1300 && !defined(_WIN32_WCE)
470 CFxString spanExcluding(const __wchar_t* lpszCharSet) const;
471#endif
472 CFxString spanExcluding(const OdChar* lpszCharSet) const;
473
477
481
485
489
493
496 CFxString& trimRightA( char chTarget );
497
500#if defined(_MSC_VER) && _MSC_VER >= 1300 && !defined(_WIN32_WCE)
501 CFxString& trimRightW( __wchar_t chTarget );
502#endif
504
508 CFxString& trimRightA( const char* lpszTargets );
509
513#if defined(_MSC_VER) && _MSC_VER >= 1300 && !defined(_WIN32_WCE)
514 CFxString& trimRight( const __wchar_t* lpszTargets );
515#endif
516 CFxString& trimRight( const OdChar* lpszTargets );
517
520 CFxString& trimLeftA( char chTarget );
521
524#if defined(_MSC_VER) && _MSC_VER >= 1300 && !defined(_WIN32_WCE)
525 CFxString& trimLeftW( __wchar_t chTarget );
526#endif
528
532 CFxString& trimLeftA( const char* lpszTargets );
533
537#if defined(_MSC_VER) && _MSC_VER >= 1300 && !defined(_WIN32_WCE)
538 CFxString& trimLeft( const __wchar_t* lpszTargets );
539#endif
540 CFxString& trimLeft( const OdChar* lpszTargets );
541
548 CFxString& replaceA( char chOld, char chNew );
549
556#if defined(_MSC_VER) && _MSC_VER >= 1300 && !defined(_WIN32_WCE)
557 CFxString& replaceW( __wchar_t chOld, __wchar_t chNew );
558#endif
559 CFxString& replaceW( OdChar chOld, OdChar chNew );
560
570 CFxString& replaceA( const char* lpszOld, const char* lpszNew );
571
581#if defined(_MSC_VER) && _MSC_VER >= 1300 && !defined(_WIN32_WCE)
582 CFxString& replace( const __wchar_t* lpszOld, const __wchar_t* lpszNew );
583#endif
584 CFxString& replace( const OdChar* lpszOld, const OdChar* lpszNew );
585
592 int removeA( char chRemove );
593
600#if defined(_MSC_VER) && _MSC_VER >= 1300 && !defined(_WIN32_WCE)
601 int removeW( __wchar_t chRemove );
602#endif
603 int removeW( OdChar chRemove );
604
615 int insertA( int nIndex, char ch );
616
627#if defined(_MSC_VER) && _MSC_VER >= 1300 && !defined(_WIN32_WCE)
628 int insertW( int nIndex, __wchar_t ch );
629#endif
630 int insertW( int nIndex, OdChar ch );
631
642 int insertA( int nIndex, const char* pstr );
643
654#if defined(_MSC_VER) && _MSC_VER >= 1300 && !defined(_WIN32_WCE)
655 int insert( int nIndex, const __wchar_t* pstr );
656#endif
657 int insert( int nIndex, const OdChar* pstr );
658
665 int deleteChars( int nIndex, int nCount = 1 );
666
675 int findA( char ch ) const;
676
685#if defined(_MSC_VER) && _MSC_VER >= 1300 && !defined(_WIN32_WCE)
686 int findW( __wchar_t ch ) const;
687#endif
688 int findW( OdChar ch ) const;
689
698 int reverseFindA( char ch ) const;
699
708#if defined(_MSC_VER) && _MSC_VER >= 1300 && !defined(_WIN32_WCE)
709 int reverseFindW( __wchar_t ch ) const;
710#endif
711 int reverseFindW( OdChar ch ) const;
712
721 int findA( char ch, int nStart ) const;
722
731#if defined(_MSC_VER) && _MSC_VER >= 1300 && !defined(_WIN32_WCE)
732 int findW( __wchar_t ch, int nStart ) const;
733#endif
734 int findW( OdChar ch, int nStart ) const;
735
744 int findOneOfA( const char* lpszCharSet ) const;
745
754#if defined(_MSC_VER) && _MSC_VER >= 1300 && !defined(_WIN32_WCE)
755 int findOneOf( const __wchar_t* lpszCharSet ) const;
756#endif
757 int findOneOf( const OdChar* lpszCharSet ) const;
758
766 int find( const CFxString& ) const;
767
775 int findA( const char* lpszSub ) const;
776
784#if defined(_MSC_VER) && _MSC_VER >= 1300 && !defined(_WIN32_WCE)
785 int find( const __wchar_t* lpszSub ) const;
786#endif
787 int find( const OdChar* lpszSub ) const;
788
798 int findA( const char* lpszSub, int nStart ) const;
799
809#if defined(_MSC_VER) && _MSC_VER >= 1300 && !defined(_WIN32_WCE)
810 int find( const __wchar_t* lpszSub, int nStart ) const;
811#endif
812 int find( const OdChar* lpszSub, int nStart ) const;
813
817 CFxString& format( const OdChar* lpszFormat, ... );
818#if defined(_MSC_VER) && _MSC_VER >= 1300 && !defined(_WIN32_WCE)
819 CFxString& format( const __wchar_t* lpszFormat, ... );
820#endif
821 // the next version does not work. Causes problems with va_start
822 //CFxString& format( const CFxString & lpszFormat, ... );
823
827#if defined(_MSC_VER)
828 CFxString& formatA( LPCSTR lpszFormat, ... );
829#else
830 CFxString& formatA( const char * lpszFormat, ... );
831#endif
832
836 CFxString& format( const OdChar* lpszFormat, const OdString& str );
837#if defined(_MSC_VER) && _MSC_VER >= 1300 && !defined(_WIN32_WCE)
838 CFxString& format( const __wchar_t* lpszFormat, const OdString& str );
839#endif
843 CFxString& vformatA( const char* lpszFormat, va_list argList ); /* va_list is not portable. */
844
848#if defined(_MSC_VER) && _MSC_VER >= 1300 && !defined(_WIN32_WCE)
849 CFxString& vformat( const __wchar_t* lpszFormat, va_list argList ); /* va_list is not portable. */
850#endif
851 CFxString& vformat( const OdChar* lpszFormat, va_list argList ); /* va_list is not portable. */
852
855 unsigned int GetCodePage() const;
856
859 void SetCodePage( unsigned int codePage );
860
863 CFxStringArray SplitA(char separator) const;
864
867#if defined(_MSC_VER) && _MSC_VER >= 1300 && !defined(_WIN32_WCE)
868 CFxStringArray SplitW(__wchar_t separator) const;
869#endif
870 CFxStringArray SplitW(OdChar separator) const;
871
872 OdCodePageId GetCadCodePage( unsigned int codePage ) const;
873
876
877 CFxString arg(long long a, int fieldwidth = 0, int base=10, unsigned short fillChar = ' ') const;
878 CFxString arg(unsigned long long a, int fieldwidth = 0, int base=10, unsigned short fillChar = ' ') const;
879 CFxString arg(long a, int fieldwidth = 0, int base=10, unsigned short fillChar = ' ') const;
880 CFxString arg(unsigned long a, int fieldwidth = 0, int base=10, unsigned short fillChar = ' ') const;
881 CFxString arg(int a, int fieldWidth = 0, int base = 10, unsigned short fillChar = ' ') const;
882 CFxString arg(unsigned int a, int fieldWidth = 0, int base = 10, unsigned short fillChar = ' ') const;
883 CFxString arg(short a, int fieldWidth = 0, int base = 10, unsigned short fillChar = ' ') const;
884 CFxString arg(unsigned short a, int fieldWidth = 0, int base = 10, unsigned short fillChar = ' ') const;
885 CFxString arg(double a, int fieldWidth = 0, char fmt = 'g', int prec = -1, unsigned short fillChar = ' ') const;
886 CFxString arg(char a, int fieldWidth = 0, unsigned short fillChar = ' ') const;
887#if defined(_MSC_VER) && _MSC_VER >= 1300 && !defined(_WIN32_WCE)
888 CFxString arg(__wchar_t a, int fieldWidth = 0, unsigned short fillChar = ' ') const;
889#endif
890 CFxString arg(const CFxString &a, int fieldWidth = 0, unsigned short fillChar = ' ') const;
891 CFxString arg(const CFxString &a1, const CFxString &a2) const;
892 CFxString arg(const CFxString &a1, const CFxString &a2, const CFxString &a3) const;
893 CFxString arg(const CFxString &a1, const CFxString &a2, const CFxString &a3,
894 const CFxString &a4) const;
895 CFxString arg(const CFxString &a1, const CFxString &a2, const CFxString &a3,
896 const CFxString &a4, const CFxString &a5) const;
897 CFxString arg(const CFxString &a1, const CFxString &a2, const CFxString &a3,
898 const CFxString &a4, const CFxString &a5, const CFxString &a6) const;
899 CFxString arg(const CFxString &a1, const CFxString &a2, const CFxString &a3,
900 const CFxString &a4, const CFxString &a5, const CFxString &a6,
901 const CFxString &a7) const;
902 CFxString arg(const CFxString &a1, const CFxString &a2, const CFxString &a3,
903 const CFxString &a4, const CFxString &a5, const CFxString &a6,
904 const CFxString &a7, const CFxString &a8) const;
905 CFxString arg(const CFxString &a1, const CFxString &a2, const CFxString &a3,
906 const CFxString &a4, const CFxString &a5, const CFxString &a6,
907 const CFxString &a7, const CFxString &a8, const CFxString &a9) const;
908 CFxString multiArg(int numArgs, const CFxString **args) const;
909
910protected:
913 CFxString( const char* lpch, int nLength );
914 CFxString( const char* lpch, int nLength, unsigned int codePage );
915
918#if defined(_MSC_VER) && _MSC_VER >= 1300 && !defined(_WIN32_WCE)
919 CFxString( const __wchar_t* lpch, int nLength );
920 CFxString( const __wchar_t* lpch, int nLength, unsigned int codePage );
921#endif
922 CFxString( const OdChar* lpch, int nLength );
923 CFxString( const OdChar* lpch, int nLength, unsigned int codePage );
924
927 mutable CFxStringPrivate * m_private;
928};
929
930inline bool operator==( const CFxString& s1, const QString& s2 )
931{
932 return( s1.compare( s2 ) == 0 );
933}
934
935inline bool operator==( const CFxString& s1, const CFxString& s2 )
936{ return( s1.compare(s2) == 0 ); }
937
938inline bool operator==(const CFxString& s1, const char* s2)
939{ return s1.compareA(s2) == 0; }
940
941#if defined(_MSC_VER) && _MSC_VER >= 1300 && !defined(_WIN32_WCE)
942inline bool operator==(const CFxString& s1, const __wchar_t* s2)
943{ return s1.compare(s2) == 0; }
944#endif
945
946inline bool operator==(const CFxString& s1, const OdChar* s2)
947{ return s1.compare(s2) == 0; }
948
949/*
950inline bool operator==(const CFxString& s1, const QString& s2)
951{ return s1.compare((const OdChar*)(s2.utf16())) == 0; }
952*/
953inline bool operator==(const char* s1, const CFxString& s2)
954{ return s2.compareA(s1) == 0; }
955
956#if defined(_MSC_VER) && _MSC_VER >= 1300 && !defined(_WIN32_WCE)
957inline bool operator==(const __wchar_t* s1, const CFxString& s2)
958{ return s2.compare(s1) == 0; }
959#endif
960
961inline bool operator==(const OdChar* s1, const CFxString& s2)
962{ return s2.compare(s1) == 0; }
963
964inline bool operator!=( const CFxString& s1, const QString& s2 )
965{
966 return s1.compare( s2 ) != 0;
967}
968
969inline bool operator!=(const CFxString& s1, const CFxString& s2)
970{ return s1.compare(s2) != 0; }
971
972inline bool operator!=(const CFxString& s1, const char* s2)
973{ return s1.compareA(s2) != 0; }
974
975#if defined(_MSC_VER) && _MSC_VER >= 1300 && !defined(_WIN32_WCE)
976inline bool operator!=(const CFxString& s1, const __wchar_t* s2)
977{ return s1.compare(s2) != 0; }
978#endif
979
980inline bool operator!=(const CFxString& s1, const OdChar* s2)
981{ return s1.compare(s2) != 0; }
982
983inline bool operator!=(const char* s1, const CFxString& s2)
984{ return s2.compareA(s1) != 0; }
985
986#if defined(_MSC_VER) && _MSC_VER >= 1300 && !defined(_WIN32_WCE)
987inline bool operator!=(const __wchar_t* s1, const CFxString& s2)
988{ return s2.compare(s1) != 0; }
989#endif
990
991inline bool operator!=(const OdChar* s1, const CFxString& s2)
992{ return s2.compare(s1) != 0; }
993
994inline bool operator<(const CFxString& s1, const CFxString& s2)
995{ return s1.compare(s2) < 0; }
996
997inline bool operator<(const CFxString& s1, const char* s2)
998{ return s1.compareA(s2) < 0; }
999
1000#if defined(_MSC_VER) && _MSC_VER >= 1300 && !defined(_WIN32_WCE)
1001inline bool operator<(const CFxString& s1, const __wchar_t* s2)
1002{ return s1.compare(s2) < 0; }
1003#endif
1004
1005inline bool operator<(const CFxString& s1, const OdChar* s2)
1006{ return s1.compare(s2) < 0; }
1007
1008inline bool operator<(const char* s1, const CFxString& s2)
1009{ return s2.compareA(s1) > 0; }
1010
1011#if defined(_MSC_VER) && _MSC_VER >= 1300 && !defined(_WIN32_WCE)
1012inline bool operator<(const __wchar_t* s1, const CFxString& s2)
1013{ return s2.compare(s1) > 0; }
1014#endif
1015
1016inline bool operator<(const OdChar* s1, const CFxString& s2)
1017{ return s2.compare(s1) > 0; }
1018
1019inline bool operator>(const CFxString& s1, const CFxString& s2)
1020{ return s1.compare(s2) > 0; }
1021
1022inline bool operator>(const CFxString& s1, const char* s2)
1023{ return s1.compareA(s2) > 0; }
1024
1025#if defined(_MSC_VER) && _MSC_VER >= 1300 && !defined(_WIN32_WCE)
1026inline bool operator>(const CFxString& s1, const __wchar_t* s2)
1027{ return s1.compare(s2) > 0; }
1028#endif
1029
1030inline bool operator>(const CFxString& s1, const OdChar* s2)
1031{ return s1.compare(s2) > 0; }
1032
1033inline bool operator>(const char* s1, const CFxString& s2)
1034{ return s2.compareA(s1) < 0; }
1035
1036#if defined(_MSC_VER) && _MSC_VER >= 1300 && !defined(_WIN32_WCE)
1037inline bool operator>(const __wchar_t* s1, const CFxString& s2)
1038{ return s2.compare(s1) < 0; }
1039#endif
1040
1041inline bool operator>(const OdChar* s1, const CFxString& s2)
1042{ return s2.compare(s1) < 0; }
1043
1044inline bool operator<=(const CFxString& s1, const CFxString& s2)
1045{ return s1.compare(s2) <= 0; }
1046
1047inline bool operator<=(const CFxString& s1, const char* s2)
1048{ return s1.compareA(s2) <= 0; }
1049
1050#if defined(_MSC_VER) && _MSC_VER >= 1300 && !defined(_WIN32_WCE)
1051inline bool operator<=(const CFxString& s1, const __wchar_t* s2)
1052{ return s1.compare(s2) <= 0; }
1053#endif
1054
1055inline bool operator<=(const CFxString& s1, const OdChar* s2)
1056{ return s1.compare(s2) <= 0; }
1057
1058inline bool operator<=(const char* s1, const CFxString& s2)
1059{ return s2.compareA(s1) >= 0; }
1060
1061#if defined(_MSC_VER) && _MSC_VER >= 1300 && !defined(_WIN32_WCE)
1062inline bool operator<=(const __wchar_t* s1, const CFxString& s2)
1063{ return s2.compare(s1) >= 0; }
1064#endif
1065
1066inline bool operator<=(const OdChar* s1, const CFxString& s2)
1067{ return s2.compare(s1) >= 0; }
1068
1069inline bool operator>=(const CFxString& s1, const CFxString& s2)
1070{ return s1.compare(s2) >= 0; }
1071
1072inline bool operator>=(const CFxString& s1, const char* s2)
1073{ return s1.compareA(s2) >= 0; }
1074
1075#if defined(_MSC_VER) && _MSC_VER >= 1300 && !defined(_WIN32_WCE)
1076inline bool operator>=(const CFxString& s1, const __wchar_t* s2)
1077{ return s1.compare(s2) >= 0; }
1078#endif
1079
1080inline bool operator>=(const CFxString& s1, const OdChar* s2)
1081{ return s1.compare(s2) >= 0; }
1082
1083inline bool operator>=(const char* s1, const CFxString& s2)
1084{ return s2.compareA(s1) <= 0; }
1085
1086#if defined(_MSC_VER) && _MSC_VER >= 1300 && !defined(_WIN32_WCE)
1087inline bool operator>=(const __wchar_t* s1, const CFxString& s2)
1088{ return s2.compare(s1) <= 0; }
1089#endif
1090
1091inline bool operator>=(const OdChar* s1, const CFxString& s2)
1092{ return s2.compare(s1) <= 0; }
1093
1094inline CFxString CFxString::arg(int a, int fieldWidth, int base, unsigned short fillChar) const
1095{ return arg((long long)(a), fieldWidth, base, fillChar); }
1096inline CFxString CFxString::arg(unsigned int a, int fieldWidth, int base, unsigned short fillChar ) const
1097{ return arg((unsigned long long)(a), fieldWidth, base, fillChar); }
1098inline CFxString CFxString::arg(long a, int fieldWidth, int base, unsigned short fillChar ) const
1099{ return arg((long long)(a), fieldWidth, base, fillChar); }
1100inline CFxString CFxString::arg(unsigned long a, int fieldWidth, int base, unsigned short fillChar ) const
1101{ return arg((unsigned long long)(a), fieldWidth, base, fillChar); }
1102inline CFxString CFxString::arg(short a, int fieldWidth, int base, unsigned short fillChar ) const
1103{ return arg((long long)(a), fieldWidth, base, fillChar); }
1104inline CFxString CFxString::arg(unsigned short a, int fieldWidth, int base, unsigned short fillChar ) const
1105{ return arg((unsigned long long)(a), fieldWidth, base, fillChar); }
1106inline CFxString CFxString::arg(const CFxString &a1, const CFxString &a2) const
1107{ const CFxString *args[2] = { &a1, &a2 }; return multiArg(2, args); }
1108inline CFxString CFxString::arg(const CFxString &a1, const CFxString &a2, const CFxString &a3) const
1109{ const CFxString *args[3] = { &a1, &a2, &a3 }; return multiArg(3, args); }
1110inline CFxString CFxString::arg(const CFxString &a1, const CFxString &a2, const CFxString &a3,
1111 const CFxString &a4) const
1112{ const CFxString *args[4] = { &a1, &a2, &a3, &a4 }; return multiArg(4, args); }
1113inline CFxString CFxString::arg(const CFxString &a1, const CFxString &a2, const CFxString &a3,
1114 const CFxString &a4, const CFxString &a5) const
1115{ const CFxString *args[5] = { &a1, &a2, &a3, &a4, &a5 }; return multiArg(5, args); }
1116inline CFxString CFxString::arg(const CFxString &a1, const CFxString &a2, const CFxString &a3,
1117 const CFxString &a4, const CFxString &a5, const CFxString &a6) const
1118{ const CFxString *args[6] = { &a1, &a2, &a3, &a4, &a5, &a6 }; return multiArg(6, args); }
1119inline CFxString CFxString::arg(const CFxString &a1, const CFxString &a2, const CFxString &a3,
1120 const CFxString &a4, const CFxString &a5, const CFxString &a6,
1121 const CFxString &a7) const
1122{ const CFxString *args[7] = { &a1, &a2, &a3, &a4, &a5, &a6, &a7 }; return multiArg(7, args); }
1123inline CFxString CFxString::arg(const CFxString &a1, const CFxString &a2, const CFxString &a3,
1124 const CFxString &a4, const CFxString &a5, const CFxString &a6,
1125 const CFxString &a7, const CFxString &a8) const
1126{ const CFxString *args[8] = { &a1, &a2, &a3, &a4, &a5, &a6, &a7, &a8 }; return multiArg(8, args); }
1127inline CFxString CFxString::arg(const CFxString &a1, const CFxString &a2, const CFxString &a3,
1128 const CFxString &a4, const CFxString &a5, const CFxString &a6,
1129 const CFxString &a7, const CFxString &a8, const CFxString &a9) const
1130{ const CFxString *args[9] = { &a1, &a2, &a3, &a4, &a5, &a6, &a7, &a8, &a9 }; return multiArg(9, args); }
1131//
1132
1133
1134#include "FxPragmaPop.h"
#define DDKERNEL_API
Definition: DDKERNEL.h:32
bool operator!=(const CFxString &s1, const QString &s2)
Definition: FxString.h:964
std::string CFxAnsiStringClass
Definition: FxString.h:36
bool operator<=(const CFxString &s1, const CFxString &s2)
Definition: FxString.h:1044
bool operator<(const CFxString &s1, const CFxString &s2)
Definition: FxString.h:994
#define getAtWW
Definition: FxString.h:156
std::vector< CFxString > CFxStringArray
Definition: FxString.h:35
bool operator>=(const CFxString &s1, const CFxString &s2)
Definition: FxString.h:1069
#define wide_strW
Definition: FxString.h:196
bool operator>(const CFxString &s1, const CFxString &s2)
Definition: FxString.h:1019
bool operator==(const CFxString &s1, const QString &s2)
Definition: FxString.h:930
OdCodePageId
Definition: OdCodePage.h:31
wchar_t OdChar
CFxString spanExcluding(const OdChar *lpszCharSet) const
CFxStringPrivate * m_private
Definition: FxString.h:927
bool startsWith(const OdChar &c) const
friend DDKERNEL_API CFxString operator+(const CFxString &stringSrc, OdChar ch)
CFxString left(int nCount) const
CFxString & trimRightW(OdChar chTarget)
CFxString & vformat(const OdChar *lpszFormat, va_list argList)
CFxString & trimRightA(const char *lpszTargets)
int find(const OdChar *lpszSub) const
int findW(OdChar ch) const
int reverseFindW(OdChar ch) const
friend DDKERNEL_API CFxString operator+(const CFxString &string1, const CFxString &string2)
friend DDKERNEL_API CFxString operator+(const CFxString &stringSrc, const OdChar *lpsz)
bool startsWithNoCase(const char *s) const
CFxString spanIncludingA(const char *lpszCharSet) const
bool startsWith(const char &c) const
const CFxString & operator=(const OdString &stringSrc)
CFxString(const OdAnsiString &stringSrc)
CFxString & trimLeftA(const char *lpszTargets)
CFxString(const OdChar *lpch, int nLength, unsigned int codePage)
bool EncodeHTML()
const CFxString & operator+=(const CFxString &stringSrc)
const CFxString & operator=(const char *lpsz)
CFxString arg(const CFxString &a, int fieldWidth=0, unsigned short fillChar=' ') const
CFxString(const char *lpch, int nLength, unsigned int codePage)
CFxString spanIncluding(const OdChar *lpszCharSet) const
const CFxString & operator=(const CFxString &stringSrc)
CFxString & replaceA(const char *lpszOld, const char *lpszNew)
int compareA(const char *lpsz) const
unsigned int GetCodePage() const
CFxString arg(char a, int fieldWidth=0, unsigned short fillChar=' ') const
const CFxString & operator=(char ch)
int findA(const char *lpszSub, int nStart) const
int removeW(OdChar chRemove)
CFxString spanExcludingA(const char *lpszCharSet) const
int insertA(int nIndex, char ch)
CFxString arg(long long a, int fieldwidth=0, int base=10, unsigned short fillChar=' ') const
static CFxString from_ansi_str(const CFxAnsiStringClass &data)
bool isNull() const
const CFxString & operator+=(char ch)
friend DDKERNEL_API CFxString operator+(OdChar ch, const CFxString &stringSrc)
int deleteChars(int nIndex, int nCount=1)
OdCodePageId GetCadCodePage(unsigned int codePage) const
int reverseFindA(char ch) const
CFxString(const OdChar *lpch, int nLength)
CFxString(const char *lpch, int nLength)
CFxString right(int nCount) const
CFxString(const OdAnsiString &stringSrc, unsigned int codePage)
int compareNoCase(const CFxString &stringSrc) const
int find(const OdChar *lpszSub, int nStart) const
int compareNoCaseA(const char *lpsz) const
CFxString(const QString &stringSrc)
int findA(char ch, int nStart) const
CFxString(const QString &stringSrc, unsigned int codePage)
const CFxString & operator+=(OdChar ch)
CFxString & replaceA(char chOld, char chNew)
CFxString arg(double a, int fieldWidth=0, char fmt='g', int prec=-1, unsigned short fillChar=' ') const
CFxString & trimLeftW(OdChar chTarget)
void SetCodePage(unsigned int codePage)
CFxString(OdChar ch, int nRepeat)
CFxString & makeReverse()
CFxString & makeUpper()
CFxString & formatA(const char *lpszFormat,...)
const CFxString & operator+=(const char *lpsz)
const CFxString & operator=(const OdChar *lpsz)
CFxString & makeLower()
int insertW(int nIndex, OdChar ch)
int compare(const CFxString &lpsz) const
CFxString(const Wt::WString &stringSrc, unsigned int codePage)
bool isEmpty() const
CFxString & trimLeftA(char chTarget)
CFxString(const CFxString &stringSrc)
void empty()
CFxString(OdChar ch, int nRepeat, unsigned int codePage)
void clear()
bool equalNoCase(const OdChar *lpsz) const
static CFxString from_utf8_str(const CFxAnsiStringClass &data)
int getLength() const
int findOneOf(const OdChar *lpszCharSet) const
CFxString(const Wt::WString &stringSrc)
int findA(char ch) const
CFxString mid(int nFirst, int nCount) const
static CFxString from_utf8_str(const char *data)
int compareNoCase(const OdChar *lpsz) const
bool equalNoCase(const CFxString &stringSrc) const
CFxString & trimRightA(char chTarget)
const OdChar * wide_strU() const
friend DDKERNEL_API CFxString operator+(const CFxString &stringSrc, char ch)
CFxString & replaceW(OdChar chOld, OdChar chNew)
OdChar getAtWU(int nIndex) const
CFxAnsiStringClass utf8_str() const
bool startsWith(const char *s) const
CFxString multiArg(int numArgs, const CFxString **args) const
void setAtW(int nIndex, OdChar ch)
int insert(int nIndex, const OdChar *pstr)
CFxString & trimLeft()
const char * ansi_str() const
int findOneOfA(const char *lpszCharSet) const
int insertA(int nIndex, const char *pstr)
CFxString arg(unsigned long long a, int fieldwidth=0, int base=10, unsigned short fillChar=' ') const
CFxString(const OdChar *lpsz, unsigned int codePage)
bool startsWithNoCase(const OdChar *s) const
CFxString & vformatA(const char *lpszFormat, va_list argList)
friend DDKERNEL_API CFxString operator+(const CFxString &stringSrc, const char *lpsz)
CFxString & trimRight(const OdChar *lpszTargets)
CFxString(const OdString &stringSrc)
CFxString(char ch, int nRepeat, unsigned int codePage)
int removeA(char chRemove)
CFxStringArray SplitW(OdChar separator) const
int compare(const OdChar *lpsz) const
int find(const CFxString &) const
bool startsWithNoCase(const OdChar &c) const
const CFxString & operator+=(const OdChar *lpsz)
CFxString(char ch, int nRepeat)
bool DecodeHTML()
const CFxString & operator=(const OdAnsiString &stringSrc)
int findW(OdChar ch, int nStart) const
CFxString & trimRight()
CFxString(const OdString &stringSrc, unsigned int codePage)
int findA(const char *lpszSub) const
static CFxString from_ansi_str(const char *data)
CFxString & format(const OdChar *lpszFormat, const OdString &str)
bool startsWith(const OdChar *s) const
friend DDKERNEL_API CFxString operator+(const OdChar *lpsz, const CFxString &stringSrc)
CFxString mid(int nFirst) const
const CFxString & operator+=(const OdString &str)
CFxStringArray SplitA(char separator) const
void setAtA(int nIndex, char ch)
char getAtA(int nIndex) const
CFxString(const OdChar *lpsz)
const CFxString & operator=(OdChar ch)
bool startsWithNoCase(const char &c) const
CFxString & replace(const OdChar *lpszOld, const OdChar *lpszNew)
int getAllocLength() const
CFxString & trimLeft(const OdChar *lpszTargets)
CFxString & format(const OdChar *lpszFormat,...)
GLint GLenum GLsizei GLsizei GLint GLsizei const void * data
Definition: gles2_ext.h:110
GLint GLint GLint GLsizei GLsizei GLenum format
Definition: gles2_ext.h:111
Definition: FxString.h:28