FXString.h

Go to the documentation of this file.
00001 /********************************************************************************
00002 *                                                                               *
00003 *                           S t r i n g   O b j e c t                           *
00004 *                                                                               *
00005 *********************************************************************************
00006 * Copyright (C) 1997,2006 by Jeroen van der Zijp.   All Rights Reserved.        *
00007 * TnFOX extensions (C) 2003-2006 Niall Douglas                                  *
00008 *********************************************************************************
00009 * This library is free software; you can redistribute it and/or                 *
00010 * modify it under the terms of the GNU Lesser General Public                    *
00011 * License as published by the Free Software Foundation; either                  *
00012 * version 2.1 of the License, or (at your option) any later version.            *
00013 *                                                                               *
00014 * This library is distributed in the hope that it will be useful,               *
00015 * but WITHOUT ANY WARRANTY; without even the implied warranty of                *
00016 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU             *
00017 * Lesser General Public License for more details.                               *
00018 *                                                                               *
00019 * You should have received a copy of the GNU Lesser General Public              *
00020 * License along with this library; if not, write to the Free Software           *
00021 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA.    *
00022 *********************************************************************************
00023 * $Id: FXString.h,v 1.120 2006/02/20 03:32:12 fox Exp $                         *
00024 ********************************************************************************/
00025 #ifndef FXSTRING_H
00026 #define FXSTRING_H
00027 
00028 #include "fxdefs.h"
00029 #include <stdarg.h>
00030 
00035 namespace FX {
00036 
00037 
00046 class FXAPI FXString {
00047 private:
00048   FXchar *str;
00049   FXint *inserts;
00050 public:
00051   static const FXchar null[];
00052   static const FXchar hex[17];
00053   static const FXchar HEX[17];
00054 public:
00055   static const signed char utfBytes[256];
00056 public:
00057 
00059   FXString() throw();
00060 
00062   FXString(const FXString& s);
00063 
00064 #ifdef HAVE_CPP0XRVALUEREFS
00066   FXString(FXString && s) : str(std::move(s.str)), inserts(std::move(s.inserts)) { s.str=nullStr().str; s.inserts=0; }
00067 
00069   FXString &&operator=(FXString && s) { str=std::move(s.str); inserts=std::move(s.inserts); s.str=nullStr().str; s.inserts=0; return *this; }
00070 #endif
00071 
00073   FXString(const FXchar* s);
00074 
00076   FXString(const FXwchar* s);
00077 
00079   FXString(const FXnchar* s);
00080 
00082   FXString(const FXchar* s,FXint n);
00083 
00085   FXString(const FXwchar* s,FXint n);
00086 
00088   FXString(const FXnchar* s,FXint n);
00089 
00091   FXString(FXchar c,FXint n);
00092 
00094   FXint length() const throw() { return *(((FXint*)str)-1); }
00095 
00097   void length(FXint len);
00098 
00100   FXint count() const throw();
00101 
00103   FXint count(FXint pos,FXint len) const throw();
00104 
00106   FXint offset(FXint indx) const throw();
00107 
00109   FXint index(FXint offs) const throw();
00110 
00112   FXint validate(FXint p) const throw();
00113 
00115   FXint extent(FXint p) const throw() { return utfBytes[(FXuchar)str[p]]; }
00116 
00118   FXint inc(FXint p) const throw();
00119 
00121   FXint dec(FXint p) const throw();
00122 
00124   const FXchar* text() const throw() { return (const FXchar*)str; }
00125 
00127   bool empty() const throw() { return (((FXint*)str)[-1]==0); }
00128 
00130   bool operator!() const throw() { return (((FXint*)str)[-1]==0); }
00131 
00133   FXchar& operator[](FXint i) throw() { return str[i]; }
00134 
00136   const FXchar& operator[](FXint i) const throw() { return str[i]; }
00137 
00139   FXchar& at(FXint i){ return str[i]; }
00140 
00142   const FXchar& at(FXint i) const { return str[i]; }
00143 
00145   FXwchar wc(FXint i) const throw();
00146 
00148   FXString& operator=(const FXchar* s);
00149 
00151   FXString& operator=(const FXwchar* s);
00152 
00154   FXString& operator=(const FXnchar* s);
00155 
00157   FXString& operator=(const FXString& s);
00158 
00160   FXString& fill(FXchar c,FXint n);
00161 
00163   FXString& fill(FXchar c) throw();
00164 
00166   FXString& lower();
00167 
00169   FXString& upper();
00170 
00172   FXString section(FXchar delim,FXint start,FXint num=1) const;
00173 
00175   FXString section(const FXchar* delim,FXint n,FXint start,FXint num) const;
00176 
00178   FXString section(const FXchar* delim,FXint start,FXint num=1) const;
00179 
00181   FXString section(const FXString& delim,FXint start,FXint num=1) const;
00182 
00184   FXString& adopt(FXString& s) throw();
00185 
00187   FXString& assign(FXchar c);
00188 
00190   FXString& assign(FXchar c,FXint n);
00191 
00193   FXString& assign(const FXchar *s,FXint n);
00194 
00196   FXString& assign(const FXwchar *s,FXint n);
00197 
00199   FXString& assign(const FXnchar *s,FXint n);
00200 
00202   FXString& assign(const FXchar* s);
00203 
00205   FXString& assign(const FXwchar* s);
00206 
00208   FXString& assign(const FXnchar* s);
00209 
00211   FXString& assign(const FXString& s);
00212 
00214   FXString& insert(FXint pos,FXchar c);
00215 
00217   FXString& insert(FXint pos,FXchar c,FXint n);
00218 
00220   FXString& insert(FXint pos,const FXchar* s,FXint n);
00221 
00223   FXString& insert(FXint pos,const FXwchar* s,FXint n);
00224 
00226   FXString& insert(FXint pos,const FXnchar* s,FXint n);
00227 
00229   FXString& insert(FXint pos,const FXchar* s);
00230 
00232   FXString& insert(FXint pos,const FXwchar* s);
00233 
00235   FXString& insert(FXint pos,const FXnchar* s);
00236 
00238   FXString& insert(FXint pos,const FXString& s);
00239 
00241   FXString& prepend(FXchar c);
00242 
00244   FXString& prepend(FXchar c,FXint n);
00245 
00247   FXString& prepend(const FXchar* s,FXint n);
00248 
00250   FXString& prepend(const FXwchar* s,FXint n);
00251 
00253   FXString& prepend(const FXnchar* s,FXint n);
00254 
00256   FXString& prepend(const FXchar* s);
00257 
00259   FXString& prepend(const FXwchar* s);
00260 
00262   FXString& prepend(const FXnchar* s);
00263 
00265   FXString& prepend(const FXString& s);
00266 
00268   FXString& append(FXchar c);
00269 
00271   FXString& append(FXchar c,FXint n);
00272 
00274   FXString& append(const FXchar* s,FXint n);
00275 
00277   FXString& append(const FXwchar* s,FXint n);
00278 
00280   FXString& append(const FXnchar* s,FXint n);
00281 
00283   FXString& append(const FXchar* s);
00284 
00286   FXString& append(const FXwchar* s);
00287 
00289   FXString& append(const FXnchar* s);
00290 
00292   FXString& append(const FXString& s);
00293 
00295   FXString& replace(FXint pos,FXchar c);
00296 
00298   FXString& replace(FXint pos,FXint m,FXchar c,FXint n);
00299 
00301   FXString& replace(FXint pos,FXint m,const FXchar* s,FXint n);
00302 
00304   FXString& replace(FXint pos,FXint m,const FXwchar* s,FXint n);
00305 
00307   FXString& replace(FXint pos,FXint m,const FXnchar* s,FXint n);
00308 
00310   FXString& replace(FXint pos,FXint m,const FXchar* s);
00311 
00313   FXString& replace(FXint pos,FXint m,const FXwchar* s);
00314 
00316   FXString& replace(FXint pos,FXint m,const FXnchar* s);
00317 
00319   FXString& replace(FXint pos,FXint m,const FXString& s);
00320 
00322   FXString& move(FXint dst,FXint src,FXint n);
00323 
00325   FXString& erase(FXint pos);
00326 
00328   FXString& erase(FXint pos,FXint n);
00329 
00331   FXint contains(FXchar ch) const throw();
00332 
00334   FXint contains(const FXchar* sub,FXint n) const throw();
00335 
00337   FXint contains(const FXchar* sub) const throw();
00338 
00340   FXint contains(const FXString& sub) const throw();
00341 
00343   FXString& substitute(FXchar org,FXchar sub,bool all=true) throw();
00344 
00346   FXString& substitute(const FXchar* org,FXint olen,const FXchar *rep,FXint rlen,bool all=true);
00347 
00349   FXString& substitute(const FXchar* org,const FXchar *rep,bool all=true);
00350 
00352   FXString& substitute(const FXString& org,const FXString& rep,bool all=true);
00353 
00355   FXString& simplify();
00356 
00358   FXString& trim();
00359 
00361   FXString& trimBegin();
00362 
00364   FXString& trimEnd();
00365 
00367   FXString& trunc(FXint pos);
00368 
00370   FXString& clear();
00371 
00373   FXString left(FXint n) const;
00374 
00376   FXString right(FXint n) const;
00377 
00379   FXString mid(FXint pos,FXint n=1073741824) const;
00380 
00387   FXString before(FXchar ch,FXint n=1) const;
00388 
00395   FXString rbefore(FXchar ch,FXint n=1) const;
00396 
00403   FXString after(FXchar ch,FXint n=1) const;
00404 
00411   FXString rafter(FXchar ch,FXint n=1) const;
00412 
00414   FXint find(FXchar c,FXint pos=0) const throw();
00415 
00417   FXint rfind(FXchar c,FXint pos=2147483647) const throw();
00418 
00420   FXint find(FXchar c,FXint pos,FXint n) const throw();
00421 
00423   FXint rfind(FXchar c,FXint pos,FXint n) const throw();
00424 
00426   FXint find(const FXchar* substr,FXint n,FXint pos) const throw();
00427 
00429   FXint rfind(const FXchar* substr,FXint n,FXint pos) const throw();
00430 
00432   FXint find(const FXchar* substr,FXint pos=0) const throw();
00433 
00435   FXint rfind(const FXchar* substr,FXint pos=2147483647) const throw();
00436 
00438   FXint find(const FXString& substr,FXint pos=0) const throw();
00439 
00441   FXint rfind(const FXString& substr,FXint pos=2147483647) const throw();
00442 
00444   FXint find_first_of(const FXchar* set,FXint n,FXint pos) const throw();
00445 
00447   FXint find_first_of(const FXchar* set,FXint pos=0) const throw();
00448 
00450   FXint find_first_of(const FXString& set,FXint pos=0) const throw();
00451 
00453   FXint find_first_of(FXchar c,FXint pos=0) const throw();
00454 
00456   FXint find_last_of(const FXchar* set,FXint n,FXint pos) const throw();
00457 
00459   FXint find_last_of(const FXchar* set,FXint pos=2147483647) const throw();
00460 
00462   FXint find_last_of(const FXString& set,FXint pos=2147483647) const throw();
00463 
00465   FXint find_last_of(FXchar c,FXint pos=0) const throw();
00466 
00468   FXint find_first_not_of(const FXchar* set,FXint n,FXint pos) const throw();
00469 
00471   FXint find_first_not_of(const FXchar* set,FXint pos=0) const throw();
00472 
00474   FXint find_first_not_of(const FXString& set,FXint pos=0) const throw();
00475 
00477   FXint find_first_not_of(FXchar c,FXint pos=0) const throw();
00478 
00480   FXint find_last_not_of(const FXchar* set,FXint n,FXint pos) const throw();
00481 
00483   FXint find_last_not_of(const FXchar* set,FXint pos=2147483647) const throw();
00484 
00486   FXint find_last_not_of(const FXString& set,FXint pos=2147483647) const throw();
00487 
00489   FXint find_last_not_of(FXchar c,FXint pos=0) const throw();
00490 
00492   FXString& format(const FXchar* fmt,...) FX_PRINTF(2,3) ;
00493   FXString& vformat(const FXchar* fmt,va_list args);
00494 
00496   FXint scan(const FXchar* fmt,...) const FX_SCANF(2,3) ;
00497   FXint vscan(const FXchar* fmt,va_list args) const;
00498 
00500   FXuint hash() const throw();
00501 
00503   void truncate(FXint len) { length(len); }
00504 
00508   FXString &arg(const FXString &str, FXint fieldwidth=0);
00509   FXString &arg(const char *str, FXint fieldwidth=0) { return arg(FXString(str), fieldwidth); }
00510   FXString &arg(const FXwchar *str, FXint fieldwidth=0) { return arg(FXString(str), fieldwidth); }
00511   FXString &arg(const FXnchar *str, FXint fieldwidth=0) { return arg(FXString(str), fieldwidth); }
00512   FXString &arg(char c, FXint fieldwidth=0);
00513   FXString &arg(FXlong num,   FXint fieldwidth=0, FXint base=10);
00514   FXString &arg(FXulong num,  FXint fieldwidth=0, FXint base=10);
00515   FXString &arg(FXint num,    FXint fieldwidth=0, FXint base=10) { return (base!=10) ? arg((FXulong)(FXuint) num, fieldwidth, base) : arg((FXlong) num, fieldwidth, base); }
00516   FXString &arg(FXuint num,   FXint fieldwidth=0, FXint base=10) { return arg((FXulong) num, fieldwidth, base); }
00517   FXString &arg(FXshort num,  FXint fieldwidth=0, FXint base=10) { return (base!=10) ? arg((FXulong)(FXushort) num, fieldwidth, base) : arg((FXlong) num, fieldwidth, base); }
00518   FXString &arg(FXushort num, FXint fieldwidth=0, FXint base=10) { return arg((FXulong) num, fieldwidth, base); }
00519 #if !(defined(__LP64__) || defined(_LP64) || (_MIPS_SZLONG == 64) || (__WORDSIZE == 64))
00520   // Must declare overloads for long when long!=FXlong
00521   FXString &arg(long num,     FXint fieldwidth=0, FXint base=10) { return arg((base!=10) ? (FXulong)((unsigned long) num) : (FXlong) num, fieldwidth, base); }
00522   FXString &arg(unsigned long num, FXint fieldwidth=0, FXint base=10) { return arg((FXulong) num, fieldwidth, base); }
00523 #endif
00524   FXString &arg(double num,   FXint fieldwidth=0, FXchar fmt='g', int prec=-1);
00525   FXString &arg(void *ptr,    FXint fieldwidth=-FXint(sizeof(FXuval)*2)) { return arg((FXulong)(FXuval) ptr, fieldwidth, 16); }
00526 
00528   static FXString number(FXlong num,   FXint base=10);
00529   static FXString number(FXulong num,  FXint base=10);
00530   static FXString number(FXint num,    FXint base=10) { return (base!=10) ? number((FXulong)(FXuint) num, base) : number((FXlong) num, base); }
00531   static FXString number(FXuint num,   FXint base=10) { return number((FXulong) num, base); }
00532   static FXString number(FXshort num,  FXint base=10) { return (base!=10) ? number((FXulong)(FXushort) num, base) : number((FXlong) num, base); }
00533   static FXString number(FXushort num, FXint base=10) { return number((FXulong) num, base); }
00534   static FXString number(double num, FXchar fmt='g', int prec=-1);
00535   static FXString number(void *ptr) { return number((FXulong)(FXuval) ptr, 16); }
00536 
00538   FXlong toLong(bool *ok=0, FXint base=10) const throw();
00539   FXulong toULong(bool *ok=0, FXint base=10) const throw();
00540   FXint toInt(bool *ok=0, FXint base=10) const throw() { return (FXint) toLong(ok, base); }
00541   FXuint toUInt(bool *ok=0, FXint base=10) const throw() { return (FXuint) toULong(ok, base); }
00542   double toDouble(bool *ok=0) const throw();
00543 
00545   static const FXString &nullStr() throw();
00546 
00547 private:
00548   inline FXDLLLOCAL void getLowestInsert(FXint &pos, FXint &len);
00549   inline FXDLLLOCAL void resetInserts();
00550   inline FXDLLLOCAL void shiftInserts(FXint pos, FXint diff);
00551   inline FXDLLLOCAL void doneInsert();
00552   FXDLLLOCAL void calcInserts();
00553   FXDLLLOCAL FXString numToText(FXulong num, FXint fw, FXint base);
00554   FXDLLLOCAL FXulong textToNum(const FXchar *str, bool *ok, FXint base) const throw();
00555 public:
00556 
00558   friend FXAPI FXint compare(const FXchar* s1,const FXchar* s2) throw();
00559   friend FXAPI FXint compare(const FXchar* s1,const FXString& s2) throw();
00560   friend FXAPI FXint compare(const FXString& s1,const FXchar* s2) throw();
00561   friend FXAPI FXint compare(const FXString& s1,const FXString& s2) throw();
00562 
00564   friend FXAPI FXint compare(const FXchar* s1,const FXchar* s2,FXint n) throw();
00565   friend FXAPI FXint compare(const FXchar* s1,const FXString& s2,FXint n) throw();
00566   friend FXAPI FXint compare(const FXString& s1,const FXchar* s2,FXint n) throw();
00567   friend FXAPI FXint compare(const FXString& s1,const FXString& s2,FXint n) throw();
00568 
00570   friend FXAPI FXint comparecase(const FXchar* s1,const FXchar* s2) throw();
00571   friend FXAPI FXint comparecase(const FXchar* s1,const FXString& s2) throw();
00572   friend FXAPI FXint comparecase(const FXString& s1,const FXchar* s2) throw();
00573   friend FXAPI FXint comparecase(const FXString& s1,const FXString& s2) throw();
00574 
00576   friend FXAPI FXint comparecase(const FXchar* s1,const FXchar* s2,FXint n) throw();
00577   friend FXAPI FXint comparecase(const FXchar* s1,const FXString& s2,FXint n) throw();
00578   friend FXAPI FXint comparecase(const FXString& s1,const FXchar* s2,FXint n) throw();
00579   friend FXAPI FXint comparecase(const FXString& s1,const FXString& s2,FXint n) throw();
00580 
00582   friend FXAPI FXint compareversion(const FXchar* s1,const FXchar* s2) throw();
00583   friend FXAPI FXint compareversion(const FXchar* s1,const FXString& s2) throw();
00584   friend FXAPI FXint compareversion(const FXString& s1,const FXchar* s2) throw();
00585   friend FXAPI FXint compareversion(const FXString& s1,const FXString& s2) throw();
00586 
00588   friend FXAPI bool operator==(const FXString& s1,const FXString& s2) throw();
00589   friend FXAPI bool operator==(const FXString& s1,const FXchar* s2) throw();
00590   friend FXAPI bool operator==(const FXchar* s1,const FXString& s2) throw();
00591 
00592   friend FXAPI bool operator!=(const FXString& s1,const FXString& s2) throw();
00593   friend FXAPI bool operator!=(const FXString& s1,const FXchar* s2) throw();
00594   friend FXAPI bool operator!=(const FXchar* s1,const FXString& s2) throw();
00595 
00596   friend FXAPI bool operator<(const FXString& s1,const FXString& s2) throw();
00597   friend FXAPI bool operator<(const FXString& s1,const FXchar* s2) throw();
00598   friend FXAPI bool operator<(const FXchar* s1,const FXString& s2) throw();
00599 
00600   friend FXAPI bool operator<=(const FXString& s1,const FXString& s2) throw();
00601   friend FXAPI bool operator<=(const FXString& s1,const FXchar* s2) throw();
00602   friend FXAPI bool operator<=(const FXchar* s1,const FXString& s2) throw();
00603 
00604   friend FXAPI bool operator>(const FXString& s1,const FXString& s2) throw();
00605   friend FXAPI bool operator>(const FXString& s1,const FXchar* s2) throw();
00606   friend FXAPI bool operator>(const FXchar* s1,const FXString& s2) throw();
00607 
00608   friend FXAPI bool operator>=(const FXString& s1,const FXString& s2) throw();
00609   friend FXAPI bool operator>=(const FXString& s1,const FXchar* s2) throw();
00610   friend FXAPI bool operator>=(const FXchar* s1,const FXString& s2) throw();
00611 
00613   FXString& operator+=(const FXString& s);
00614   FXString& operator+=(const FXchar* s);
00615   FXString& operator+=(const FXwchar* s);
00616   FXString& operator+=(const FXnchar* s);
00617   FXString& operator+=(FXchar c);
00618 
00620   friend FXAPI FXString operator+(const FXString& s1,const FXString& s2);
00621 
00623   friend FXAPI FXString operator+(const FXString& s1,const FXchar* s2);
00624   friend FXAPI FXString operator+(const FXString& s1,const FXwchar* s2);
00625   friend FXAPI FXString operator+(const FXString& s1,const FXnchar* s2);
00626 
00628   friend FXAPI FXString operator+(const FXchar* s1,const FXString& s2);
00629   friend FXAPI FXString operator+(const FXwchar* s1,const FXString& s2);
00630   friend FXAPI FXString operator+(const FXnchar* s1,const FXString& s2);
00631 
00633   friend FXAPI FXString operator+(const FXString& s,FXchar c);
00634   friend FXAPI FXString operator+(FXchar c,const FXString& s);
00635 
00637   friend inline FXStream& operator<<(FXStream& store,const FXString& s);
00638 
00640   friend inline FXStream& operator>>(FXStream& store,FXString& s);
00641 
00643   friend FXAPI FXString FXStringFormat(const FXchar* fmt,...) FX_PRINTF(1,2) ;
00644   friend FXAPI FXString FXStringVFormat(const FXchar* fmt,va_list args);
00645 
00650   friend FXAPI FXString FXStringVal(FXint num,FXint base);
00651   friend FXAPI FXString FXStringVal(FXuint num,FXint base);
00652 
00657   friend FXAPI FXString FXStringVal(FXlong num,FXint base);
00658   friend FXAPI FXString FXStringVal(FXulong num,FXint base);
00659 
00665   friend FXAPI FXString FXStringVal(FXfloat num,FXint prec,FXint exp);
00666   friend FXAPI FXString FXStringVal(FXdouble num,FXint prec,FXint exp);
00667 
00669   friend FXAPI FXint FXIntVal(const FXString& s,FXint base);
00670   friend FXAPI FXuint FXUIntVal(const FXString& s,FXint base);
00671 
00673   friend FXAPI FXlong FXLongVal(const FXString& s,FXint base);
00674   friend FXAPI FXulong FXULongVal(const FXString& s,FXint base);
00675 
00677   friend FXAPI FXfloat FXFloatVal(const FXString& s);
00678   friend FXAPI FXdouble FXDoubleVal(const FXString& s);
00679 
00681   friend FXAPI FXString fromAscii(const FXString& s);
00682 
00684   friend FXAPI FXString toAscii(const FXString& s);
00685 
00687   friend FXAPI FXString escape(const FXString& s);
00688 
00690   friend FXAPI FXString unescape(const FXString& s);
00691 
00693   friend FXAPI FXString normalize(const FXString& s);
00694 
00696   friend FXAPI FXString decompose(const FXString& s,FXuint kind);
00697 
00699   friend FXAPI FXString compose(const FXString& s,FXuint kind);
00700 
00702   friend inline void swap(FXString& a,FXString& b);
00703 
00705   friend FXAPI FXString& unixToDos(FXString& str);
00706   friend FXAPI FXString& dosToUnix(FXString& str);
00707 
00709  ~FXString();
00710   };
00711 
00712 
00713 inline void swap(FXString& a,FXString& b){ FXchar *t=a.str; a.str=b.str; b.str=t; }
00714 
00715 extern FXAPI FXint compare(const FXchar* s1,const FXchar* s2) throw();
00716 extern FXAPI FXint compare(const FXchar* s1,const FXString& s2) throw();
00717 extern FXAPI FXint compare(const FXString& s1,const FXchar* s2) throw();
00718 extern FXAPI FXint compare(const FXString& s1,const FXString& s2) throw();
00719 
00720 extern FXAPI FXint compare(const FXchar* s1,const FXchar* s2,FXint n) throw();
00721 extern FXAPI FXint compare(const FXchar* s1,const FXString& s2,FXint n) throw();
00722 extern FXAPI FXint compare(const FXString& s1,const FXchar* s2,FXint n) throw();
00723 extern FXAPI FXint compare(const FXString& s1,const FXString& s2,FXint n) throw();
00724 
00725 extern FXAPI FXint comparecase(const FXchar* s1,const FXchar* s2) throw();
00726 extern FXAPI FXint comparecase(const FXchar* s1,const FXString& s2) throw();
00727 extern FXAPI FXint comparecase(const FXString& s1,const FXchar* s2) throw();
00728 extern FXAPI FXint comparecase(const FXString& s1,const FXString& s2) throw();
00729 
00730 extern FXAPI FXint comparecase(const FXchar* s1,const FXchar* s2,FXint n) throw();
00731 extern FXAPI FXint comparecase(const FXchar* s1,const FXString& s2,FXint n) throw();
00732 extern FXAPI FXint comparecase(const FXString& s1,const FXchar* s2,FXint n) throw();
00733 extern FXAPI FXint comparecase(const FXString& s1,const FXString& s2,FXint n) throw();
00734 
00735 extern FXAPI FXint compareversion(const FXchar* s1,const FXchar* s2) throw();
00736 extern FXAPI FXint compareversion(const FXchar* s1,const FXString& s2) throw();
00737 extern FXAPI FXint compareversion(const FXString& s1,const FXchar* s2) throw();
00738 extern FXAPI FXint compareversion(const FXString& s1,const FXString& s2) throw();
00739 
00740 extern FXAPI bool operator==(const FXString& s1,const FXString& s2) throw();
00741 extern FXAPI bool operator==(const FXString& s1,const FXchar* s2) throw();
00742 extern FXAPI bool operator==(const FXchar* s1,const FXString& s2) throw();
00743 
00744 extern FXAPI bool operator!=(const FXString& s1,const FXString& s2) throw();
00745 extern FXAPI bool operator!=(const FXString& s1,const FXchar* s2) throw();
00746 extern FXAPI bool operator!=(const FXchar* s1,const FXString& s2) throw();
00747 
00748 extern FXAPI bool operator<(const FXString& s1,const FXString& s2) throw();
00749 extern FXAPI bool operator<(const FXString& s1,const FXchar* s2) throw();
00750 extern FXAPI bool operator<(const FXchar* s1,const FXString& s2) throw();
00751 
00752 extern FXAPI bool operator<=(const FXString& s1,const FXString& s2) throw();
00753 extern FXAPI bool operator<=(const FXString& s1,const FXchar* s2) throw();
00754 extern FXAPI bool operator<=(const FXchar* s1,const FXString& s2) throw();
00755 
00756 extern FXAPI bool operator>(const FXString& s1,const FXString& s2) throw();
00757 extern FXAPI bool operator>(const FXString& s1,const FXchar* s2) throw();
00758 extern FXAPI bool operator>(const FXchar* s1,const FXString& s2) throw();
00759 
00760 extern FXAPI bool operator>=(const FXString& s1,const FXString& s2) throw();
00761 extern FXAPI bool operator>=(const FXString& s1,const FXchar* s2) throw();
00762 extern FXAPI bool operator>=(const FXchar* s1,const FXString& s2) throw();
00763 
00764 extern FXAPI FXString operator+(const FXString& s1,const FXString& s2);
00765 
00766 extern FXAPI FXString operator+(const FXString& s1,const FXchar* s2);
00767 extern FXAPI FXString operator+(const FXString& s1,const FXwchar* s2);
00768 extern FXAPI FXString operator+(const FXString& s1,const FXnchar* s2);
00769 
00770 extern FXAPI FXString operator+(const FXchar* s1,const FXString& s2);
00771 extern FXAPI FXString operator+(const FXwchar* s1,const FXString& s2);
00772 extern FXAPI FXString operator+(const FXnchar* s1,const FXString& s2);
00773 
00774 extern FXAPI FXString operator+(const FXString& s,FXchar c);
00775 extern FXAPI FXString operator+(FXchar c,const FXString& s);
00776 
00777 extern FXAPI FXString FXStringFormat(const FXchar* fmt,...) FX_PRINTF(1,2) ;
00778 extern FXAPI FXString FXStringVFormat(const FXchar* fmt,va_list args);
00779 
00780 extern FXAPI FXString FXStringVal(FXint num,FXint base=10);
00781 extern FXAPI FXString FXStringVal(FXuint num,FXint base=10);
00782 extern FXAPI FXString FXStringVal(FXlong num,FXint base=10);
00783 extern FXAPI FXString FXStringVal(FXulong num,FXint base=10);
00784 extern FXAPI FXString FXStringVal(FXfloat num,FXint prec=6,FXint exp=MAYBE);
00785 extern FXAPI FXString FXStringVal(FXdouble num,FXint prec=6,FXint exp=MAYBE);
00786 
00787 extern FXAPI FXint FXIntVal(const FXString& s,FXint base=10);
00788 extern FXAPI FXuint FXUIntVal(const FXString& s,FXint base=10);
00789 extern FXAPI FXlong FXLongVal(const FXString& s,FXint base=10);
00790 extern FXAPI FXulong FXULongVal(const FXString& s,FXint base=10);
00791 extern FXAPI FXfloat FXFloatVal(const FXString& s);
00792 extern FXAPI FXdouble FXDoubleVal(const FXString& s);
00793 
00794 extern FXAPI FXString fromAscii(const FXString& s);
00795 extern FXAPI FXString toAscii(const FXString& s);
00796 
00797 extern FXAPI FXString escape(const FXString& s);
00798 extern FXAPI FXString unescape(const FXString& s);
00799 
00800 extern FXAPI FXString normalize(const FXString& s);
00801 extern FXAPI FXString decompose(const FXString& s,FXuint kind);
00802 extern FXAPI FXString compose(const FXString& s,FXuint kind);
00803 
00804 extern FXAPI FXString& unixToDos(FXString& str);
00805 extern FXAPI FXString& dosToUnix(FXString& str);
00806 
00808 typedef FXString QString;
00809 
00810 }
00811 
00812 #endif

(C) 2002-2009 Niall Douglas. Some parts (C) to assorted authors.
Generated on Fri Nov 20 18:31:24 2009 for TnFOX by doxygen v1.4.7