chromium/third_party/pdfium/core/fxcrt/fx_string.cpp

// Copyright 2017 The PDFium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com

#include "core/fxcrt/fx_string.h"

#include <stdint.h>

#include <array>
#include <iterator>

#include "build/build_config.h"
#include "core/fxcrt/bytestring.h"
#include "core/fxcrt/code_point_view.h"
#include "core/fxcrt/compiler_specific.h"
#include "core/fxcrt/fx_extension.h"
#include "core/fxcrt/span.h"
#include "core/fxcrt/stl_util.h"
#include "core/fxcrt/string_view_template.h"
#include "core/fxcrt/utf16.h"
#include "core/fxcrt/widestring.h"

#if !defined(WCHAR_T_IS_16_BIT) && !defined(WCHAR_T_IS_32_BIT)
#error "Unknown wchar_t size"
#endif
#if defined(WCHAR_T_IS_16_BIT) && defined(WCHAR_T_IS_32_BIT)
#error "Conflicting wchar_t sizes"
#endif

namespace {

// Appends a Unicode code point to a `ByteString` using UTF-8.
//
// TODO(crbug.com/pdfium/2041): Migrate to `ByteString`.
void AppendCodePointToByteString(char32_t code_point, ByteString& buffer) {}

}  // namespace

ByteString FX_UTF8Encode(WideStringView wsStr) {}

std::u16string FX_UTF16Encode(WideStringView wsStr) {}

namespace {

constexpr float kFractionScalesFloat[] =;

const double kFractionScalesDouble[] =;

template <class T>
T StringTo(ByteStringView strc, pdfium::span<const T> fractional_scales) {}

template <class T>
size_t ToString(T value, int (*round_func)(T), pdfium::span<char> buf) {}

}  // namespace

float StringToFloat(ByteStringView strc) {}

float StringToFloat(WideStringView wsStr) {}

size_t FloatToString(float f, pdfium::span<char> buf) {}

double StringToDouble(ByteStringView strc) {}

double StringToDouble(WideStringView wsStr) {}

size_t DoubleToString(double d, pdfium::span<char> buf) {}

namespace fxcrt {

template std::vector<ByteString> Split<ByteString>(const ByteString& that,
                                                   ByteString::CharType ch);
template std::vector<WideString> Split<WideString>(const WideString& that,
                                                   WideString::CharType ch);

}  // namespace fxcrt