diff options
author | deanm@google.com <deanm@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-08-19 13:19:24 +0000 |
---|---|---|
committer | deanm@google.com <deanm@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-08-19 13:19:24 +0000 |
commit | 4bdaceb429c7cd6a3a2a8bc692f418969c24ff28 (patch) | |
tree | e399572c17bb4ed5de86bd702ea28a041e40b9b0 /base/sys_string_conversions_mac.cc | |
parent | 1e3f8396c6f205b2be2a102d4fbca870638e7f6b (diff) | |
download | chromium_src-4bdaceb429c7cd6a3a2a8bc692f418969c24ff28.zip chromium_src-4bdaceb429c7cd6a3a2a8bc692f418969c24ff28.tar.gz chromium_src-4bdaceb429c7cd6a3a2a8bc692f418969c24ff28.tar.bz2 |
Move the system string conversion functions from std::string to StringPiece. We often work with char* in the system layer, so this should save extra copying.
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@1027 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/sys_string_conversions_mac.cc')
-rw-r--r-- | base/sys_string_conversions_mac.cc | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/base/sys_string_conversions_mac.cc b/base/sys_string_conversions_mac.cc index 41b693a..6614fa0 100644 --- a/base/sys_string_conversions_mac.cc +++ b/base/sys_string_conversions_mac.cc @@ -28,9 +28,12 @@ // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "base/sys_string_conversions.h" + #include <CoreFoundation/CoreFoundation.h> #include <vector> + #include "base/scoped_cftyperef.h" +#include "base/string_piece.h" namespace base { @@ -139,8 +142,8 @@ std::string SysWideToUTF8(const std::wstring& wide) { } // Do not assert in this function since it is used by the asssertion code! -std::wstring SysUTF8ToWide(const std::string& utf8) { - return STLStringToSTLStringWithEncodingsT<std::string, std::wstring>( +std::wstring SysUTF8ToWide(StringPiece utf8) { + return STLStringToSTLStringWithEncodingsT<StringPiece, std::wstring>( utf8, kNarrowStringEncoding, kWideStringEncoding); } @@ -148,7 +151,7 @@ std::string SysWideToNativeMB(const std::wstring& wide) { return SysWideToUTF8(wide); } -std::wstring SysNativeMBToWide(const std::string& native_mb) { +std::wstring SysNativeMBToWide(StringPiece native_mb) { return SysUTF8ToWide(native_mb); } |