summaryrefslogtreecommitdiffstats
path: root/base/sys_string_conversions.h
diff options
context:
space:
mode:
authoravi@google.com <avi@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-08-22 19:55:26 +0000
committeravi@google.com <avi@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-08-22 19:55:26 +0000
commitd2a10d134c864765e7015a62f20642f398adc721 (patch)
treecd5474cc66b613b9a4640e948fd1646da112c311 /base/sys_string_conversions.h
parente05212240814d77101f6a677fc38411ec05fd177 (diff)
downloadchromium_src-d2a10d134c864765e7015a62f20642f398adc721.zip
chromium_src-d2a10d134c864765e7015a62f20642f398adc721.tar.gz
chromium_src-d2a10d134c864765e7015a62f20642f398adc721.tar.bz2
Impl of platform mime typing for Mac.
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@1238 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/sys_string_conversions.h')
-rw-r--r--base/sys_string_conversions.h21
1 files changed, 21 insertions, 0 deletions
diff --git a/base/sys_string_conversions.h b/base/sys_string_conversions.h
index dfca0f7..0896fea0 100644
--- a/base/sys_string_conversions.h
+++ b/base/sys_string_conversions.h
@@ -37,6 +37,10 @@
#include <string>
#include "base/basictypes.h"
+#if defined(OS_MACOSX)
+#include <CoreFoundation/CoreFoundation.h>
+#endif
+
class StringPiece;
namespace base {
@@ -64,6 +68,23 @@ std::string SysWideToMultiByte(const std::wstring& wide, uint32 code_page);
#endif // defined(OS_WIN)
+// Mac-specific ----------------------------------------------------------------
+
+#if defined(OS_MACOSX)
+
+// Converts between STL strings and CFStringRefs.
+
+// 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 SysWideToCFStringRef(const std::wstring& wide);
+
+// Converts a CFStringRef to an STL string. Returns an empty string on failure.
+std::string SysCFStringRefToUTF8(CFStringRef ref);
+std::wstring SysCFStringRefToWide(CFStringRef ref);
+
+#endif // defined(OS_MACOSX)
+
} // namespace base
#endif // BASE_SYS_STRING_CONVERSIONS_H_