rodecomp/Recovered/jsoncons/include/jsoncons_ext/jsonpath/jsonpath_utilities.hpp
ragnarok-clanker 9b9c369f0c Move exe-only code to Recovered/ and rebuild virtualised PakAuxiliary::Extract
Recovered/ holds the code linked only into the standalone exe (scripts/exe/build_exe.py), outside the Clank source dirs:
- jsoncons/ and nProtect/ moved from scripts/exe/; GameGuard stand-in follows main's renamed entry points.
- GPak/PakAuxiliary.cpp: Extract (virtualised in every build; 02-19 jumps out at 0x0065861E) rebuilt from the open GRF Editor decoder, after the visible 02-19 prologue; inline key and kRO keys 1-4. Apply traps (unreachable in 02-19).
- GGHash/GGHash.cpp: CGGHash::Load/Check/VerifyHash trap (RagHash.dat check unreachable in 02-19).
The whole client links: 984 units, 0 unresolved.
2026-11-06 19:33:10 +01:00

77 lines
2.3 KiB
C++

// Copyright 2013-2023 Daniel Parker
// Distributed under the Boost license, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
// See https://github.com/danielaparker/jsoncons for latest version
#ifndef JSONCONS_JSONPATH_UTILITIES_HPP
#define JSONCONS_JSONPATH_UTILITIES_HPP
#include <string>
#include <vector>
#include <memory>
#include <type_traits> // std::is_const
#include <limits> // std::numeric_limits
#include <utility> // std::move
#include <algorithm> // std::copy
#include <iterator> // std::back_inserter
namespace jsoncons { namespace jsonpath {
template <class CharT, class Sink>
std::size_t escape_string(const CharT* s, std::size_t length, Sink& sink)
{
std::size_t count = 0;
const CharT* begin = s;
const CharT* end = s + length;
for (const CharT* it = begin; it != end; ++it)
{
CharT c = *it;
switch (c)
{
case '\\':
sink.push_back('\\');
sink.push_back('\\');
count += 2;
break;
case '\'':
sink.push_back('\\');
sink.push_back('\'');
count += 2;
break;
case '\b':
sink.push_back('\\');
sink.push_back('b');
count += 2;
break;
case '\f':
sink.push_back('\\');
sink.push_back('f');
count += 2;
break;
case '\n':
sink.push_back('\\');
sink.push_back('n');
count += 2;
break;
case '\r':
sink.push_back('\\');
sink.push_back('r');
count += 2;
break;
case '\t':
sink.push_back('\\');
sink.push_back('t');
count += 2;
break;
default:
sink.push_back(c);
++count;
break;
}
}
return count;
}
}}
#endif