X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=otk%2Fustring.hh;fp=otk%2Fustring.hh;h=03f893d309333ea34b69203cbff93a9ae7d0c701;hb=8b73f6f02517e717842d122d82e1eb08cda95e19;hp=5d011cfc8837a21e196b789168d91602db4a33e4;hpb=ecfac5f20c72647b4865a14ccffc307c2b116319;p=chaz%2Fopenbox diff --git a/otk/ustring.hh b/otk/ustring.hh index 5d011cfc..03f893d3 100644 --- a/otk/ustring.hh +++ b/otk/ustring.hh @@ -20,6 +20,14 @@ extern "C" { namespace otk { +#ifdef HAVE_STDINT_H +typedef uint32_t unichar; +#else +typedef u_int32_t unichar; +#endif + +#ifndef DOXYGEN_IGNORE + //! The number of bytes to skip to find the next character in the string const char g_utf8_skip[256] = { 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, @@ -32,12 +40,6 @@ const char g_utf8_skip[256] = { 3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,4,4,4,4,4,4,4,4,5,5,5,5,6,6,1,1 }; -#ifdef HAVE_STDINT_H -typedef uint32_t unichar; -#else -typedef u_int32_t unichar; -#endif - //! The iterator type for ustring /*! Note this is not a random access iterator but a bidirectional one, since all @@ -102,6 +104,8 @@ private: T _pos; }; +#endif // DOXYGEN_IGNORE + //! This class provides a simple wrapper to a std::string that is encoded as //! UTF-8. /*! @@ -140,6 +144,18 @@ public: ustring(const std::string& src); ustring::ustring(const char* src); + // 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; + + // internal data + + const char* data() const; + const char* c_str() const; };