#include <utils.h>
Collaboration diagram for hoa_utils::ustring:

Public Member Functions | |
| const uint16 * | c_str () const |
| void | clear () |
| bool | empty () const |
| size_t | find (const ustring &s, size_t pos=0) const |
| size_t | find (uint16 c, size_t pos=0) const |
| size_t | length () const |
| ustring & | operator+ (const ustring &s) |
| ustring & | operator+= (const ustring &s) |
| ustring & | operator+= (uint16 c) |
| ustring & | operator= (const ustring &s) |
| const uint16 & | operator[] (size_t pos) const |
| uint16 & | operator[] (size_t pos) |
| size_t | size () const |
| ustring | substr (size_t pos=0, size_t n=npos) const |
| ustring (const uint16 *) | |
| ustring () | |
Static Public Attributes | |
| static const size_t | npos |
Private Attributes | |
| std::vector< uint16 > | _str |
| The structure containing the unicode string data. | |
****************************************************************************
This class functions identically to the std::string class provided in the C++ standard library. The critical difference is that each character is 2 bytes (16 bits) wide instead of 1 byte (8 bits) wide so that it may implement the full unicode character set.
This class does not implement a destructor because the only data member (a std::vector) will automatically destroy itself when the no-arg destructor is invoked.
The member functions of this class are not documented because they function in the exact same manner that the C++ string class does.
There are some libstdc++ compatability problems with simply defining basic_string<uint16>, so this class is a custom version of it.
Currently not all functionality of basic_string has been implemented, but instead only the functions that we typically use in Allacrost. If you need a basic_string function available that isn't already implemented in this class, go ahead and add it yourself.
This class does not use wchar_t because it has poor compatibility.
Definition at line 194 of file utils.h.
| hoa_utils::ustring::ustring | ( | const uint16 * | ) |
| const uint16* hoa_utils::ustring::c_str | ( | ) | const [inline] |
Definition at line 215 of file utils.h.
References _str.
Referenced by hoa_video::GameVideo::CalculateTextWidth(), and hoa_video::GameVideo::RenderText().
| void hoa_utils::ustring::clear | ( | ) | [inline] |
Definition at line 202 of file utils.h.
References _str.
Referenced by hoa_video::OptionBox::_ConstructOption(), and operator=().
| bool hoa_utils::ustring::empty | ( | ) | const [inline] |
Definition at line 205 of file utils.h.
References _str.
Referenced by hoa_video::TextBox::_AddLine(), hoa_video::OptionBox::_ConstructOption(), hoa_video::GameVideo::DrawText(), operator+(), operator+=(), and hoa_video::GameVideo::RenderText().
| size_t hoa_utils::ustring::find | ( | const ustring & | s, | |
| size_t | pos = 0 | |||
| ) | const |
| size_t hoa_utils::ustring::find | ( | uint16 | c, | |
| size_t | pos = 0 | |||
| ) | const |
Definition at line 191 of file utils.cpp.
References _str, length(), and npos.
Referenced by hoa_video::OptionBox::_ConstructOption(), and hoa_video::TextBox::_ReformatText().
Here is the call graph for this function:

| size_t hoa_utils::ustring::length | ( | ) | const [inline] |
Definition at line 208 of file utils.h.
References _str.
Referenced by hoa_video::TextBox::_AddLine(), hoa_video::OptionBox::_ConstructOption(), hoa_video::GameVideo::DrawText(), find(), hoa_utils::MakeStandardString(), operator+(), operator+=(), size(), and substr().
Definition at line 151 of file utils.cpp.
References _str, and length().
Referenced by operator=().
Here is the call graph for this function:

Definition at line 182 of file utils.cpp.
References clear(), and operator+=().
Here is the call graph for this function:

| const uint16& hoa_utils::ustring::operator[] | ( | size_t | pos | ) | const [inline] |
| uint16& hoa_utils::ustring::operator[] | ( | size_t | pos | ) | [inline] |
| size_t hoa_utils::ustring::size | ( | ) | const [inline] |
Definition at line 212 of file utils.h.
References length().
Referenced by hoa_video::TextBox::_AddLine(), and hoa_video::GameVideo::RenderText().
Here is the call graph for this function:

Definition at line 109 of file utils.cpp.
References _str, and length().
Referenced by hoa_video::TextBox::_AddLine(), hoa_video::OptionBox::_ConstructOption(), and hoa_video::TextBox::_ReformatText().
Here is the call graph for this function:

std::vector<uint16> hoa_utils::ustring::_str [private] |
The structure containing the unicode string data.
Definition at line 240 of file utils.h.
Referenced by c_str(), clear(), empty(), find(), length(), operator+(), operator+=(), operator[](), substr(), and ustring().
const size_t hoa_utils::ustring::npos [static] |
Definition at line 200 of file utils.h.
Referenced by hoa_video::OptionBox::_ConstructOption(), hoa_video::TextBox::_ReformatText(), and find().
1.5.1