#ifndef BASE_STRINGS_SYS_STRING_CONVERSIONS_H_
#define BASE_STRINGS_SYS_STRING_CONVERSIONS_H_
#include <stdint.h>
#include <string>
#include <string_view>
#include "base/base_export.h"
#include "build/build_config.h"
#if BUILDFLAG(IS_APPLE)
#include <CoreFoundation/CoreFoundation.h>
#include "base/apple/scoped_cftyperef.h"
#ifdef __OBJC__
@class NSString;
#endif
#endif
namespace base {
[[nodiscard]] BASE_EXPORT std::string SysWideToUTF8(const std::wstring& wide);
[[nodiscard]] BASE_EXPORT std::wstring SysUTF8ToWide(std::string_view utf8);
[[nodiscard]] BASE_EXPORT std::string SysWideToNativeMB(
const std::wstring& wide);
[[nodiscard]] BASE_EXPORT std::wstring SysNativeMBToWide(
std::string_view native_mb);
#if BUILDFLAG(IS_WIN)
[[nodiscard]] BASE_EXPORT std::wstring SysMultiByteToWide(std::string_view mb,
uint32_t code_page);
[[nodiscard]] BASE_EXPORT std::string SysWideToMultiByte(
const std::wstring& wide,
uint32_t code_page);
#endif
#if BUILDFLAG(IS_APPLE)
[[nodiscard]] BASE_EXPORT apple::ScopedCFTypeRef<CFStringRef>
SysUTF8ToCFStringRef(std::string_view utf8);
[[nodiscard]] BASE_EXPORT apple::ScopedCFTypeRef<CFStringRef>
SysUTF16ToCFStringRef(std::u16string_view utf16);
[[nodiscard]] BASE_EXPORT std::string SysCFStringRefToUTF8(CFStringRef ref);
[[nodiscard]] BASE_EXPORT std::u16string SysCFStringRefToUTF16(CFStringRef ref);
#ifdef __OBJC__
[[nodiscard]] BASE_EXPORT NSString* SysUTF8ToNSString(std::string_view utf8);
[[nodiscard]] BASE_EXPORT NSString* SysUTF16ToNSString(
std::u16string_view utf16);
[[nodiscard]] BASE_EXPORT std::string SysNSStringToUTF8(NSString* ref);
[[nodiscard]] BASE_EXPORT std::u16string SysNSStringToUTF16(NSString* ref);
#endif
#endif
}
#endif