CAVE: The description of the memberfunctions is very sparse in the moment. It will be extended in the next version of the help file. The list of memberfunctions is complete.
wxString::wxString
wxString::~wxString
wxString::Alloc
wxString::Allocation
wxString::Append
wxString::After
wxString::At
wxString::Before
wxString::Capitalize
wxString::Cat
wxString::Chars
wxString::CompareTo
wxString::Contains
wxString::Copy
wxString::Del
wxString::DownCase
wxString::Elem
wxString::Empty
wxString::Error
wxString::First
wxString::Firstchar
wxString::Freq
wxString::From
wxString::GetData
wxString::GSub
wxString::Index
wxString::Insert
wxString::IsAscii
wxString::IsDefined
wxString::IsNull
wxString::IsNumber
wxString::IsWord
wxString::Last
wxString::Lastchar
wxString::Length
wxString::LowerCase
wxString::Matches
wxString::OK
wxString::Prepend
wxString::Readline
wxString::Remove
wxString::Replace
wxString::Replicate
wxString::Reverse
wxString::sprintf
wxString::Strip
wxString::SubString
wxString::Through
wxString::Upcase
wxString::UpperCase
wxString::operator =
wxString::operator +=
wxString::operator []
wxString::operator ()
wxString::operator <<
wxString::operator >>
wxString::operator const char *
wxCHARARG
CommonPrefix
CommonSuffix
Compare
FCompare
Comparison operators
operator +
Join
Split
void wxString(void)
void wxString(const wxString& x)
void wxString(const wxSubString& x)
void wxString(const char* t)
void wxString(const char* t, int len)
void wxString(char c)
Constructors.
void ~wxString(void)
String destructor.
void Alloc(int newsize)
Preallocate some space for wxString.
int Allocation(void) const
Report current allocation (not length!).
wxString& Append(const char* cs)
wxString& Append(const wxString& s)
Concatenation.
wxString& Append(char c, int rep = 1)
Append c, rep times
wxSubString After(int pos)
wxSubString After(const wxString& x, int startpos = 0)
wxSubString After(const wxSubString& x, int startpos = 0)
wxSubString After(const char* t, int startpos = 0)
wxSubString After(char c, int startpos = 0)
wxSubString After(const wxRegex& r, int startpos = 0)
wxSubString At(int pos, int len)
wxSubString operator ()(int pos, int len)
wxSubString At(const wxString& x, int startpos = 0)
wxSubString At(const wxSubString& x, int startpos = 0)
wxSubString At(const char* t, int startpos = 0)
wxSubString At(char c, int startpos = 0)
wxSubString At(const wxRegex& r, int startpos = 0)
wxSubString extraction.
Note that you can't take a substring of a const wxString, since this leaves open the possiblility of indirectly modifying the wxString through the wxSubString.
wxSubString Before(int pos)
wxSubString Before(const wxString& x, int startpos = 0)
wxSubString Before(const wxSubString& x, int startpos = 0)
wxSubString Before(const char* t, int startpos = 0)
wxSubString Before(char c, int startpos = 0)
wxSubString Before(const wxRegex& r, int startpos = 0)
void Capitalize(void)
friend wxString Capitalize(wxString& x)
friend void Cat(const wxString& a, const wxString& b, wxString& c)
friend void Cat(const wxString& a, const wxSubString& b, wxString& c)
friend void Cat(const wxString& a, const char* b, wxString& c)
friend void Cat(const wxString& a, char b, wxString& c)
friend void Cat(const wxSubString& a, const wxString& b, wxString& c)
friend void Cat(const wxSubString& a, const wxSubString& b, wxString& c)
friend void Cat(const wxSubString& a, const char* b, wxString& c)
friend void Cat(const wxSubString& a, char b, wxString& c)
friend void Cat(const char* a, const wxString& b, wxString& c)
friend void Cat(const char* a, const wxSubString& b, wxString& c)
friend void Cat(const char* a, const char* b, wxString& c)
friend void Cat(const char* a, char b, wxString& c)
Concatenate first two arguments, store the result in the last argument.
friend void Cat(const wxString& a, const wxString& b, const wxString& c, wxString& d)
friend void Cat(const wxString& a, const wxString& b, const wxSubString& c, wxString& d)
friend void Cat(const wxString& a, const wxString& b, const char* c, wxString& d)
friend void Cat(const wxString& a, const wxString& b, char c, wxString& d)
friend void Cat(const wxString& a, const wxSubString& b, const wxString& c, wxString& d)
friend void Cat(const wxString& a, const wxSubString& b, const wxSubString& c, wxString& d)
friend void Cat(const wxString& a, const wxSubString& b, const char* c, wxString& d)
friend void Cat(const wxString& a, const wxSubString& b, char c, wxString& d)
friend void Cat(const wxString& a, const char* b, const wxString& c, wxString& d)
friend void Cat(const wxString& a, const char* b, const wxSubString& c, wxString& d)
friend void Cat(const wxString& a, const char* b, const char* c, wxString& d)
friend void Cat(const wxString& a, const char* b, char c, wxString& d)
friend void Cat(const char* a, const wxString& b, const wxString& c, wxString& d)
friend void Cat(const char* a, const wxString& b, const wxSubString& c, wxString& d)
friend void Cat(const char* a, const wxString& b, const char* c, wxString& d)
friend void Cat(const char* a, const wxString& b, char c, wxString& d)
friend void Cat(const char* a, const wxSubString& b, const wxString& c, wxString& d)
friend void Cat(const char* a, const wxSubString& b, const wxSubString& c, wxString& d)
friend void Cat(const char* a, const wxSubString& b, const char* c, wxString& d)
friend void Cat(const char* a, const wxSubString& b, char c, wxString& d)
friend void Cat(const char* a, const char* b, const wxString& c, wxString& d)
friend void Cat(const char* a, const char* b, const wxSubString& c, wxString& d)
friend void Cat(const char* a, const char* b, const char* c, wxString& d)
friend void Cat(const char* a, const char* b, char c, wxString& d)
Double concatenation, by request. (Yes, there are too many versions, but if one is supported, then the others should be too). Concatenate the first 3 args, store the result in the last argument.
const char* Chars(void) const
Conversion.
#define NO_POS ((int)(-1)) // undefined position enum CaseCompare {exact, ignoreCase};int CompareTo(const char* cs, CaseCompare cmp = exact) const
Bool Contains(char c) const
Bool Contains(const wxString& y) const
Bool Contains(const wxSubString& y) const
Bool Contains(const char* t) const
Bool Contains(const wxRegex& r) const
Return 1 if target appears anyhere in wxString; else 0.
Bool Contains(const char* pat, CaseCompare cmp) const
Bool Contains(const wxString& pat, CaseCompare cmp) const
Case dependent/independent variation .
Bool Contains(char c, int pos) const
Bool Contains(const wxString& y, int pos) const
Bool Contains(const wxSubString& y, int pos) const
Bool Contains(const char* t, int pos) const
Bool Contains(const wxRegex& r, int pos) const
Return 1 if the target appears anywhere after position pos (or before, if pos is negative) in wxString; else 0.
wxString Copy(void) const
Duplication.
wxString& Del(int pos, int len)
Delete len characters starting at pos.
wxString& Del(const wxString& y, int startpos = 0)
wxString& Del(const wxSubString& y, int startpos = 0)
wxString& Del(const char* t, int startpos = 0)
wxString& Del(char c, int startpos = 0)
wxString& Del(const wxRegex& r, int startpos = 0)
Delete the first occurrence of target after startpos.
void Downcase(void)
friend wxString Downcase(wxString& x)
char Elem(int i) const
Element extraction.
int Empty(void) const
void Error(const char* msg) const
int First(char c) const
int First(const char* cs) const
int First(const wxString& cs) const
Return first or last occurrence of item.
Element extraction.
int Freq(char c) const
int Freq(const wxString& y) const
int Freq(const wxSubString& y) const
int Freq(const char* t) const
Return number of occurrences of target in wxString.
wxSubString From(int pos)
wxSubString From(const wxString& x, int startpos = 0)
wxSubString From(const wxSubString& x, int startpos = 0)
wxSubString From(const char* t, int startpos = 0)
wxSubString From(char c, int startpos = 0)
wxSubString From(const wxRegex& r, int startpos = 0)
char* GetData(void)
wxWindows compatibility conversion.
Global substitution: substitute all occurrences of pat with repl, returning the number of matches.
int Index(char c, int startpos = 0) const
int Index(const wxString& y, int startpos = 0) const
int Index(const wxString& y, int startpos, CaseCompare cmp) const
int Index(const wxSubString& y, int startpos = 0) const
int Index(const char* t, int startpos = 0) const
int Index(const char* t, int startpos, CaseCompare cmp) const
int Index(const wxRegex& r, int startpos = 0) const
Return the position of target in string, or -1 for failure.
wxString& Insert(int pos, const char* s)
wxString& Insert(int pos, const wxString& s)
Insertion.
int IsAscii(void) const
Classification (should be capital, because of ctype.h macros).
int IsDefined(void) const
Classification (should be capital, because of ctype.h macros).
int IsNull(void) const
Classification (should be capital, because of ctype.h macros).
int IsNumber(void) const
Classification (should be capital, because of ctype.h macros).
int IsWord(void) const
Classification (should be capital, because of ctype.h macros).
int Last(char c) const
int Last(const char* cs) const
int Last(const wxString& cs) const
First or last occurrence of item.
char Lastchar(void) const
Element extraction.
unsigned int Length(void) const
void LowerCase(void)
Bool Matches(char c, int pos = 0) const
Bool Matches(const wxString& y, int pos = 0) const
Bool Matches(const wxSubString& y, int pos = 0) const
Bool Matches(const char* t, int pos = 0) const
Bool Matches(const wxRegex& r, int pos = 0) const
Return 1 if target appears at position pos in wxString; else 0.
int OK(void) const
wxString& Prepend(const wxString& y)
wxString& Prepend(const wxSubString& y)
wxString& Prepend(const char* t)
wxString& Prepend(char c)
Prepend.
wxString& Prepend(char c, int rep=1)
Prepend c, rep times.
friend int Readline(istream& s, wxString& x,
char terminator = '\n',
int discard_terminator = 1)
friend int Readline(FILE * f, wxString& x,
char terminator = '\n',
int discard_terminator = 1)
wxString& RemoveLast(void)
wxString& Remove(int pos)
wxString& Remove(int pos, int len)
Remove pos to end of string.
wxString& Replace(int pos, int n, const char* s)
wxString& Replace(int pos, int n, const wxString& s)
friend wxString Replicate(char c, int n)
friend wxString Replicate(const wxString& y, int n)
Replication.
void Reverse(void)
friend wxString Reverse(wxString& x)
Formatted assignment. We do not use the 'sprintf' constructor anymore, because with that constructor, every initialisation with a string would go through sprintf and this is not desirable, because sprintf interprets some characters. With the above function we can write:
wxString msg; msg.sprintf("Processing item %d\n", count);
enumStripType {leading = 0x1, trailing = 0x2, both = 0x3};wxSubString Strip(StripType s = trailing, char c = ' ')
Strip characterss at the front and/or end. StripType is defined for bitwise ORing.
wxString SubString(int from, int to)
Edward Zimmermann's additions.
wxSubString Through(int pos)
wxSubString Through(const wxString& x, int startpos = 0)
wxSubString Through(const wxSubString& x, int startpos = 0)
wxSubString Through(const char* t, int startpos = 0)
wxSubString Through(char c, int startpos = 0)
wxSubString Through(const wxRegex& r, int startpos = 0)
void Upcase(void)
friend wxString Upcase(wxString& x)
void UpperCase(void)
wxString& operator =(const wxString& y)
wxString& operator =(const char* y)
wxString& operator =(char c)
wxString& operator =(const wxSubString& y)
Assignment.
wxString& operator +=(const wxString& y)
wxString& operator +=(const wxSubString& y)
wxString& operator +=(const char* t)
wxString& operator +=(char c)
Concatenation.
char& operator [](int i)
Element extraction.
char& operator ()(int i)
Conversion.
#define wxCHARARG(s) ((char *)(s).Chars())Here is a very, very, very ugly macro, but it makes things more transparent in cases, where a library function requires a (char *) argument. This is especially the case in wxWindows, where all char-arguments are (char *) and not (const char *). This macro should only be used in such cases and NOT to modify the internal data. The conventional way would be 'function((char *)string.Chars())'. With the wxCHARARG macro, this can be achieved by 'function(wxCHARARG(string))'. This makes it clearer that the usage should be confined to arguments.
friend wxString CommonPrefix(const wxString& x, const wxString& y,
int startpos = 0)
friend wxString CommonSuffix(const wxString& x, const wxString& y,
int startpos = -1)
int Compare(const wxString& x, const wxString& y)
int Compare(const wxString& x, const wxSubString& y)
int Compare(const wxString& x, const char* y)
int Compare(const wxSubString& x, const wxString& y)
int Compare(const wxSubString& x, const wxSubString& y)
int Compare(const wxSubString& x, const char* y)
Case dependent comparison. Returns 0 if the match succeeded.
int FCompare(const wxString& x, const wxString& y)
Case independent comparison. Returns 0 if the match succeeded.
int operator ==(const wxString& x, const wxString& y)
int operator !=(const wxString& x, const wxString& y)
int operator >(const wxString& x, const wxString& y)
int operator >=(const wxString& x, const wxString& y)
int operator <(const wxString& x, const wxString& y)
int operator <=(const wxString& x, const wxString& y)
int operator ==(const wxString& x, const wxSubString& y)
int operator !=(const wxString& x, const wxSubString& y)
int operator >(const wxString& x, const wxSubString& y)
int operator >=(const wxString& x, const wxSubString& y)
int operator <(const wxString& x, const wxSubString& y)
int operator <=(const wxString& x, const wxSubString& y)
int operator ==(const wxString& x, const char* t)
int operator !=(const wxString& x, const char* t)
int operator >(const wxString& x, const char* t)
int operator >=(const wxString& x, const char* t)
int operator <(const wxString& x, const char* t)
int operator <=(const wxString& x, const char* t)
int operator ==(const wxSubString& x, const wxString& y)
int operator !=(const wxSubString& x, const wxString& y)
int operator >(const wxSubString& x, const wxString& y)
int operator >=(const wxSubString& x, const wxString& y)
int operator <(const wxSubString& x, const wxString& y)
int operator <=(const wxSubString& x, const wxString& y)
int operator ==(const wxSubString& x, const wxSubString& y)
int operator !=(const wxSubString& x, const wxSubString& y)
int operator >(const wxSubString& x, const wxSubString& y)
int operator >=(const wxSubString& x, const wxSubString& y)
int operator <(const wxSubString& x, const wxSubString& y)
int operator <=(const wxSubString& x, const wxSubString& y)
int operator ==(const wxSubString& x, const char* t)
int operator !=(const wxSubString& x, const char* t)
int operator >(const wxSubString& x, const char* t)
int operator >=(const wxSubString& x, const char* t)
int operator <(const wxSubString& x, const char* t)
int operator <=(const wxSubString& x, const char* t)
wxString operator +(const wxString& x, const wxString& y)
wxString operator +(const wxString& x, const wxSubString& y)
wxString operator +(const wxString& x, const char* y)
wxString operator +(const wxString& x, char y)
wxString operator +(const wxSubString& x, const wxString& y)
wxString operator +(const wxSubString& x, const wxSubString& y)
wxString operator +(const wxSubString& x, const char* y)
wxString operator +(const wxSubString& x, char y)
wxString operator +(const char* x, const wxString& y)
wxString operator +(const char* x, const wxSubString& y)
friend wxString Join(wxString src[], int n, const wxString& sep)
friend int Split(const wxString& x, wxString res[], int maxn,
const wxString& sep)
friend int Split(const wxString& x, wxString res[], int maxn,
const wxRegex& sep)
Split string into array res at separators; return number of elements