7#include "core/fxcrt/fx_extension.h"
11#include "core/fxcrt/check.h"
12#include "core/fxcrt/compiler_specific.h"
13#include "core/fxcrt/fx_system.h"
14#include "core/fxcrt/utf16.h"
15#include "core/fxcrt/widestring.h"
19time_t DefaultTimeFunction() {
23struct tm* DefaultLocaltimeFunction(
const time_t* tp) {
27time_t (*g_time_func)() = DefaultTimeFunction;
28struct tm* (*g_localtime_func)(
const time_t*) = DefaultLocaltimeFunction;
35 wchar_t* endptr =
nullptr;
36 float result = wcstof(copied.c_str(), &endptr);
37 if (result != result) {
41 *pUsedLen = endptr - copied.c_str();
46wchar_t*
FXSYS_wcsncpy(
wchar_t* dstStr,
const wchar_t* srcStr, size_t count) {
53 for (size_t i = 0; i < count; ++i) {
54 dstStr[i] = srcStr[i];
55 if (dstStr[i] == L'\0') {
65 static const char kHex[] =
"0123456789ABCDEF";
68 buf[0] = kHex[n / 16];
69 buf[1] = kHex[n % 16];
84 DCHECK(unicode <= pdfium::kMaximumSupplementaryCodePoint);
85 DCHECK(!pdfium::IsHighSurrogate(unicode));
86 DCHECK(!pdfium::IsLowSurrogate(unicode));
88 if (unicode <= 0xFFFF) {
102 g_time_func = func ? func : DefaultTimeFunction;
106 g_localtime_func = func ? func : DefaultLocaltimeFunction;
110 time_t ret_val = g_time_func();
117 return g_localtime_func(tp);
constexpr SurrogatePair(char32_t code_point)
constexpr char16_t high() const
constexpr char16_t low() const
#define UNSAFE_BUFFERS(...)
time_t FXSYS_time(time_t *tloc)
void FXSYS_IntToTwoHexChars(uint8_t n, char *buf)
void FXSYS_SetTimeFunction(time_t(*func)())
float FXSYS_wcstof(WideStringView pwsStr, size_t *pUsedLen)
size_t FXSYS_ToUTF16BE(uint32_t unicode, char *buf)
void FXSYS_IntToFourHexChars(uint16_t n, char *buf)
struct tm * FXSYS_localtime(const time_t *tp)
UNSAFE_BUFFER_USAGE wchar_t * FXSYS_wcsncpy(wchar_t *dstStr, const wchar_t *srcStr, size_t count)
void FXSYS_SetLocaltimeFunction(struct tm *(*func)(const time_t *))
fxcrt::WideStringView WideStringView
fxcrt::WideString WideString