|
|
Dynamic shared String
String (size_t size = 0) |
construct an empty String of a given size
Parameters:
size | pre-allocation size for this |
String (const char *str, int len=0) |
construct a String from a prefix of a char*
Parameters:
str | char* for initial value |
size | substring size (0 == rest) |
String (const String *str, size_t start=0, size_t l=0) |
construct a String from a substring of a String*
Parameters:
str | char* for initial value |
size | substring size (0 == rest) |
String (const String &str, size_t start=0, size_t l=0) |
construct a String from a substring of a String&
Parameters:
str | char* for initial value |
size | substring size (0 == rest) |
~String () |
destroy String
void check (int=0) |
check String integrity
Checks memory Guard (if any) and that string content is entirely within its allocation
Data * clone (void *where = (void*) |
copy constructor
Used as the destination of @see mutate when a copy on write mutable object is desired.
Parameters:
where | the locale into which to clone this object |
Returns: mutable copy of object
Data * mutate (void *where = (void*) |
create a mutable copy
Parameters:
where | the locale into which to clone this object |
Returns: mutable copy of object
bool truth () |
the String's truth value
We consider a String to be true if it's not empty
Returns: the object's truth value
Slot toconstruct () |
constructor arguments sufficient to recreate object
String is a basic type: it is its own constructor
Returns: identity
ostream & dump (ostream&) |
dump the String to a stream
Parameters:
ostream | stream onto which to dump the object |
int order (const Slot &arg) |
order two Strings
Parameters:
arg | String to be ordered relative to this |
Returns: 1,0,-1 depending on String order
bool equal (const Slot &arg) |
equality operator
Parameters:
arg | String to be compared to this |
Returns: true/false depending on equality
bool isSequence () |
predicate - is a String a sequence?
Returns: constant true
int length () |
String length
Returns: length of String
Slot concat (const Slot &arg) |
concatenate two Strings
Parameters:
arg | String to concatenate to this |
Returns: a String with arg concatenated to this
Slot slice (const Slot &start, const Slot &len) |
substring of String
Note that we use copy-on-write, so a substring points into the same storage as the string it's a substring of.
Parameters:
start | index of start of substring |
len | length of substring |
Returns: the range of elements of this sequence 'from' for 'len'
Slot slice (const Slot &start) |
element of String
Note that we use copy-on-write, so a substring points into the same storage as the string it's a substring of.
Parameters:
start | index of start of substring |
len | length of substring |
Returns: a string containing the single character at start
Slot replace (const Slot &from, const Slot &len, const Slot &value) |
replace a String subrange with a String
Parameters:
from | replacement-range start index |
len | replacement-range length |
Returns: a copy of this with the replacement performed
Slot replace (const Slot &from, const Slot &val) |
replace a String element with a String
Parameters:
from | replacement-range start index |
Returns: a copy of this with the replacement performed
Slot insert (const Slot &from, const Slot &val) |
insert a String into this String at a given position
Parameters:
value | value to be inserted in this sequence |
before | element index before which insertion is performed |
Returns: a copy of this with the replacement performed
Slot insert (const Slot &val) |
insert a String at the end of this String
This is really redundant with String::insert
Parameters:
value | value to be inserted in this String |
Returns: a copy of this with the replacement performed
Slot del (const Slot &from, const Slot &len) |
delete a substring from this String
Parameters:
from | del-range start index |
len | del-range length |
Returns: a copy of this with the deletion performed
Slot del (const Slot &from) |
delete an element from this String
Parameters:
from | del-element index |
Returns: a copy of this with the deletion performed
Slot search (const Slot &search) |
search for a matching substring
Parameters:
search | element for which to search |
Returns: the first of this String with search as a prefix
Slot iterator () |
Iterator over this sequence - identity
Returns: an Iterator
Slot toSequence () |
convert String to sequence - identity
bool More () |
predicate: is iterated sequence complete?
Returns: true iff iterator is not exhausted
Slot Current () |
current iterated element
Returns: iterated element
Slot Next () |
advance iterator over sequence
Returns: next iterated element
operator char * () |
convert to a C string
String * crypt (Slot &key) |
encrypt String
String * uppercase () |
convert String to upper case
String * lowercase () |
convert String to lower case
Generated by: colin@sharedtech.dhis.org on Sat Nov 6 11:59:24 199. |