summaryrefslogtreecommitdiff
path: root/otk/ustring.hh
diff options
context:
space:
mode:
authorDana Jansens <danakj@orodu.net>2003-01-13 03:51:48 +0000
committerDana Jansens <danakj@orodu.net>2003-01-13 03:51:48 +0000
commit4947902d269213edee40f3f31f97721fa0dd3877 (patch)
treed8e2af6c768a7e62ebdc7ff55029d6f25ca88acb /otk/ustring.hh
parent2aff07a250930db7e0eb69dd6cd776333fcb8b9a (diff)
more conversion to ustring. added more members
Diffstat (limited to 'otk/ustring.hh')
-rw-r--r--otk/ustring.hh19
1 files changed, 15 insertions, 4 deletions
diff --git a/otk/ustring.hh b/otk/ustring.hh
index 03f893d3..02111a33 100644
--- a/otk/ustring.hh
+++ b/otk/ustring.hh
@@ -106,8 +106,9 @@ private:
#endif // DOXYGEN_IGNORE
-//! This class provides a simple wrapper to a std::string that is encoded as
-//! UTF-8.
+//! This class provides a simple wrapper to a std::string that can be encoded
+//! as UTF-8. The ustring::utf() member specifies if the given string is UTF-8
+//! encoded. ustrings default to specifying UTF-8 encoding.
/*!
This class does <b>not</b> handle extended 8-bit ASCII charsets like
ISO-8859-1.
@@ -120,7 +121,8 @@ private:
*/
class ustring {
std::string _string;
-
+ bool _utf8;
+
public:
typedef std::string::size_type size_type;
typedef std::string::difference_type difference_type;
@@ -144,10 +146,15 @@ public:
ustring(const std::string& src);
ustring::ustring(const char* src);
+ // append to the string
+
+ ustring& operator+=(const ustring& src);
+ ustring& operator+=(const char* src);
+ ustring& operator+=(char c);
+
// sizes
ustring::size_type size() const;
- ustring::size_type length() const;
ustring::size_type bytes() const;
ustring::size_type capacity() const;
ustring::size_type max_size() const;
@@ -156,7 +163,11 @@ public:
const char* data() const;
const char* c_str() const;
+
+ // encoding
+ bool utf8() const;
+ void setUtf8(bool utf8);
};
}