acedia::String Class Reference

String is a thread safe wrapper around std::string that uses implicit sharing. More...

#include <acedia_string.hpp>

List of all members.

Public Member Functions

 String ()
 Creates an empty string.
 String (const String &other)
 Creates a string that's a copy of other.
 String (const std::string &str)
 Creates a string that's a copy of str.
 String (const char *cstr)
 Creates a string that's a copy of cstr.
 String (const char *cstr,::size_t n)
 Creates a string from the first n character from cstr.
::size_t length () const
 Return length of string.
inline::size_t size () const
 Return length of string (alias of length).
const char & operator[] (::size_t pos) const
const char & at (::size_t pos) const
const char * c_str () const
bool empty () const
 Test if string is empty.
const std::string & const_str () const
 Get this string as a const std::string &.
bool operator< (const String &other) const
 Implicit conversion operator to std::string &.
const_iterator begin () const
const_iterator end () const
Stringoperator= (const String &other)
 Assignment operator.
bool operator== (const String &other) const
 Test if this string is equal other.
bool operator!= (const String &other) const
 Test if this string is not equal other.
Stringappend (const String &str)
 Append str to this string.
Stringappend (const String &str,::size_t pos,::size_t n)
 Append a substring of str to this string.
Stringappend (char c)
 Append c to this string.
Stringappend (const char *cstr)
 Append cstr to this string.
Stringappend (const char *cstr,::size_t n)
 Append the first n characters of cstr to this string.
Stringappend (const std::string &str)
 Append str to this string.
Stringoperator+= (const String &str)
 Append str to this string.
Stringoperator+= (const char *cstr)
 Append cstr to this string.
Stringoperator+= (char c)
 Append c to this string.
void serialize (boost::archive::text_oarchive &ar, const unsigned int unused) const
 Serialize string to ar.
void serialize (boost::archive::text_iarchive &ar, const unsigned int unused)
 Deserialize string from ar.
void reserve (::size_t n)
 Reserve at least n bytes.
bool startsWith (const char *cString) const
 Check if this strings starts with cString.
bool startsWith (const String &str) const
 Check if this strings starts with str.

Detailed Description

String is a thread safe wrapper around std::string that uses implicit sharing.

Definition at line 49 of file acedia_string.hpp.


Constructor & Destructor Documentation

acedia::String::String ( const String other  ) 

Creates a string that's a copy of other.

This constructor does not cause a deep copy, because String is implicit shared.

Definition at line 127 of file acedia_string.cpp.


Member Function Documentation

const char& acedia::String::at ( ::size_t  pos  )  const [inline]
Returns:
the character at the specified position in the string

Definition at line 109 of file acedia_string.hpp.

std::string::const_iterator acedia::String::begin (  )  const
Returns:
const iterator to beginning

Definition at line 153 of file acedia_string.cpp.

const char * acedia::String::c_str (  )  const
Returns:
c-string equivalent to the string

Definition at line 149 of file acedia_string.cpp.

std::string::const_iterator acedia::String::end (  )  const
Returns:
const iterator to end

Definition at line 158 of file acedia_string.cpp.

const char & acedia::String::operator[] ( ::size_t  pos  )  const
Returns:
the character at the specified position in the string

Definition at line 147 of file acedia_string.cpp.


The documentation for this class was generated from the following files:

Generated by  doxygen 1.6.2