#include <skString.h>
Public Member Functions | |
| skString () | |
| Default Constructor - constructs a blank string. | |
| skString (const skString &) | |
| Copy Constructor. | |
| skString (const Char *) | |
| Constructor - from a null-terminated c-string. | |
| skString (const Char *buffer, USize len) | |
| Constructor - from a non null-terminated buffer. | |
| skString (const Char repeatChar, USize len) | |
| Constructor - a repeated list of characters. | |
| virtual | ~skString () |
| Destructor. | |
| skString & | operator= (const skString &) |
| Assignment operator - increments reference count of underlying P_String object. | |
| skString & | operator= (Char c) |
| Assigns a character. | |
| skString & | operator= (const Char *) |
| Assignment operator - dereferences the P_String object and makes a new one by copying the given buffer. | |
| bool | operator< (const skString &) const |
| Comparison operator. | |
| bool | operator== (const skString &) const |
| Equality operator. | |
| bool | operator== (const Char *) const |
| Equality operator. | |
| bool | operator!= (const skString &) const |
| Inequality operator. | |
| bool | operator!= (const Char *) const |
| Inequality operator. | |
| operator const Char * () const | |
| Conversion operator. | |
| const Char * | ptr () const |
| Accesses underlying buffer. | |
| const Char * | c_str () const |
| Accesses underlying buffer. | |
| bool | equalsIgnoreCase (const skString &) const |
| Case-insensitive equality. | |
| USize | hash () const |
| Returns a hash value for this string. | |
| Char | at (USize index) const |
| Returns a character within the string. | |
| skString | substr (USize start, USize length) const |
| Returns a substring of this string. | |
| skString | substr (USize start) const |
| Returns the substring from the start up to the end of the current string. | |
| skString | operator+ (const skString &) const |
| Addition operator. | |
| skString & | operator+= (const skString &) |
| Increment operator - dereferences the P_String object, and replaces it with the concatenation of this string and the other one. | |
| USize | length () const |
| Length of the string. | |
| int | indexOf (const skString &s) const |
| returns the index of the first occurrence of the given string within the string | |
| int | indexOf (Char c) const |
| returns the index of the first occurrence of the given character within the string | |
| int | indexOfLast (Char c) const |
| returns the index of the last occurrence of the given character within the string | |
| int | to () const |
| Converts the string to an integer. | |
| float | toFloat () const |
| Converts the string to a float. | |
| skString | ltrim () const |
| skString | removeInitialBlankLines () const |
| This method removes any initial blank lines from the given string. | |
| void | writeToFile (const skString &filename) |
| Writes the string to a file. | |
| skString | replace (const skString &old_substr, const skString &new_substr) const |
| Replaces a substring with another. | |
| skString | replace (const Char *old_substr, const Char *new_substr) const |
| Replaces a substring with another. | |
| void | replaceInPlace (Char old_char, Char new_char) |
| This method replaces a character with a different one within this string. | |
Static Public Member Functions | |
| skString | literal (const Char *) |
| Constructs a string from static string - the static string is *not* copied. | |
| skString | from (int) |
| Constructs a string from a signed integer. | |
| skString | from (USize) |
| Constructs a string from an unsigned integer. | |
| skString | from (float) |
| Constructs a string from a float. | |
| skString | from (Char ch) |
| Constructs a string from a character. | |
| skString | fromBuffer (Char *buffer) |
| Constructs a string from a buffer, which is *not* copied. | |
| skString | copyFromBuffer (const Char *buffer, USize length) |
| Constructs a string from the subset of a buffer, the contents are copied. | |
| skString | readFromFile (const skString &filename) |
| Reads the contents of a file as a string. | |
| skString | addStrings (const skString &s1, const skString &s2) |
| Efficiently adds 2 strings. | |
| skString | addStrings (const skString &s1, const skString &s2, const skString &s3) |
| Efficiently adds 3 strings. | |
| skString | addStrings (const skString &s1, const skString &s2, const skString &s3, const skString &s4) |
| Efficiently adds 4 strings. | |
| skString | addStrings (const skString &s1, const skString &s2, const skString &s3, const skString &s4, const skString &s5) |
| Efficiently adds 5 strings. | |
| skString | addStrings (const skString &s1, const skString &s2, const skString &s3, const skString &s4, const skString &s5, const skString &s6) |
| Efficiently adds 6 strings. | |
| skString | addStrings (const skString &s1, const skString &s2, const skString &s3, const skString &s4, const skString &s5, const skString &s6, const skString &s7) |
| Efficiently adds 7 strings. | |
| skString | addStrings (const skString &s1, const skString &s2, const skString &s3, const skString &s4, const skString &s5, const skString &s6, const skString &s7, const skString &s8) |
| Efficiently adds 8 strings. | |
Protected Member Functions | |
| skString (P_String *) | |
| Constructor - internal taking a P_String and not copying it. | |
| void | assign (const Char *, int len=0) |
| Assigns another buffer to this one, and copies it. | |
| void | deRef () |
| Dereferences the P_String object, deleting it if the reference count is zero. | |
Protected Attributes | |
| P_String * | pimp |
| The underlying string object - this is null if the string is blank. | |
|
|
Constructor - from a null-terminated c-string.
|
|
||||||||||||
|
Constructor - from a non null-terminated buffer.
|
|
||||||||||||
|
Constructor - a repeated list of characters.
|
|
||||||||||||||||||||||||||||||||||||
|
Efficiently adds 8 strings.
|
|
||||||||||||||||||||||||||||||||
|
Efficiently adds 7 strings.
|
|
||||||||||||||||||||||||||||
|
Efficiently adds 6 strings.
|
|
||||||||||||||||||||||||
|
Efficiently adds 5 strings.
|
|
||||||||||||||||||||
|
Efficiently adds 4 strings.
|
|
||||||||||||||||
|
Efficiently adds 3 strings.
|
|
||||||||||||
|
Efficiently adds 2 strings.
|
|
||||||||||||
|
Assigns another buffer to this one, and copies it.
|
|
|
Returns a character within the string.
|
|
|
Accesses underlying buffer.
|
|
||||||||||||
|
Constructs a string from the subset of a buffer, the contents are copied.
|
|
|
Case-insensitive equality.
|
|
|
Constructs a string from a character.
|
|
|
Constructs a string from a float.
|
|
|
Constructs a string from an unsigned integer.
|
|
|
Constructs a string from a signed integer.
|
|
|
Constructs a string from a buffer, which is *not* copied. The string will delete the buffer when the reference count reaches zero
|
|
|
returns the index of the first occurrence of the given character within the string
|
|
|
returns the index of the first occurrence of the given string within the string
|
|
|
returns the index of the last occurrence of the given character within the string
|
|
|
Length of the string.
|
|
|
Constructs a string from static string - the static string is *not* copied.
|
|
|
|
|
|
Conversion operator.
|
|
|
Inequality operator.
|
|
|
Inequality operator.
|
|
|
Addition operator.
|
|
|
Increment operator - dereferences the P_String object, and replaces it with the concatenation of this string and the other one.
|
|
|
Comparison operator.
|
|
|
Assignment operator - dereferences the P_String object and makes a new one by copying the given buffer.
|
|
|
Assigns a character.
|
|
|
Equality operator.
|
|
|
Equality operator.
|
|
|
Accesses underlying buffer.
|
|
|
Reads the contents of a file as a string.
|
|
|
This method removes any initial blank lines from the given string. This is useful for trimming the beginning of methods in Simkin scripts.
|
|
||||||||||||
|
Replaces a substring with another.
|
|
||||||||||||
|
Replaces a substring with another.
|
|
||||||||||||
|
This method replaces a character with a different one within this string. The underlying data *is* modified |
|
|
Returns the substring from the start up to the end of the current string.
|
|
||||||||||||
|
Returns a substring of this string.
|
|
|
Writes the string to a file.
|
1.3