#include "core/fxcrt/widestring.h"
#include <stddef.h>
#include <string.h>
#include <wchar.h>
#include <algorithm>
#include <sstream>
#include "core/fxcrt/check.h"
#include "core/fxcrt/check_op.h"
#include "core/fxcrt/compiler_specific.h"
#include "core/fxcrt/fx_codepage.h"
#include "core/fxcrt/fx_extension.h"
#include "core/fxcrt/fx_memcpy_wrappers.h"
#include "core/fxcrt/fx_safe_types.h"
#include "core/fxcrt/fx_system.h"
#include "core/fxcrt/numerics/safe_math.h"
#include "core/fxcrt/span_util.h"
#include "core/fxcrt/string_pool_template.h"
#include "core/fxcrt/utf16.h"
template class fxcrt::StringViewTemplate<wchar_t>;
template class fxcrt::StringPoolTemplate<WideString>;
template struct std::hash<WideString>;
#define FORCE_ANSI …
#define FORCE_UNICODE …
#define FORCE_INT64 …
namespace {
#if defined(WCHAR_T_IS_32_BIT)
size_t FuseSurrogates(pdfium::span<wchar_t> s) { … }
#endif
constexpr wchar_t kWideTrimChars[] = …;
std::optional<size_t> GuessSizeForVSWPrintf(const wchar_t* pFormat,
va_list argList) { … }
std::optional<WideString> TryVSWPrintf(size_t size,
const wchar_t* pFormat,
va_list argList) { … }
void AppendCodePointToWideString(char32_t code_point, WideString& buffer) { … }
WideString UTF8Decode(ByteStringView bsStr) { … }
}
namespace fxcrt {
static_assert …;
WideString WideString::FormatInteger(int i) { … }
WideString WideString::FormatV(const wchar_t* format, va_list argList) { … }
WideString WideString::Format(const wchar_t* pFormat, ...) { … }
WideString::WideString(const wchar_t* pStr, size_t nLen) { … }
WideString::WideString(wchar_t ch) { … }
WideString::WideString(const wchar_t* ptr)
: … { … }
WideString::WideString(WideStringView stringSrc) { … }
WideString::WideString(WideStringView str1, WideStringView str2) { … }
WideString::WideString(const std::initializer_list<WideStringView>& list) { … }
WideString& WideString::operator=(const wchar_t* str) { … }
WideString& WideString::operator=(WideStringView str) { … }
WideString& WideString::operator=(const WideString& that) { … }
WideString& WideString::operator=(WideString&& that) noexcept { … }
WideString& WideString::operator+=(const wchar_t* str) { … }
WideString& WideString::operator+=(wchar_t ch) { … }
WideString& WideString::operator+=(const WideString& str) { … }
WideString& WideString::operator+=(WideStringView str) { … }
bool WideString::operator==(const wchar_t* ptr) const { … }
bool WideString::operator==(WideStringView str) const { … }
bool WideString::operator==(const WideString& other) const { … }
bool WideString::operator<(const wchar_t* ptr) const { … }
bool WideString::operator<(WideStringView str) const { … }
bool WideString::operator<(const WideString& other) const { … }
intptr_t WideString::ReferenceCountForTesting() const { … }
ByteString WideString::ToASCII() const { … }
ByteString WideString::ToLatin1() const { … }
ByteString WideString::ToDefANSI() const { … }
ByteString WideString::ToUTF8() const { … }
ByteString WideString::ToUTF16LE() const { … }
ByteString WideString::ToUCS2LE() const { … }
WideString WideString::EncodeEntities() const { … }
WideString WideString::Substr(size_t offset) const { … }
WideString WideString::Substr(size_t first, size_t count) const { … }
WideString WideString::First(size_t count) const { … }
WideString WideString::Last(size_t count) const { … }
void WideString::MakeLower() { … }
void WideString::MakeUpper() { … }
WideString WideString::FromASCII(ByteStringView bstr) { … }
WideString WideString::FromLatin1(ByteStringView bstr) { … }
WideString WideString::FromDefANSI(ByteStringView bstr) { … }
WideString WideString::FromUTF8(ByteStringView str) { … }
WideString WideString::FromUTF16LE(pdfium::span<const uint8_t> data) { … }
WideString WideString::FromUTF16BE(pdfium::span<const uint8_t> data) { … }
int WideString::Compare(const wchar_t* str) const { … }
int WideString::Compare(const WideString& str) const { … }
int WideString::CompareNoCase(const wchar_t* str) const { … }
void WideString::TrimWhitespace() { … }
void WideString::TrimWhitespaceFront() { … }
void WideString::TrimWhitespaceBack() { … }
int WideString::GetInteger() const { … }
std::wostream& operator<<(std::wostream& os, const WideString& str) { … }
std::ostream& operator<<(std::ostream& os, const WideString& str) { … }
std::wostream& operator<<(std::wostream& os, WideStringView str) { … }
std::ostream& operator<<(std::ostream& os, WideStringView str) { … }
}
uint32_t FX_HashCode_GetW(WideStringView str) { … }
uint32_t FX_HashCode_GetLoweredW(WideStringView str) { … }