infinite length string class.
![]() | EMPTY the empty string |
![]() | string () create empty string. |
![]() | string (const string &s) copy constructor. usage: string x = string |
![]() | string (const char* s) copy constructor. usage: string x = "abc" |
![]() | string (char c) copy constructor. usage: string x = 'a' |
![]() | string (int n) copy constructor (decimals). usage: string x = 12; |
![]() | string (unsigned n) copy constructor (decimals). usage: string x = 12; |
![]() | string (double d) copy constructor (doubles). usage: string x = 1.2; |
![]() | ~string () delete string. |
![]() | operator= (const string &s) copy operator a la strcpy. |
![]() | operator= (const char* s) copy operator a la strcpy. |
![]() | operator= (char c) copy operator a la strcpy. |
![]() | operator= (int n) copy operator a la strcpy. s = n in decimal notation. |
![]() | operator= (unsigned n) copy operator a la strcpy. s = n in decimal notation. |
![]() | operator= (double d) copy operator a la strcpy. s = d in floating point notation. |
![]() | operator+= (const string &s) concat operator a la strcat. |
![]() | operator+= (const char* s) concat operator a la strcat. |
![]() | operator+= (int n) concat. n in decimal notation is added. |
![]() | operator+= (unsigned n) concat. n in decimal notation is added. |
![]() | operator+= (double d) concat. d in floating point notation is added. |
![]() | operator+= (char c) concat operator a la strcat. |
![]() | operator+ (const char* s1, const string &s2) constructive concat operator. |
![]() | operator+ (const string &s1, const char* s2) constructive concat operator. |
![]() | operator+ (const string &s) constructive concat operator. |
![]() | operator+ (const char* s) constructive concat operator. |
![]() | add (char c) add c at end of string. |
![]() | insert (char c, int pos) add character at n-th position of string. |
![]() | contains (const string &s) const return 1 if target is in string. 0 for failure. |
![]() | contains (const char* s) const return 1 if target is in string. 0 for failure. |
![]() | contains (char c) const return 1 if target is in string. 0 for failure. |
![]() | startsWith (const string &s) const return 1 if string starts with target, 0 for failure. |
![]() | startsWith (const char* s) const return 1 if string starts with target, 0 for failure. |
![]() | endsWith (const string &s) const return 1 if string ends with target, 0 for failure. |
![]() | endsWith (const char* s) const return 1 if string ends with target, 0 for failure. |
![]() | setSuffix (const string &s, char delim = '.') adds suffix s. return 1 when suffix is changed, 0 when only added. |
![]() | getSuffix (string &s, char delim = '.') const puts suffix in s. when there is no suffix returns 0, 1 otherwise. |
![]() | operator[] (int i) selection of char by index a la array. |
![]() | operator[] (int i) const selection of char by index a la array. |
![]() | remove () remove last character of string. |
![]() | remove (int pos) remove pos-th character of string. |
![]() | replace (char old, char nw) replace each occurence of old char by nw char . |
![]() | replace (const string &pat, const string &repl, int casesens=1) global substitution. |
![]() | replaceFirst (const string &pat, const string &repl, int casesens=1) first occurrence substitution. |
![]() | addPlural () add to word an english plural ending, like horse->horses, sky->skies. |
![]() | upcase (const string &s) move all chars to upper case |
![]() | downcase (const string &s) move all chars to lower case |
![]() | stripblanks (const string &s) strip all spurious blank chars. |
![]() | upcase () in-place version of the above. |
![]() | downcase () |
![]() | stripblanks () |
![]() | toulong () const |
![]() | tolong () const |
![]() | todouble () const |
![]() | toint () const |
![]() | length () const number of characters in string. |
![]() | lines () const the number of lines in string when printed: newlines+1. |
![]() | width () const return nr. of chars of line with most chars in string. |
![]() | whichline (int i, int &pos) const return which line has i-th char. pos becomes position in line. |
![]() | nthInline (int line, int n) const return position of n-th char in line-th line. |
![]() | letters () const return number of letters (a-z,A-Z) in string. |
![]() | setPrecision (unsigned p) set precision when string is interpreted as double. |
![]() | operator<< (ostream &o, const string &s) write string to output stream. |
![]() | operator>> (istream &i, string &s) read string from input stream. |
![]() | operator== (const string &x, const char* s) comparison operator returns 1 if equal |
![]() | operator== (const string &x, const string &y) comparison operator returns 1 if equal. |
![]() | operator%= (const string &x, const char* s) comparison operator that ignores case |
![]() | operator%= (const string &x, const string &y) comparison operator that ignores case |
![]() | operator!= (const string &x, const char* s) comparison operator a la !equal. |
![]() | operator!= (const string &x, const string &y) comparison operator a la !equal. |
![]() | compare (const string &x, const char* s) comparison operator a la strcmp |
![]() | compare (const string &x, const string &y) comparison operator a la strcmp |
![]() | getstr () const return a const pointer to the data to do dirty stuff. |
![]() | doReplace (const string &pat, const string &repl, int global, int casesens=1) |
infinite length string class.
string()
string(const string &s)
string(const char* s)
string(char c)
string(int n)
string(unsigned n)
string(double d)
virtual ~string()
string& operator=(const string &s)
string& operator=(const char* s)
string& operator=(char c)
string& operator=(int n)
string& operator=(unsigned n)
string& operator=(double d)
string& operator+=(const string &s)
string& operator+=(const char* s)
string& operator+=(int n)
string& operator+=(unsigned n)
string& operator+=(double d)
string& operator+=(char c)
friend string operator+(const char* s1, const string &s2)
friend string operator+(const string &s1, const char* s2)
string operator+(const string &s)
string operator+(const char* s)
void add(char c)
void insert(char c, int pos)
int contains(const string &s) const
int contains(const char* s) const
int contains(char c) const
int startsWith(const string &s) const
int startsWith(const char* s) const
int endsWith(const string &s) const
int endsWith(const char* s) const
int setSuffix(const string &s, char delim = '.')
int getSuffix(string &s, char delim = '.') const
char& operator[](int i)
const char& operator[](int i) const
void remove()
void remove(int pos)
int replace(char old, char nw)
int replace(const string &pat, const string &repl, int casesens=1)
int replaceFirst(const string &pat, const string &repl, int casesens=1)
void addPlural()
friend string upcase(const string &s)
friend string downcase(const string &s)
friend string stripblanks(const string &s)
void upcase()
void downcase()
void stripblanks()
unsigned long toulong() const
long tolong() const
double todouble() const
int toint() const
unsigned length() const
unsigned lines() const
unsigned width() const
int whichline(int i, int &pos) const
int nthInline(int line, int n) const
unsigned letters() const
void setPrecision(unsigned p)
friend ostream& operator<<(ostream &o, const string &s)
friend istream& operator>>(istream &i, string &s)
friend int operator==(const string &x, const char* s)
friend int operator==(const string &x, const string &y)
friend int operator%=(const string &x, const char* s)
friend int operator%=(const string &x, const string &y)
friend int operator!=(const string &x, const char* s)
friend int operator!=(const string &x, const string &y)
friend int compare(const string &x, const char* s)
friend int compare(const string &x, const string &y)
const char* getstr() const
int doReplace(const string &pat, const string &repl, int global, int casesens=1)
alphabetic index hierarchy of classes
this page has been generated automatically by doc++
(c)opyright by Malte Zöckler, Roland Wunderling
contact: doc++@zib.de