5#include "testing/fx_string_testhelpers.h"
11#include "core/fxcrt/cfx_datetime.h"
12#include "core/fxcrt/check_op.h"
13#include "core/fxcrt/compiler_specific.h"
14#include "core/fxcrt/fx_string.h"
15#include "core/fxcrt/span.h"
16#include "fpdfsdk/cpdfsdk_helpers.h"
28 std::vector<std::string> result;
31 size_t found = str.find(delimiter, pos);
32 if (found == std::string::npos)
35 result.push_back(str.substr(pos, found - pos));
38 result.push_back(str.substr(pos));
49 return std::wstring();
51 size_t characters = 0;
52 while (wstr[characters])
55 std::wstring platform_string;
56 platform_string.reserve(characters);
57 for (size_t i = 0; i < characters; ++i) {
58 const unsigned char* ptr =
reinterpret_cast<
const unsigned char*>(&wstr[i]);
59 platform_string.push_back(ptr[0] + 256 * ptr[1]);
61 return platform_string;
65 size_t length =
sizeof(uint16_t) * (wstr.size() + 1);
70 pdfium::make_span(
reinterpret_cast<uint8_t*>(result.get()), length));
73 for (
wchar_t w : wstr) {
74 result_span[i++] = w & 0xff;
75 result_span[i++] = (w >> 8) & 0xff;
83 DCHECK_EQ(length_bytes %
sizeof(FPDF_WCHAR), 0u);
84 return std::vector<FPDF_WCHAR>(length_bytes /
sizeof(FPDF_WCHAR));
uint8_t GetSecond() const
uint8_t GetMinute() const
uint16_t GetMillisecond() const
ByteString ToUTF8() const
#define UNSAFE_BUFFERS(...)
UNSAFE_BUFFER_USAGE WideString WideStringFromFPDFWideString(FPDF_WIDESTRING wide_string)
std::unique_ptr< FPDF_WCHAR, pdfium::FreeDeleter > ScopedFPDFWideString
std::vector< FPDF_WCHAR > GetFPDFWideStringBuffer(size_t length_bytes)
std::vector< std::string > StringSplit(const std::string &str, char delimiter)
ScopedFPDFWideString GetFPDFWideString(const std::wstring &wstr)
std::string GetPlatformString(FPDF_WIDESTRING wstr)
std::wstring GetPlatformWString(FPDF_WIDESTRING wstr)
fxcrt::WideString WideString