From 1d7bd5d073c94e14d6d8b5f45f2f27b009ddbcb0 Mon Sep 17 00:00:00 2001 From: Victor Zverovich Date: Tue, 8 Jul 2014 16:44:24 -0700 Subject: [PATCH] Add c_str functions. --- format.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/format.h b/format.h index ff1b5dbe..e74bb657 100644 --- a/format.h +++ b/format.h @@ -520,6 +520,7 @@ class UTF8ToUTF16 { explicit UTF8ToUTF16(StringRef s); operator WStringRef() const { return WStringRef(&buffer_[0], size()); } size_t size() const { return buffer_.size() - 1; } + const wchar_t *c_str() const { return &buffer_[0]; } std::wstring str() const { return std::wstring(&buffer_[0], size()); } }; @@ -534,6 +535,7 @@ class UTF16ToUTF8 { explicit UTF16ToUTF8(WStringRef s); operator StringRef() const { return StringRef(&buffer_[0], size()); } size_t size() const { return buffer_.size() - 1; } + const char *c_str() const { return &buffer_[0]; } std::string str() const { return std::string(&buffer_[0], size()); } // Performs conversion returning a system error code instead of