46 static const FXchar null[];
77 FXint
length()
const {
return *(((FXint*)str)-1); }
80 FXbool length(FXint len);
83 FXwchar wc(FXint p)
const;
86 FXwchar wcnxt(FXint& p)
const;
89 FXwchar wcprv(FXint& p)
const;
92 FXint inc(FXint p)
const;
95 FXint inc(FXint p,FXint n)
const;
98 FXint dec(FXint p)
const;
101 FXint dec(FXint p,FXint n)
const;
107 FXint count(FXint start,FXint end)
const;
110 FXint offset(FXint indx)
const;
113 FXint index(FXint offs)
const;
116 FXint validate(FXint p)
const;
122 const FXchar*
text()
const {
return str; }
125 FXbool
empty()
const {
return (((FXint*)str)[-1]==0); }
128 FXbool
operator!()
const {
return (((FXint*)str)[-1]==0); }
137 FXchar&
at(FXint i){
return str[i]; }
140 const FXchar&
at(FXint i)
const {
return str[i]; }
143 FXchar&
head(){
return str[0]; }
146 const FXchar&
head()
const {
return str[0]; }
149 FXchar&
tail(){
return str[length()-1]; }
152 const FXchar&
tail()
const {
return str[length()-1]; }
155 FXString& operator=(
const FXchar* s);
158 FXString& operator=(
const FXnchar* s);
161 FXString& operator=(
const FXwchar* s);
170 FXString& operator+=(
const FXchar* s);
173 FXString& operator+=(
const FXnchar* s);
176 FXString& operator+=(
const FXwchar* s);
200 FXString& assign(
const FXchar *s,FXint n);
203 FXString& assign(
const FXnchar *s,FXint n);
206 FXString& assign(
const FXwchar *s,FXint n);
212 FXString& insert(FXint pos,FXchar c);
215 FXString& insert(FXint pos,FXchar c,FXint n);
218 FXString& insert(FXint pos,
const FXchar* s);
221 FXString& insert(FXint pos,
const FXnchar* s);
224 FXString& insert(FXint pos,
const FXwchar* s);
227 FXString& insert(FXint pos,
const FXchar* s,FXint n);
230 FXString& insert(FXint pos,
const FXnchar* s,FXint n);
233 FXString& insert(FXint pos,
const FXwchar* s,FXint n);
242 FXString& prepend(FXchar c,FXint n);
248 FXString& prepend(
const FXnchar* s);
251 FXString& prepend(
const FXwchar* s);
254 FXString& prepend(
const FXchar* s,FXint n);
257 FXString& prepend(
const FXnchar* s,FXint n);
260 FXString& prepend(
const FXwchar* s,FXint n);
281 FXString& append(
const FXchar* s,FXint n);
284 FXString& append(
const FXnchar* s,FXint n);
287 FXString& append(
const FXwchar* s,FXint n);
293 FXString& replace(FXint pos,FXchar c);
296 FXString& replace(FXint pos,FXint r,FXchar c,FXint n);
299 FXString& replace(FXint pos,FXint r,
const FXchar* s);
302 FXString& replace(FXint pos,FXint r,
const FXnchar* s);
305 FXString& replace(FXint pos,FXint r,
const FXwchar* s);
308 FXString& replace(FXint pos,FXint r,
const FXchar* s,FXint n);
311 FXString& replace(FXint pos,FXint r,
const FXnchar* s,FXint n);
314 FXString& replace(FXint pos,FXint r,
const FXwchar* s,FXint n);
320 FXString& move(FXint dst,FXint src,FXint n);
335 FXint contains(FXchar ch)
const;
338 FXint contains(
const FXchar* sub,FXint n)
const;
341 FXint contains(
const FXchar* sub)
const;
344 FXint contains(
const FXString& sub)
const;
347 FXString& substitute(FXchar org,FXchar sub,FXbool all=
true);
350 FXString& substitute(
const FXchar* org,FXint olen,
const FXchar *rep,FXint rlen,FXbool all=
true);
353 FXString& substitute(
const FXchar* org,
const FXchar *rep,FXbool all=
true);
383 FXString mid(FXint pos,FXint n)
const;
386 FXString section(FXchar delim,FXint start,FXint num=1)
const;
389 FXString section(
const FXchar* delim,FXint n,FXint start,FXint num)
const;
392 FXString section(
const FXchar* delim,FXint start,FXint num=1)
const;
403 FXString before(FXchar ch,FXint n=1)
const;
411 FXString rbefore(FXchar ch,FXint n=1)
const;
419 FXString after(FXchar ch,FXint n=1)
const;
427 FXString rafter(FXchar ch,FXint n=1)
const;
430 FXint find(FXchar c,FXint pos=0)
const;
433 FXint rfind(FXchar c,FXint pos=2147483647)
const;
436 FXint find(FXchar c,FXint pos,FXint n)
const;
439 FXint rfind(FXchar c,FXint pos,FXint n)
const;
442 FXint find(
const FXchar* substr,FXint n,FXint pos)
const;
445 FXint rfind(
const FXchar* substr,FXint n,FXint pos)
const;
448 FXint find(
const FXchar* substr,FXint pos=0)
const;
451 FXint rfind(
const FXchar* substr,FXint pos=2147483647)
const;
454 FXint find(
const FXString& substr,FXint pos=0)
const;
457 FXint rfind(
const FXString& substr,FXint pos=2147483647)
const;
460 FXint find_first_of(
const FXchar*
set,FXint n,FXint pos)
const;
463 FXint find_first_of(
const FXchar*
set,FXint pos=0)
const;
466 FXint find_first_of(
const FXString&
set,FXint pos=0)
const;
469 FXint find_first_of(FXchar c,FXint pos=0)
const;
472 FXint find_last_of(
const FXchar*
set,FXint n,FXint pos)
const;
475 FXint find_last_of(
const FXchar*
set,FXint pos=2147483647)
const;
478 FXint find_last_of(
const FXString&
set,FXint pos=2147483647)
const;
481 FXint find_last_of(FXchar c,FXint pos=2147483647)
const;
484 FXint find_first_not_of(
const FXchar*
set,FXint n,FXint pos)
const;
487 FXint find_first_not_of(
const FXchar*
set,FXint pos=0)
const;
490 FXint find_first_not_of(
const FXString&
set,FXint pos=0)
const;
493 FXint find_first_not_of(FXchar c,FXint pos=0)
const;
496 FXint find_last_not_of(
const FXchar*
set,FXint n,FXint pos)
const;
499 FXint find_last_not_of(
const FXchar*
set,FXint pos=2147483647)
const;
502 FXint find_last_not_of(
const FXString&
set,FXint pos=2147483647)
const;
505 FXint find_last_not_of(FXchar c,FXint pos=2147483647)
const;
508 FXint scan(
const FXchar* fmt,...) const FX_SCANF(2,3) ;
509 FXint vscan(const FXchar* fmt,va_list args) const;
512 FXint format(const FXchar* fmt,...) FX_PRINTF(2,3) ;
513 FXint vformat(const FXchar* fmt,va_list args);
516 FXint toInt(FXint base=10,FXbool* ok=
nullptr) const;
519 FXuint toUInt(FXint base=10,FXbool* ok=
nullptr) const;
522 FXlong toLong(FXint base=10,FXbool* ok=
nullptr) const;
525 FXulong toULong(FXint base=10,FXbool* ok=
nullptr) const;
528 FXfloat toFloat(FXbool* ok=
nullptr) const;
531 FXdouble toDouble(FXbool* ok=
nullptr) const;
534 FXString& fromInt(FXint number,FXint base=10);
537 FXString& fromUInt(FXuint number,FXint base=10);
540 FXString& fromLong(FXlong number,FXint base=10);
543 FXString& fromULong(FXulong number,FXint base=10);
546 FXString& fromFloat(FXfloat number,FXint prec=6,FXint fmt=2);
549 FXString& fromDouble(FXdouble number,FXint prec=6,FXint fmt=2);
555 static
FXString value(FXint num,FXint base=10);
556 static
FXString value(FXuint num,FXint base=10);
562 static
FXString value(FXlong num,FXint base=10);
563 static
FXString value(FXulong num,FXint base=10);
570 static
FXString value(FXfloat num,FXint prec=6,FXint fmt=2);
571 static
FXString value(FXdouble num,FXint prec=6,FXint fmt=2);
576 static
FXString value(const FXchar* fmt,...) FX_PRINTF(1,2) ;
581 static
FXString vvalue(const FXchar* fmt,va_list args);
588 static FXuint hash(const FXchar* s);
591 static FXuint hash(const FXchar* s,FXint n);
594 static FXint compare(const FXchar* s1,const FXchar* s2);
595 static FXint compare(const FXchar* s1,const
FXString& s2);
596 static FXint compare(const
FXString& s1,const FXchar* s2);
600 static FXint compare(const FXchar* s1,const FXchar* s2,FXint n);
601 static FXint compare(const FXchar* s1,const
FXString& s2,FXint n);
602 static FXint compare(const
FXString& s1,const FXchar* s2,FXint n);
606 static FXint comparecase(const FXchar* s1,const FXchar* s2);
607 static FXint comparecase(const FXchar* s1,const
FXString& s2);
608 static FXint comparecase(const
FXString& s1,const FXchar* s2);
612 static FXint comparecase(const FXchar* s1,const FXchar* s2,FXint n);
613 static FXint comparecase(const FXchar* s1,const
FXString& s2,FXint n);
614 static FXint comparecase(const
FXString& s1,const FXchar* s2,FXint n);
618 static FXint comparenatural(const FXchar* s1,const FXchar* s2);
619 static FXint comparenatural(const FXchar* s1,const
FXString& s2);
620 static FXint comparenatural(const
FXString& s1,const FXchar* s2);
624 static FXint comparenaturalcase(const FXchar* s1,const FXchar* s2);
625 static FXint comparenaturalcase(const FXchar* s1,const
FXString& s2);
626 static FXint comparenaturalcase(const
FXString& s1,const FXchar* s2);
633 static FXbool shouldEscape(const FXchar* str,FXchar lquote='\0',FXchar rquote='\0',FXint flag=0);
634 static FXbool shouldEscape(const FXchar* str,FXint num,FXchar lquote='\0',FXchar rquote='\0',FXint flag=0);
635 static FXbool shouldEscape(const
FXString& str,FXchar lquote='\0',FXchar rquote='\0',FXint flag=0);
646 static
FXString escape(const FXchar* str,FXchar lquote='\0',FXchar rquote='\0',FXint flag=0);
647 static
FXString escape(const FXchar* str,FXint num,FXchar lquote='\0',FXchar rquote='\0',FXint flag=0);
648 static
FXString escape(const
FXString& str,FXchar lquote='\0',FXchar rquote='\0',FXint flag=0);
657 static
FXString unescape(const FXchar* str,FXchar lquote='\0',FXchar rquote='\0');
658 static
FXString unescape(const FXchar* str,FXint num,FXchar lquote='\0',FXchar rquote='\0');
659 static
FXString unescape(const
FXString& str,FXchar lquote='\0',FXchar rquote='\0');
665 static
FXString detab(const FXchar* str,FXint tabcols);
666 static
FXString detab(const FXchar* str,FXint num,FXint tabcols);
673 static
FXString entab(const FXchar* str,FXint tabcols);
674 static
FXString entab(const FXchar* str,FXint num,FXint tabcols);
682 static FXint columns(const FXchar* str,FXint tabcols);
683 static FXint columns(const FXchar* str,FXint num,FXint tabcols);
684 static FXint columns(const
FXString& str,FXint tabcols);
693 static
FXString tabbify(const FXchar* str,FXint tabcols,FXint indent,FXint outdent,FXint shift,FXbool tabs);
694 static
FXString tabbify(const FXchar* str,FXint num,FXint tabcols,FXint indent,FXint outdent,FXint shift,FXbool tabs);
695 static
FXString tabbify(const
FXString& str,FXint tabcols,FXint indent,FXint outdent,FXint shift,FXbool tabs);
729 FXchar* t=dst.str; dst.str=src.str; src.str=t;
736 static inline FXbool operator==(
const FXString& s1,
const FXchar* s2){
return FXString::compare(s1.text(),s2)==0; }
737 static inline FXbool operator==(
const FXchar* s1,
const FXString& s2){
return FXString::compare(s1,s2.text())==0; }
740 static inline FXbool operator!=(
const FXString& s1,
const FXString& s2){
return FXString::compare(s1.text(),s2.text())!=0; }
741 static inline FXbool operator!=(
const FXString& s1,
const FXchar* s2){
return FXString::compare(s1.text(),s2)!=0; }
742 static inline FXbool operator!=(
const FXchar* s1,
const FXString& s2){
return FXString::compare(s1,s2.text())!=0; }
745 static inline FXbool operator<(
const FXString& s1,
const FXString& s2){
return FXString::compare(s1.text(),s2.text())<0; }
746 static inline FXbool operator<(
const FXString& s1,
const FXchar* s2){
return FXString::compare(s1.text(),s2)<0; }
747 static inline FXbool operator<(
const FXchar* s1,
const FXString& s2){
return FXString::compare(s1,s2.text())<0; }
750 static inline FXbool operator<=(
const FXString& s1,
const FXString& s2){
return FXString::compare(s1.text(),s2.text())<=0; }
751 static inline FXbool operator<=(
const FXString& s1,
const FXchar* s2){
return FXString::compare(s1.text(),s2)<=0; }
752 static inline FXbool operator<=(
const FXchar* s1,
const FXString& s2){
return FXString::compare(s1,s2.text())<=0; }
755 static inline FXbool operator>(
const FXString& s1,
const FXString& s2){
return FXString::compare(s1.text(),s2.text())>0; }
756 static inline FXbool operator>(
const FXString& s1,
const FXchar* s2){
return FXString::compare(s1.text(),s2)>0; }
757 static inline FXbool operator>(
const FXchar* s1,
const FXString& s2){
return FXString::compare(s1,s2.text())>0; }
760 static inline FXbool operator>=(
const FXString& s1,
const FXString& s2){
return FXString::compare(s1.text(),s2.text())>=0; }
761 static inline FXbool operator>=(
const FXString& s1,
const FXchar* s2){
return FXString::compare(s1.text(),s2)>=0; }
762 static inline FXbool operator>=(
const FXchar* s1,
const FXString& s2){
return FXString::compare(s1,s2.text())>=0; }
765 extern FXAPI FXString operator+(
const FXString& s1,
const FXString& s2);
768 extern FXAPI FXString operator+(
const FXString& s1,
const FXchar* s2);
769 extern FXAPI FXString operator+(
const FXString& s1,
const FXnchar* s2);
770 extern FXAPI FXString operator+(
const FXString& s1,
const FXwchar* s2);
773 extern FXAPI FXString operator+(
const FXchar* s1,
const FXString& s2);
774 extern FXAPI FXString operator+(
const FXnchar* s1,
const FXString& s2);
775 extern FXAPI FXString operator+(
const FXwchar* s1,
const FXString& s2);
778 extern FXAPI FXString operator+(
const FXString& s,FXchar c);
779 extern FXAPI FXString operator+(FXchar c,
const FXString& s);
782 extern FXAPI FXStream& operator<<(FXStream& store,
const FXString& s);
785 extern FXAPI FXStream& operator>>(FXStream& store,FXString& s);
788 extern FXAPI FXString& unixToDos(FXString& str);
791 extern FXAPI FXString& dosToUnix(FXString& str);
FXchar & head()
Return a non-const reference to the first character.
Definition: FXString.h:143
FXchar & tail()
Return a non-const reference to the last character.
Definition: FXString.h:149
const FXchar * text() const
Get text contents as const pointer.
Definition: FXString.h:122
const FXchar & tail() const
Return a const reference to the last character.
Definition: FXString.h:152
const FXchar & at(FXint i) const
Return a const reference to the ith character.
Definition: FXString.h:140
FXchar & operator[](FXint i)
Return a non-const reference to the ith character.
Definition: FXString.h:131
FXchar * text()
Get text contents as pointer.
Definition: FXString.h:119
FXbool empty() const
See if string is empty.
Definition: FXString.h:125
A stream is a way to serialize data and objects into a byte stream.
Definition: FXStream.h:81
FXchar & at(FXint i)
Return a non-const reference to the ith character.
Definition: FXString.h:137
FXbool operator!() const
See if string is empty.
Definition: FXString.h:128
FXint length() const
Length of text in bytes.
Definition: FXString.h:77
Definition: FX4Splitter.h:28
const FXchar & head() const
Return a const reference to the first character.
Definition: FXString.h:146
static FXint compare(const FXchar *s1, const FXchar *s2)
Compare.
const FXchar & operator[](FXint i) const
Return a const reference to the ith character.
Definition: FXString.h:134
FXString provides essential string manipulation capabilities in FOX.
Definition: FXString.h:42