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

FX::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 length (FXint len)
 Change the length of the string to len.

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 section (FXchar delim, FXint start, FXint num=1) const
 Return num partition(s) of string separated by delimiter delim.

FXString section (const FXchar *delim, FXint n, FXint start, FXint num=1) const
 Return num partition(s) of string separated by delimiters in delim.

FXString section (const FXchar *delim, FXint start, FXint num=1) const
 Return num partition(s) of string separated by delimiters in delim.

FXString section (const FXString &delim, FXint start, FXint num=1) const
 Return num partition(s) of string separated by delimiters in delim.

FXString & assign (FXchar c)
 Assign character c to this string.

FXString & assign (FXchar c, FXint n)
 Assign n characters c to this string.

FXString & assign (const FXchar *s, FXint n)
 Assign first n characters of string s to this string.

FXString & assign (const FXString &s)
 Assign string s to this string.

FXString & assign (const FXchar *s)
 Assign string s to this 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 & simplify ()
 Simplify whitespace in string.

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 rbefore (FXchar ch, FXint n=1) const
FXString after (FXchar ch, FXint n=1) const
FXString rafter (FXchar ch, FXint n=1) const
FXint find (FXchar c, FXint pos=0) const
 Find a character, searching forward; return position or -1.

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

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

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

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

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

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

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

FXint find_first_of (const FXchar *set, FXint n, FXint pos) const
 Find first character in the set of size n, starting from pos; return position or -1.

FXint find_first_of (const FXchar *set, FXint pos=0) const
 Find first character in the set, starting from pos; return position or -1.

FXint find_first_of (const FXString &set, FXint pos=0) const
 Find first character in the set, starting from pos; return position or -1.

FXint find_first_of (FXchar c, FXint pos=0) const
 Find first character, starting from pos; return position or -1.

FXint find_last_of (const FXchar *set, FXint n, FXint pos) const
 Find last character in the set of size n, starting from pos; return position or -1.

FXint find_last_of (const FXchar *set, FXint pos=2147483647) const
 Find last character in the set, starting from pos; return position or -1.

FXint find_last_of (const FXString &set, FXint pos=2147483647) const
 Find last character in the set, starting from pos; return position or -1.

FXint find_last_of (FXchar c, FXint pos=0) const
 Find last character, starting from pos; return position or -1.

FXint find_first_not_of (const FXchar *set, FXint n, FXint pos) const
 Find first character NOT in the set of size n, starting from pos; return position or -1.

FXint find_first_not_of (const FXchar *set, FXint pos=0) const
 Find first character NOT in the set, starting from pos; return position or -1.

FXint find_first_not_of (const FXString &set, FXint pos=0) const
 Find first character NOT in the set, starting from pos; return position or -1.

FXint find_first_not_of (FXchar c, FXint pos=0) const
 Find first character NOT equal to c, starting from pos; return position or -1.

FXint find_last_not_of (const FXchar *set, FXint n, FXint pos) const
 Find last character NOT in the set of size n, starting from pos; return position or -1.

FXint find_last_not_of (const FXchar *set, FXint pos=2147483647) const
 Find last character NOT in the set, starting from pos; return position or -1.

FXint find_last_not_of (const FXString &set, FXint pos=2147483647) const
 Find last character NOT in the set, starting from pos; return position or -1.

FXint find_last_not_of (FXchar c, FXint pos=0) const
 Find last character NOT equal to c, starting from pos; 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
FXuint 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] = {'0','1','2','3','4','5','6','7','8','9','a','b','c','d','e','f',0}
const FXchar HEX [17] = {'0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F',0}

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)
FXAPI FXString escape (const FXString &s)
 Escape special characters in a string.

FXAPI FXString unescape (const FXString &s)
 Unescape special characters in a string.

FXAPI void swap (FXString &a, FXString &b)
 Swap two strings.


Detailed Description

FXString provides essential string manipulation capabilities.


Member Function Documentation

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

Return all characters before the n-th occurrence of ch, searching from the beginning of the string. If the character is not found, return the entire string. If n<=0, return the empty string.

FXString FX::FXString::rbefore FXchar    ch,
FXint    n = 1
const
 

Return all characters before the n-th occurrence of ch, searching from the end of the string. If the character is not found, return the empty string. If n<=0, return the entire string.

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

Return all characters after the nth occurrence of ch, searching from the beginning of the string. If the character is not found, return the empty string. If n<=0, return the entire string.

FXString FX::FXString::rafter FXchar    ch,
FXint    n = 1
const
 

Return all characters after the nth occurrence of ch, searching from the end of the string. If the character is not found, return the entire string. If n<=0, return the empty string.


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).