diff options
-rw-r--r-- | sandbox/src/sandbox_utils.h | 12 | ||||
-rw-r--r-- | sandbox/wow_helper/wow_helper.cc | 18 |
2 files changed, 13 insertions, 17 deletions
diff --git a/sandbox/src/sandbox_utils.h b/sandbox/src/sandbox_utils.h index b292ed0..e6cac5d 100644 --- a/sandbox/src/sandbox_utils.h +++ b/sandbox/src/sandbox_utils.h @@ -35,13 +35,11 @@ void InitObjectAttribs(const std::wstring& name, ULONG attributes, HANDLE root, // The next 2 functions are copied from base\string_util.h and have been // slighty modified because we don't want to depend on ICU. -template <class char_type> -inline char_type* WriteInto( - std::basic_string<char_type, std::char_traits<char_type>, - std::allocator<char_type> >* str, - size_t length_including_null) { - str->reserve(length_including_null); - str->resize(length_including_null - 1); +template <class string_type> +inline typename string_type::value_type* WriteInto(string_type* str, + size_t length_with_null) { + str->reserve(length_with_null); + str->resize(length_with_null - 1); return &((*str)[0]); } diff --git a/sandbox/wow_helper/wow_helper.cc b/sandbox/wow_helper/wow_helper.cc index 6df4c0e..6c272e4 100644 --- a/sandbox/wow_helper/wow_helper.cc +++ b/sandbox/wow_helper/wow_helper.cc @@ -17,18 +17,16 @@ namespace { -// Grabbed from chrome/common/string_util.h -template <class char_type> -inline char_type* WriteInto( - std::basic_string<char_type, std::char_traits<char_type>, - std::allocator<char_type> >* str, - size_t length_including_null) { - str->reserve(length_including_null); - str->resize(length_including_null - 1); +// Grabbed from base/string_util.h +template <class string_type> +inline typename string_type::value_type* WriteInto(string_type* str, + size_t length_with_null) { + str->reserve(length_with_null); + str->resize(length_with_null - 1); return &((*str)[0]); } -// Grabbed from chrome/common/string_util.cc +// Grabbed from base/string_util.cc std::string WideToMultiByte(const std::wstring& wide, UINT code_page) { if (wide.length() == 0) return std::string(); @@ -47,7 +45,7 @@ std::string WideToMultiByte(const std::wstring& wide, UINT code_page) { return mb; } -// Grabbed from chrome/common/string_util.cc +// Grabbed from base/string_util.cc std::string WideToUTF8(const std::wstring& wide) { return WideToMultiByte(wide, CP_UTF8); } |