3 #ifndef SIMDJSON_ONDEMAND_GENERIC_JSON_PATH_TO_POINTER_CONVERSION_INL_H
4 #define SIMDJSON_ONDEMAND_GENERIC_JSON_PATH_TO_POINTER_CONVERSION_INL_H
6 #ifndef SIMDJSON_CONDITIONAL_INCLUDE
7 #define SIMDJSON_GENERIC_ONDEMAND_JSON_PATH_TO_POINTER_CONVERSION_INL_H
8 #include "simdjson/generic/ondemand/json_path_to_pointer_conversion.h"
12 namespace SIMDJSON_IMPLEMENTATION {}
15 simdjson_inline std::string json_path_to_pointer_conversion(std::string_view json_path) {
16 if (json_path.empty() || (json_path.front() !=
'.' && json_path.front() !=
'[') {
23 result.reserve(json_path.size() * 2);
28 while (i < json_path.length()) {
29 if (json_path[i] ==
'.') {
31 }
else if (json_path[i] ==
'[') {
34 while (i < json_path.length() && json_path[i] !=
']') {
35 if (json_path[i] ==
'~') {
37 }
else if (json_path[i] ==
'/') {
40 result += json_path[i];
44 if (i == json_path.length() || json_path[i] !=
']') {
48 if (json_path[i] ==
'~') {
50 }
else if (json_path[i] ==
'/') {
53 result += json_path[i];
59 return simdjson_result<std::string>(result);
The top level simdjson namespace, containing everything the library provides.