MT::String Class Reference
#include <std.h>
List of all members.
Detailed Description
String implements the functionalities of an ostream and an istream, but also can be send to an ostream or read from an istream.
It is based on a simple streambuf derived from the MT::Mem class
Definition at line 644 of file std.h.
Public Member Functions
-
String ()
- standard constructor
-
String (const String &s)
- copy constructor
-
String (const char *s)
- copy constructor for an ordinary C-string (needs to be 0-terminated)
-
IOStream & str ()
- returns a reference to this
-
operator char * ()
- returns the true memory buffer (C-string) of this class (which is always kept 0-terminated)
-
operator const char * () const
- as above but const
-
char * ptr ()
- also returns the char-pointer
-
char operator() (uint i)
- returns the i-th char
-
void operator= (const String &s)
- copy operator
-
void operator= (const char *s)
- copies from the C-string
-
bool operator== (const char *s)
- shorthand for the !strcmp command
-
bool operator== (const String &s)
- shorthand for the !strcmp command
-
String & clr ()
- deletes all memory and resets all stream flags
-
String & resetI ()
- when using this String as an istream (to read other variables from it), this method resets the reading-pointer to the beginning of the string and also clears all flags of the stream
-
char * getIpos ()
-
void setIpos (char *p)
-
uint N () const
- returns the length of the string (excluding the terminating 0)
-
template<class T> String operator+ (const T &v) const
- appends some other text/variable/whatever to the string (as if piped into it)
-
void write (std::ostream &os) const
- writes the string into some ostream
-
void read (std::istream &is, char *stopSymbols="\n\r")
- reads the string from some istream until one of the stopSymbols is encountered (default: newline symbols)
Public Attributes
The documentation for this class was generated from the following file:
[]