|
#include <CSharedStrings.h>

Public Member Functions | |
| CSharedStrings () | |
| Default constructor. | |
| ~CSharedStrings () | |
| Destructor. | |
| const std::string & | shareString (const char *str) |
| Obtain a shared string. | |
| const std::string & | shareString (const std::string &str) |
| Obtain a shared string. | |
| void | releaseString (const char *str) throw (std::exception) |
| Releases a shared string. | |
| void | releaseString (const std::string &str) throw (std::exception) |
| Releases a shared string. | |
| void | clear () |
| Clears the shared string table. | |
Contains a table of shared strings for the use with different objects such as XML node, ListView, etc
| void sptk::CSharedStrings::clear | ( | ) |
Clears the shared string table.
Only the string containing the empty string ("") is left after this operation
Reimplemented in sptk::CXmlDoc.
Referenced by ~CSharedStrings().
| void sptk::CSharedStrings::releaseString | ( | const std::string & | str | ) | throw (std::exception) [inline] |
Releases a shared string.
If the shared string reference counter is greater than one, it's decreased by one. If the reference counter is one, the string is removed from SST. If the string doesn't exist, the exception is thrown.
| str | const std::string&, a string to release |
References releaseString().
| void sptk::CSharedStrings::releaseString | ( | const char * | str | ) | throw (std::exception) |
Releases a shared string.
If the shared string reference counter is greater than one, it's decreased by one. If the reference counter is one, the string is removed from SST. If the string doesn't exist, the exception is thrown.
| str | const char *, a string to release |
Referenced by releaseString().
| const std::string& sptk::CSharedStrings::shareString | ( | const std::string & | str | ) | [inline] |
Obtain a shared string.
Looks for an existing shared string, and returns a const char *pointer to it. If a shared string not found, it's created with reference count one. For an existing shared string, every call of this method encreases string reference counter by one
| str | const std::string&, a string to share |
References shareString().
| const std::string& sptk::CSharedStrings::shareString | ( | const char * | str | ) |
Obtain a shared string.
Looks for an existing shared string, and returns a const std::string& to it. If a shared string not found, it's created with reference count one. For an existing shared string, every call of this method encreases string reference counter by one
| str | const char *, a string to share |
Referenced by shareString().