Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members

FXString Class Reference

#include <FXString.h>

List of all members.

Public Methods

 FXString ()
 Create empty string.

 FXString (const FXString &s)
 Copy construct.

 FXString (const FXchar *s)
 Construct and init.

 FXString (const FXchar *s, FXint n)
 Construct and init with substring.

 FXString (FXchar c, FXint n)
 Construct and fill with constant.

 FXString (const FXchar *s1, const FXchar *s2)
 Construct string from two parts.

void size (FXint sz)
 Size to some desired capacity.

FXint size () const
 Size of text data, 0 for empty string.

FXint length () const
 Length of text.

const FXchar * text () const
 Get text contents.

FXbool empty () const
 See if string is empty.

FXchar & operator[] (FXint i)
 Return a non-const reference to the ith character.

const FXchar & operator[] (FXint i) const
 Return a const reference to the ith character.

FXString & operator= (const FXString &s)
 Assign another string to this.

FXString & operator= (const FXchar *s)
 Assign a C-style string to this.

FXString & fill (FXchar c, FXint n)
 Fill with a constant.

FXString & fill (FXchar c)
 Fill up to current length.

FXString & lower ()
 Convert to lower case.

FXString & upper ()
 Convert to upper case.

FXString extract (FXint part, FXchar delim) const
 Extract partition of delimiter separated string.

FXString extract (FXint part, FXchar delim, FXchar esc) const
 Extract partition of delimiter separated string.

FXString & insert (FXint pos, FXchar c)
 Insert character at specified position.

FXString & insert (FXint pos, FXchar c, FXint n)
 Insert n characters c at specified position.

FXString & insert (FXint pos, const FXchar *s, FXint n)
 Insert first n characters of string at specified position.

FXString & insert (FXint pos, const FXString &s)
 Insert string at specified position.

FXString & insert (FXint pos, const FXchar *s)
 Insert string at specified position.

FXString & prepend (FXchar c)
 Prepend string with input character.

FXString & prepend (FXchar c, FXint n)
 Prepend string with n characters c.

FXString & prepend (const FXchar *s, FXint n)
 Prepend string with first n characters of input string.

FXString & prepend (const FXString &s)
 Prepend string with input string.

FXString & prepend (const FXchar *s)
 Prepend string with input string.

FXString & append (FXchar c)
 Append input character to this string.

FXString & append (FXchar c, FXint n)
 Append input n characters c to this string.

FXString & append (const FXchar *s, FXint n)
 Append first n characters of input string to this string.

FXString & append (const FXString &s)
 Append input string to this string.

FXString & append (const FXchar *s)
 Append input string to this string.

FXString & replace (FXint pos, FXchar c)
 Replace a single character.

FXString & replace (FXint pos, FXint m, FXchar c, FXint n)
 Replace the m characters at pos with n characters c.

FXString & replace (FXint pos, FXint m, const FXchar *s, FXint n)
 Replaces the m characters at pos with first n characters of input string.

FXString & replace (FXint pos, FXint m, const FXString &s)
 Replace the m characters at pos with input string.

FXString & replace (FXint pos, FXint m, const FXchar *s)
 Replace the m characters at pos with input string.

FXString & remove (FXint pos, FXint n=1)
 Remove substring.

FXString & substitute (FXchar orig, FXchar sub)
 Substitute one character by another.

FXString & trim ()
 Remove leading and trailing whitespace.

FXString & trimBegin ()
 Remove leading whitespace.

FXString & trimEnd ()
 Remove trailing whitespace.

FXString & trunc (FXint pos)
 Truncate string at pos.

FXString & clear ()
 Clear.

FXString left (FXint n) const
 Get leftmost part.

FXString right (FXint n) const
 Get rightmost part.

FXString mid (FXint pos, FXint n) const
 Get some part in the middle.

FXString before (FXchar ch, FXint n=1) const
FXString after (FXchar ch, FXint n=1) const
FXint findf (FXchar c, FXint pos=0) const
 Find a character, searching forward; return position or -1.

FXint findb (FXchar c, FXint pos=2147483647) const
 Find a character, searching backward; return position or -1.

FXint findf (const FXchar *substr, FXint n, FXint pos) const
 Find a substring of length n, searching forward; return position or -1.

FXint findb (const FXchar *substr, FXint n, FXint pos) const
 Find a substring of length n, searching backward; return position or -1.

FXint findf (const FXchar *substr, FXint pos=0) const
 Find a substring, searching forward; return position or -1.

FXint findb (const FXchar *substr, FXint pos=2147483647) const
 Find a substring, searching backward; return position or -1.

FXint findf (const FXString &substr, FXint pos=0) const
 Find a substring, searching forward; return position or -1.

FXint findb (const FXString &substr, FXint pos=2147483647) const
 Find a substring, searching backward; return position or -1.

FXint count (FXchar c) const
 Find number of occurances of character in string.

FXString & format (const char *fmt,...) FX_PRINTF(2
 Format a string a-la printf.

FXString & vformat (const char *fmt, va_list args)
FXint scan (const char *fmt,...) const FX_SCANF(2
 Scan a string a-la scanf.

FXint vscan (const char *fmt, va_list args) const
FXint hash () const
 Get hash value.

FXString & operator+= (const FXString &s)
 Append operators.

FXString & operator+= (const FXchar *s)
FXString & operator+= (FXchar c)
 ~FXString ()
 Delete.


Static Public Attributes

const FXchar null [] = {0,0,0,0}
const FXchar hex [17] = "0123456789abcdef"
const FXchar HEX [17] = "0123456789ABCDEF"

Friends

FXAPI FXint compare (const FXchar *s1, const FXchar *s2)
 Compare.

FXAPI FXint compare (const FXchar *s1, const FXString &s2)
FXAPI FXint compare (const FXString &s1, const FXchar *s2)
FXAPI FXint compare (const FXString &s1, const FXString &s2)
FXAPI FXint compare (const FXchar *s1, const FXchar *s2, FXint n)
 Compare up to n.

FXAPI FXint compare (const FXchar *s1, const FXString &s2, FXint n)
FXAPI FXint compare (const FXString &s1, const FXchar *s2, FXint n)
FXAPI FXint compare (const FXString &s1, const FXString &s2, FXint n)
FXAPI FXint comparecase (const FXchar *s1, const FXchar *s2)
 Compare case insensitive.

FXAPI FXint comparecase (const FXchar *s1, const FXString &s2)
FXAPI FXint comparecase (const FXString &s1, const FXchar *s2)
FXAPI FXint comparecase (const FXString &s1, const FXString &s2)
FXAPI FXint comparecase (const FXchar *s1, const FXchar *s2, FXint n)
 Compare case insensitive up to n.

FXAPI FXint comparecase (const FXchar *s1, const FXString &s2, FXint n)
FXAPI FXint comparecase (const FXString &s1, const FXchar *s2, FXint n)
FXAPI FXint comparecase (const FXString &s1, const FXString &s2, FXint n)
FXAPI FXbool operator== (const FXString &s1, const FXString &s2)
 Comparison operators.

FXAPI FXbool operator== (const FXString &s1, const FXchar *s2)
FXAPI FXbool operator== (const FXchar *s1, const FXString &s2)
FXAPI FXbool operator!= (const FXString &s1, const FXString &s2)
FXAPI FXbool operator!= (const FXString &s1, const FXchar *s2)
FXAPI FXbool operator!= (const FXchar *s1, const FXString &s2)
FXAPI FXbool operator< (const FXString &s1, const FXString &s2)
FXAPI FXbool operator< (const FXString &s1, const FXchar *s2)
FXAPI FXbool operator< (const FXchar *s1, const FXString &s2)
FXAPI FXbool operator<= (const FXString &s1, const FXString &s2)
FXAPI FXbool operator<= (const FXString &s1, const FXchar *s2)
FXAPI FXbool operator<= (const FXchar *s1, const FXString &s2)
FXAPI FXbool operator> (const FXString &s1, const FXString &s2)
FXAPI FXbool operator> (const FXString &s1, const FXchar *s2)
FXAPI FXbool operator> (const FXchar *s1, const FXString &s2)
FXAPI FXbool operator>= (const FXString &s1, const FXString &s2)
FXAPI FXbool operator>= (const FXString &s1, const FXchar *s2)
FXAPI FXbool operator>= (const FXchar *s1, const FXString &s2)
FXAPI FXString operator+ (const FXString &s1, const FXString &s2)
 Concatenate two strings.

FXAPI FXString operator+ (const FXString &s1, const FXchar *s2)
FXAPI FXString operator+ (const FXchar *s1, const FXString &s2)
FXAPI FXString operator+ (const FXString &s, FXchar c)
 Concatenate with single character.

FXAPI FXString operator+ (FXchar c, const FXString &s)
FXAPI FXStreamoperator<< (FXStream &store, const FXString &s)
 Saving to a stream.

FXAPI FXStreamoperator>> (FXStream &store, FXString &s)
 Load from a stream.

FXAPI FXString FXStringFormat (const FXchar *fmt,...) FX_PRINTF(1
 Format a string a-la printf.

FXAPI FXString FXStringVFormat (const FXchar *fmt, va_list args)
FXAPI FXString FXStringVal (FXint num, FXint base=10)
FXAPI FXString FXStringVal (FXuint num, FXint base=10)
FXAPI FXString FXStringVal (FXfloat num, FXint prec=6, FXbool exp=MAYBE)
FXAPI FXString FXStringVal (FXdouble num, FXint prec=6, FXbool exp=MAYBE)
FXAPI FXint FXIntVal (const FXString &s, FXint base=10)
 Convert string to a integer number, assuming given number base.

FXAPI FXuint FXUIntVal (const FXString &s, FXint base=10)
FXAPI FXfloat FXFloatVal (const FXString &s)
 Convert string into real number.

FXAPI FXdouble FXDoubleVal (const FXString &s)


Detailed Description

FXString provides essential string manipulation capabilities.


Member Function Documentation

FXString FXString::before FXchar    ch,
FXint    n = 1
const
 

Return all characters before the n-th occurrence of ch, counting from the beginning of the string if n>0, or from the end if n<0. If the character ch is not found, the entire string, or the empty string, is returned, respectively. A NULL string is returned if n==0.

FXString FXString::after FXchar    ch,
FXint    n = 1
const
 

Return all characters after the nth occurrence of ch, counting from the beginning of the string if n>0, or from the end if n<0. If the character ch is not found, the empty string, or the entire string, is returned, respectively. A NULL string is returned if n==0.


Friends And Related Function Documentation

FXAPI FXString FXStringVal FXint    num,
FXint    base = 10
[friend]
 

Convert integer number to a string, using the given number base, which must be between 2 and 16.

FXAPI FXString FXStringVal FXfloat    num,
FXint    prec = 6,
FXbool    exp = MAYBE
[friend]
 

Convert real number to a string, using the given procision and exponential notation mode, which may be FALSE (never), TRUE (always), or MAYBE (when needed).