Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1829)

Unified Diff: base/sys_string_conversions.h

Issue 21473: Now that we deal with string16s, provide some useful conversions for them. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | base/sys_string_conversions_mac.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/sys_string_conversions.h
===================================================================
--- base/sys_string_conversions.h (revision 9943)
+++ base/sys_string_conversions.h (working copy)
@@ -11,6 +11,7 @@
#include <string>
#include "base/basictypes.h"
+#include "base/string16.h"
#if defined(OS_MACOSX)
#include <CoreFoundation/CoreFoundation.h>
@@ -57,18 +58,22 @@
// Creates a string, and returns it with a refcount of 1. You are responsible
// for releasing it. Returns NULL on failure.
CFStringRef SysUTF8ToCFStringRef(const std::string& utf8);
+CFStringRef SysUTF16ToCFStringRef(const string16& utf16);
CFStringRef SysWideToCFStringRef(const std::wstring& wide);
// Same, but returns an autoreleased NSString.
NSString* SysUTF8ToNSString(const std::string& utf8);
+NSString* SysUTF16ToNSString(const string16& utf16);
NSString* SysWideToNSString(const std::wstring& wide);
// Converts a CFStringRef to an STL string. Returns an empty string on failure.
std::string SysCFStringRefToUTF8(CFStringRef ref);
+string16 SysCFStringRefToUTF16(CFStringRef ref);
std::wstring SysCFStringRefToWide(CFStringRef ref);
// Same, but accepts NSString input.
std::string SysNSStringToUTF8(NSString* ref);
+string16 SysNSStringToUTF16(NSString* ref);
std::wstring SysNSStringToWide(NSString* ref);
#endif // defined(OS_MACOSX)
« no previous file with comments | « no previous file | base/sys_string_conversions_mac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698