From 473b8e44b7098bd11aa9b3d9e95eb46bad17a4ba Mon Sep 17 00:00:00 2001 From: vng Date: Wed, 8 Feb 2012 16:23:37 +0300 Subject: [PATCH] Add DebugPrint() for UniString. --- base/string_utils.hpp | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/base/string_utils.hpp b/base/string_utils.hpp index fd6b26551b..c58228110a 100644 --- a/base/string_utils.hpp +++ b/base/string_utils.hpp @@ -13,7 +13,17 @@ namespace strings { typedef uint32_t UniChar; -typedef buffer_vector UniString; +//typedef buffer_vector UniString; + +/// Make new type, not typedef. Need to specialize DebugPrint. +class UniString : public buffer_vector +{ + typedef buffer_vector BaseT; +public: + UniString() {} + explicit UniString(size_t n, UniChar c = UniChar()) : BaseT(n, c) {} + template UniString(IterT b, IterT e) : BaseT(b, e) {} +}; UniString MakeLowerCase(UniString const & s); void MakeLowerCase(UniString & s); @@ -38,6 +48,11 @@ inline string ToUtf8(UniString const & s) return result; } +inline string DebugPrint(UniString const & s) +{ + return ToUtf8(s); +} + template class TokenizeIterator {