binary string type. More...
#include <attributes.h>
Public Member Functions | |
String () | |
constructs an empty string. | |
String (const char *b, const char *e) | |
constructs a string with the given begin and end pointers. | |
String (const char *s) | |
constructs a string with the given char * interpreted as a C-style string. | |
String (const char *s, int len) | |
constructs a string with the given pointer and length. | |
String (const String &x) | |
constructs a copy of a given string. More... | |
String & | operator= (const String x) |
assigns this string to the given string. More... | |
String & | assign (const char *b, const char *e) |
assigns this string to the given sequence. More... | |
unsigned int | length () const |
returns the size of the string. | |
const char & | operator[] (int x) const |
accessor method for strings. | |
bool | operator== (const String &x) const |
equality test for strings. | |
bool | operator< (const String &x) const |
lexicographical order relation. More... | |
bool | operator> (const String &x) const |
lexicographical order relation. More... | |
bool | operator!= (const String &x) const |
not equals | |
bool | has_prefix (const String &x) const |
prefix | |
bool | has_suffix (const String &x) const |
suffix | |
bool | has_substring (const String &x) const |
substring | |
std::string & | to_string (std::string &s) const |
assigns this string value to a standard string. | |
std::string | to_string () const |
returns this string value as a standard string value. | |
Public Attributes | |
const char * | begin |
pointer to the first character in the string. | |
const char * | end |
pointer to the first character past-the-end of the string. | |
binary string type.
A reference to a contiguous sequence of bytes (8-bit characters). This is a very simple string representation. The sequence is external to the String object and is referred to by a pair of pointers. The first pointer (begin) points to the first character; the second pointer (end) points to the first charcter past the end of the sequence. A string may contain any character. A string may also be empty when begin == end
.
String objects are immutable for the purpose of the forwarding module, in the sense that the String class does not provide methods to modify the value of a String.
|
inline |
constructs a copy of a given string.
The copy is simply a copy of the reference. In other words, this method does not allocate memory for the string value. Instead, the new string will point to the same sequence of the given string.
|
inline |
bool siena::String::operator< | ( | const String & | x) | const |
lexicographical order relation.
returns true iff this string lexicographically precedes the given string.
|
inline |
lexicographical order relation.
returns true iff this string lexicographically follows the given string.