GNativeString Class Reference
General purpose character string.
More...
#include <GString.h>
List of all members.
Detailed Description
General purpose character string.
Each instance of class GNativeString# represents a character string. Overloaded operators provide a value semantic to GNativeString# objects. Conversion operators and constructors transparently convert between GNativeString# objects and const char*# pointers.
Functions taking strings as arguments should declare their arguments as "#const char*#". Such functions will work equally well with GNativeString# objects since there is a fast conversion operator from GNativeString# to "#const char*#". Functions returning strings should return GUTF8String# or GNativeString# objects because the class will automatically manage the necessary memory.
Characters in the string can be identified by their position. The first character of a string is numbered zero. Negative positions represent characters relative to the end of the string (i.e. position #-1# accesses the last character of the string, position #-2# represents the second last character, etc.)
Definition at line 938 of file GString.h.
Constructor & Destructor Documentation
GNativeString::~GNativeString |
( |
|
) |
|
GNativeString::GNativeString |
( |
void |
|
) |
[inline] |
Null constructor.
Constructs an empty string.
Definition at line 1450 of file GString.h.
GNativeString::GNativeString |
( |
const char |
dat |
) |
[inline] |
Constructs a string from a character.
Definition at line 1464 of file GString.h.
GNativeString::GNativeString |
( |
const char * |
str |
) |
[inline] |
Constructs a string from a null terminated character array.
Definition at line 1468 of file GString.h.
GNativeString::GNativeString |
( |
const unsigned char * |
str |
) |
[inline] |
Constructs a string from a null terminated character array.
Definition at line 1472 of file GString.h.
GNativeString::GNativeString |
( |
const unsigned short * |
str |
) |
[inline] |
GNativeString::GNativeString |
( |
const unsigned long * |
str |
) |
[inline] |
GNativeString::GNativeString |
( |
const char * |
dat, |
|
|
unsigned int |
len | |
|
) |
| | [inline] |
Constructs a string from a character array.
Elements of the character array dat# are added into the string until the string length reaches len# or until encountering a null character (whichever comes first).
Definition at line 1484 of file GString.h.
GNativeString::GNativeString |
( |
const unsigned short * |
dat, |
|
|
unsigned int |
len | |
|
) |
| | [inline] |
GNativeString::GNativeString |
( |
const unsigned long * |
dat, |
|
|
unsigned int |
len | |
|
) |
| | [inline] |
GNativeString::GNativeString |
( |
const GP< GStringRep > & |
str |
) |
[inline] |
Construct from base class.
Definition at line 1460 of file GString.h.
GNativeString::GNativeString |
( |
const GBaseString & |
str |
) |
|
GNativeString::GNativeString |
( |
const GNativeString & |
str |
) |
[inline] |
GNativeString::GNativeString |
( |
const GBaseString & |
gs, |
|
|
int |
from, |
|
|
int |
len | |
|
) |
| | |
Constructs a string from a character array.
Elements of the character array dat# are added into the string until the string length reaches len# or until encountering a null character (whichever comes first).
GNativeString::GNativeString |
( |
const GNativeString & |
fmt, |
|
|
va_list & |
args | |
|
) |
| | [inline] |
Constructs a string with a formatted string (as in vprintf#).
The string is re-initialized with the characters generated according to the specified format fmt# and using the optional arguments. See the ANSI-C function vprintf()# for more information. The current implementation will cause a segmentation violation if the resulting string is longer than 32768 characters.
Definition at line 1508 of file GString.h.
GNativeString::GNativeString |
( |
const int |
number |
) |
[inline] |
Constructs a string with a human-readable representation of integer number#.
The format is similar to format #"%d"# in function printf#.
Definition at line 1500 of file GString.h.
GNativeString::GNativeString |
( |
const double |
number |
) |
[inline] |
Constructs a string with a human-readable representation of floating point number number#.
The format is similar to format #"%f"# in function printf#.
Definition at line 1504 of file GString.h.
The documentation for this class was generated from the following files: