13 #include <boost/functional/hash.hpp>
14 #include <boost/serialization/split_free.hpp>
95 template <
typename QStringType,
typename QCoreApp>
99 0, QCoreApp::UnicodeUTF8);
103 template <
typename QStringType>
106 return fromUtf16(qstr.utf16(),qstr.length());
119 inline void setFromUtf8(
const unsigned char* utf8,
int len = -1);
128 inline void setFromUtf16(
const unsigned short* utf16,
int len = -1);
132 inline void setFromUtf32(
const unsigned int* utf32,
int len = -1);
140 inline void setFromAscii(
const char* ascii,
int len = -1);
143 template <
typename QStringType>
153 inline void toAscii(std::string& str)
const;
154 inline std::string
toAscii()
const { std::string temp;
toAscii(temp);
return temp;}
158 inline void toLatin1(std::string& str)
const;
161 inline void toUtf8(std::string& str)
const;
162 inline std::string
toUtf8()
const { std::string temp;
toUtf8(temp);
return temp;}
167 template <
typename QStringType>
174 template <
typename QStringType>
197 inline size_t length()
const;
229 inline void resize(
int size );
247 inline explicit DtUnicode(
const unsigned short* utf16,
int len = -1);
250 inline explicit DtUnicode(
const unsigned int* utf32,
int len = -1);
253 inline explicit DtUnicode(
const std::string& ascii);
269 inline void resize(
size_t newSize);
282 inline size_t size()
const;
291 inline bool unique()
const;
294 inline bool empty()
const;
318 size_t seed = 2166136261U;
320 size_t last = val.
length();
321 size_t stride = 1 + last / 10;
327 for(; first < last ; first += stride )
329 seed = 16777619U * seed ^ (size_t)val.
codeUnits()[first];
335 #include "DtUnicode.inl"