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

Side by Side Diff: base/sys_string_conversions.h

Issue 371057: Fix NSString conversions to treat a null NSString as a string of length 0, in... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 1 month 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « base/base.gyp ('k') | base/sys_string_conversions_mac.mm » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef BASE_SYS_STRING_CONVERSIONS_H_ 5 #ifndef BASE_SYS_STRING_CONVERSIONS_H_
6 #define BASE_SYS_STRING_CONVERSIONS_H_ 6 #define BASE_SYS_STRING_CONVERSIONS_H_
7 7
8 // Provides system-dependent string type conversions for cases where it's 8 // Provides system-dependent string type conversions for cases where it's
9 // necessary to not use ICU. Generally, you should not need this in Chrome, 9 // necessary to not use ICU. Generally, you should not need this in Chrome,
10 // but it is used in some shared code. Dependencies should be minimal. 10 // but it is used in some shared code. Dependencies should be minimal.
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 // Same, but returns an autoreleased NSString. 64 // Same, but returns an autoreleased NSString.
65 NSString* SysUTF8ToNSString(const std::string& utf8); 65 NSString* SysUTF8ToNSString(const std::string& utf8);
66 NSString* SysUTF16ToNSString(const string16& utf16); 66 NSString* SysUTF16ToNSString(const string16& utf16);
67 NSString* SysWideToNSString(const std::wstring& wide); 67 NSString* SysWideToNSString(const std::wstring& wide);
68 68
69 // Converts a CFStringRef to an STL string. Returns an empty string on failure. 69 // Converts a CFStringRef to an STL string. Returns an empty string on failure.
70 std::string SysCFStringRefToUTF8(CFStringRef ref); 70 std::string SysCFStringRefToUTF8(CFStringRef ref);
71 string16 SysCFStringRefToUTF16(CFStringRef ref); 71 string16 SysCFStringRefToUTF16(CFStringRef ref);
72 std::wstring SysCFStringRefToWide(CFStringRef ref); 72 std::wstring SysCFStringRefToWide(CFStringRef ref);
73 73
74 // Same, but accepts NSString input. 74 // Same, but accepts NSString input. Converts nil NSString* to the appropriate
75 // string type of length 0.
75 std::string SysNSStringToUTF8(NSString* ref); 76 std::string SysNSStringToUTF8(NSString* ref);
76 string16 SysNSStringToUTF16(NSString* ref); 77 string16 SysNSStringToUTF16(NSString* ref);
77 std::wstring SysNSStringToWide(NSString* ref); 78 std::wstring SysNSStringToWide(NSString* ref);
78 79
79 #endif // defined(OS_MACOSX) 80 #endif // defined(OS_MACOSX)
80 81
81 } // namespace base 82 } // namespace base
82 83
83 #endif // BASE_SYS_STRING_CONVERSIONS_H_ 84 #endif // BASE_SYS_STRING_CONVERSIONS_H_
OLDNEW
« no previous file with comments | « base/base.gyp ('k') | base/sys_string_conversions_mac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698