ipc/chromium/src/base/sys_string_conversions.h

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

     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
     3 // found in the LICENSE file.
     5 #ifndef BASE_SYS_STRING_CONVERSIONS_H_
     6 #define BASE_SYS_STRING_CONVERSIONS_H_
     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,
    10 // but it is used in some shared code. Dependencies should be minimal.
    12 #include <string>
    13 #include "base/basictypes.h"
    14 #include "base/string16.h"
    16 class StringPiece;
    18 namespace base {
    20 // Converts between wide and UTF-8 representations of a string. On error, the
    21 // result is system-dependent.
    22 std::string SysWideToUTF8(const std::wstring& wide);
    23 std::wstring SysUTF8ToWide(const StringPiece& utf8);
    25 // Converts between wide and the system multi-byte representations of a string.
    26 // DANGER: This will lose information and can change (on Windows, this can
    27 // change between reboots).
    28 std::string SysWideToNativeMB(const std::wstring& wide);
    29 std::wstring SysNativeMBToWide(const StringPiece& native_mb);
    31 // Windows-specific ------------------------------------------------------------
    33 #if defined(OS_WIN)
    35 // Converts between 8-bit and wide strings, using the given code page. The
    36 // code page identifier is one accepted by the Windows function
    37 // MultiByteToWideChar().
    38 std::wstring SysMultiByteToWide(const StringPiece& mb, uint32_t code_page);
    39 std::string SysWideToMultiByte(const std::wstring& wide, uint32_t code_page);
    41 #endif  // defined(OS_WIN)
    43 }  // namespace base
    45 #endif  // BASE_SYS_STRING_CONVERSIONS_H_

mercurial