|
TrueReality
v0.1.1912
|
A string wrapper that will make sure that all of the strings with the same value will point to the same memory. More...
#include <RefStr.h>
Public Member Functions | |
| RefStr (const std::string &value="") | |
| Constructor. More... | |
| RefStr (const char *value) | |
| Constructor. More... | |
| RefStr (const RefStr &toCopy) | |
| Copy constructor. More... | |
| ~RefStr () | |
| Destructor. More... | |
| operator const std::string & () const | |
| Implicit conversion operator from RefStr to std::string;. More... | |
| trUtil::RefStr & | operator= (const std::string &value) |
| Assignment operator that takes a string. More... | |
| trUtil::RefStr & | operator= (const trUtil::RefStr &value) |
| Assignment operator that takes a Ref String. More... | |
| RefStr | operator+ (const std::string &string) const |
| RefStr | operator+ (const RefStr &RefStr) const |
| RefStr | operator+ (const char *str) const |
| const std::string * | operator-> () const |
| std::string::value_type | operator[] (int index) const |
| const char * | c_str () const |
| Gets the string. More... | |
| bool | operator< (const trUtil::RefStr &toCompare) const |
| bool | operator== (const trUtil::RefStr &toCompare) const |
| bool | operator!= (const trUtil::RefStr &toCompare) const |
| bool | operator== (const std::string &toCompare) const |
| bool | operator== (const char *toCompare) const |
| bool | operator!= (const char *toCompare) const |
| bool | operator!= (const std::string &toCompare) const |
| const std::string & | Get () const |
Static Public Member Functions | |
| static size_t | GetSharedStringCount () |
| Gets shared string count. More... | |
Private Member Functions | |
| void | Intern (const std::string &value) |
Private Attributes | |
| const std::string * | mString |
A string wrapper that will make sure that all of the strings with the same value will point to the same memory.
The strings are only accessible as const, but a new string may be assigned to the reference string.
| trUtil::RefStr::RefStr | ( | const std::string & | value = "" | ) |
Constructor.
| value | (Optional) The value. |
Definition at line 72 of file RefStr.cpp.
References Intern().
Referenced by operator+().


| trUtil::RefStr::RefStr | ( | const char * | value | ) |
Constructor.
| value | The value. |
Definition at line 78 of file RefStr.cpp.
References Intern().

| trUtil::RefStr::RefStr | ( | const RefStr & | toCopy | ) |
Copy constructor.
| toCopy | to copy. |
Definition at line 84 of file RefStr.cpp.
References Intern(), and mString.

| trUtil::RefStr::~RefStr | ( | ) |
|
inline |
|
inline |
Definition at line 178 of file RefStr.h.
Referenced by trUtil::operator+(), operator<(), trUtil::operator<<(), and operator==().

|
static |
Gets shared string count.
Definition at line 66 of file RefStr.cpp.
References trUtil::StringCount.
|
private |
Definition at line 143 of file RefStr.cpp.
References mString, and trUtil::StringCount.
Referenced by operator=(), and RefStr().

|
inline |
Implicit conversion operator from RefStr to std::string;.
Definition at line 104 of file RefStr.h.
References trUtil::operator+().

|
inline |
|
inline |
|
inline |
| RefStr trUtil::RefStr::operator+ | ( | const std::string & | string | ) | const |
Definition at line 104 of file RefStr.cpp.
References mString, and RefStr().

Definition at line 110 of file RefStr.cpp.
References mString, and RefStr().

| RefStr trUtil::RefStr::operator+ | ( | const char * | str | ) | const |
Definition at line 116 of file RefStr.cpp.
References mString, and RefStr().

|
inline |
|
inline |
| trUtil::RefStr & trUtil::RefStr::operator= | ( | const std::string & | value | ) |
Assignment operator that takes a string.
| value | The value. |
Definition at line 122 of file RefStr.cpp.
References Intern().

| trUtil::RefStr & trUtil::RefStr::operator= | ( | const trUtil::RefStr & | value | ) |
Assignment operator that takes a Ref String.
| value | The value. |
Definition at line 129 of file RefStr.cpp.
References Intern(), and mString.

|
inline |
|
inline |
|
inline |
|
inline |
|
private |
Definition at line 181 of file RefStr.h.
Referenced by Intern(), operator+(), operator=(), RefStr(), and ~RefStr().