#ifndef BASE_STRINGS_SYS_STRING_CONVERSIONS_H_
#define BASE_STRINGS_SYS_STRING_CONVERSIONS_H_
#include <stdint.h>
#include <string>
#include "base/base_export.h"
#include "base/strings/string_piece.h"
#include "build/build_config.h"
#if BUILDFLAG(IS_APPLE)
#include <CoreFoundation/CoreFoundation.h>
#include "base/mac/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(StringPiece utf8);
[[nodiscard]] BASE_EXPORT std::string SysWideToNativeMB(
const std::wstring& wide);
[[nodiscard]] BASE_EXPORT std::wstring SysNativeMBToWide(StringPiece native_mb);
#if BUILDFLAG(IS_WIN)
[[nodiscard]] BASE_EXPORT std::wstring SysMultiByteToWide(StringPiece 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 ScopedCFTypeRef<CFStringRef> SysUTF8ToCFStringRef(
StringPiece utf8);
[[nodiscard]] BASE_EXPORT ScopedCFTypeRef<CFStringRef> SysUTF16ToCFStringRef(
StringPiece16 utf16);
[[nodiscard]] BASE_EXPORT std::string SysCFStringRefToUTF8(CFStringRef ref);
[[nodiscard]] BASE_EXPORT std::u16string SysCFStringRefToUTF16(CFStringRef ref);
#ifdef __OBJC__
[[nodiscard]] BASE_EXPORT NSString* SysUTF8ToNSString(StringPiece utf8);
[[nodiscard]] BASE_EXPORT NSString* SysUTF16ToNSString(StringPiece16 utf16);
[[nodiscard]] BASE_EXPORT std::string SysNSStringToUTF8(NSString* ref);
[[nodiscard]] BASE_EXPORT std::u16string SysNSStringToUTF16(NSString* ref);
#endif
#endif
}
#endif