|
|
|
@@ -1,4 +1,4 @@
|
|
|
|
|
/* auto-generated on 2025-01-06 19:23:09 -0500. Do not edit! */
|
|
|
|
|
/* auto-generated on 2025-01-08 21:29:11 -0500. Do not edit! */
|
|
|
|
|
/* including simdjson.h: */
|
|
|
|
|
/* begin file simdjson.h */
|
|
|
|
|
#ifndef SIMDJSON_H
|
|
|
|
@@ -2437,7 +2437,7 @@ namespace std {
|
|
|
|
|
#define SIMDJSON_SIMDJSON_VERSION_H
|
|
|
|
|
|
|
|
|
|
/** The version of simdjson being used (major.minor.revision) */
|
|
|
|
|
#define SIMDJSON_VERSION "3.11.4"
|
|
|
|
|
#define SIMDJSON_VERSION "3.11.5"
|
|
|
|
|
|
|
|
|
|
namespace simdjson {
|
|
|
|
|
enum {
|
|
|
|
@@ -2452,7 +2452,7 @@ enum {
|
|
|
|
|
/**
|
|
|
|
|
* The revision (major.minor.REVISION) of simdjson being used.
|
|
|
|
|
*/
|
|
|
|
|
SIMDJSON_VERSION_REVISION = 4
|
|
|
|
|
SIMDJSON_VERSION_REVISION = 5
|
|
|
|
|
};
|
|
|
|
|
} // namespace simdjson
|
|
|
|
|
|
|
|
|
@@ -40965,36 +40965,39 @@ simdjson_inline const char * raw_json_string::raw() const noexcept { return rein
|
|
|
|
|
|
|
|
|
|
simdjson_inline bool raw_json_string::is_free_from_unescaped_quote(std::string_view target) noexcept {
|
|
|
|
|
size_t pos{0};
|
|
|
|
|
// if the content has no escape character, just scan through it quickly!
|
|
|
|
|
for(;pos < target.size() && target[pos] != '\\';pos++) {}
|
|
|
|
|
// slow path may begin.
|
|
|
|
|
bool escaping{false};
|
|
|
|
|
for(;pos < target.size();pos++) {
|
|
|
|
|
if((target[pos] == '"') && !escaping) {
|
|
|
|
|
return false;
|
|
|
|
|
} else if(target[pos] == '\\') {
|
|
|
|
|
escaping = !escaping;
|
|
|
|
|
} else {
|
|
|
|
|
escaping = false;
|
|
|
|
|
while(pos < target.size()) {
|
|
|
|
|
pos = target.find('"', pos);
|
|
|
|
|
if(pos == std::string_view::npos) { return true; }
|
|
|
|
|
if(pos != 0 && target[pos-1] != '\\') { return false; }
|
|
|
|
|
if(pos > 1 && target[pos-2] == '\\') {
|
|
|
|
|
size_t backslash_count{2};
|
|
|
|
|
for(size_t i = 3; i <= pos; i++) {
|
|
|
|
|
if(target[pos-i] == '\\') { backslash_count++; }
|
|
|
|
|
else { break; }
|
|
|
|
|
}
|
|
|
|
|
if(backslash_count % 2 == 0) { return false; }
|
|
|
|
|
}
|
|
|
|
|
pos++;
|
|
|
|
|
}
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
simdjson_inline bool raw_json_string::is_free_from_unescaped_quote(const char* target) noexcept {
|
|
|
|
|
size_t pos{0};
|
|
|
|
|
// if the content has no escape character, just scan through it quickly!
|
|
|
|
|
for(;target[pos] && target[pos] != '\\';pos++) {}
|
|
|
|
|
// slow path may begin.
|
|
|
|
|
bool escaping{false};
|
|
|
|
|
for(;target[pos];pos++) {
|
|
|
|
|
if((target[pos] == '"') && !escaping) {
|
|
|
|
|
return false;
|
|
|
|
|
} else if(target[pos] == '\\') {
|
|
|
|
|
escaping = !escaping;
|
|
|
|
|
} else {
|
|
|
|
|
escaping = false;
|
|
|
|
|
while(target[pos]) {
|
|
|
|
|
const char * result = strchr(target+pos, '"');
|
|
|
|
|
if(result == nullptr) { return true; }
|
|
|
|
|
pos = result - target;
|
|
|
|
|
if(pos != 0 && target[pos-1] != '\\') { return false; }
|
|
|
|
|
if(pos > 1 && target[pos-2] == '\\') {
|
|
|
|
|
size_t backslash_count{2};
|
|
|
|
|
for(size_t i = 3; i <= pos; i++) {
|
|
|
|
|
if(target[pos-i] == '\\') { backslash_count++; }
|
|
|
|
|
else { break; }
|
|
|
|
|
}
|
|
|
|
|
if(backslash_count % 2 == 0) { return false; }
|
|
|
|
|
}
|
|
|
|
|
pos++;
|
|
|
|
|
}
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
@@ -41006,7 +41009,7 @@ simdjson_inline bool raw_json_string::unsafe_is_equal(size_t length, std::string
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
simdjson_inline bool raw_json_string::unsafe_is_equal(std::string_view target) const noexcept {
|
|
|
|
|
// Assumptions: does not contain unescaped quote characters, and
|
|
|
|
|
// Assumptions: does not contain unescaped quote characters("), and
|
|
|
|
|
// the raw content is quote terminated within a valid JSON string.
|
|
|
|
|
if(target.size() <= SIMDJSON_PADDING) {
|
|
|
|
|
return (raw()[target.size()] == '"') && !memcmp(raw(), target.data(), target.size());
|
|
|
|
@@ -51938,36 +51941,39 @@ simdjson_inline const char * raw_json_string::raw() const noexcept { return rein
|
|
|
|
|
|
|
|
|
|
simdjson_inline bool raw_json_string::is_free_from_unescaped_quote(std::string_view target) noexcept {
|
|
|
|
|
size_t pos{0};
|
|
|
|
|
// if the content has no escape character, just scan through it quickly!
|
|
|
|
|
for(;pos < target.size() && target[pos] != '\\';pos++) {}
|
|
|
|
|
// slow path may begin.
|
|
|
|
|
bool escaping{false};
|
|
|
|
|
for(;pos < target.size();pos++) {
|
|
|
|
|
if((target[pos] == '"') && !escaping) {
|
|
|
|
|
return false;
|
|
|
|
|
} else if(target[pos] == '\\') {
|
|
|
|
|
escaping = !escaping;
|
|
|
|
|
} else {
|
|
|
|
|
escaping = false;
|
|
|
|
|
while(pos < target.size()) {
|
|
|
|
|
pos = target.find('"', pos);
|
|
|
|
|
if(pos == std::string_view::npos) { return true; }
|
|
|
|
|
if(pos != 0 && target[pos-1] != '\\') { return false; }
|
|
|
|
|
if(pos > 1 && target[pos-2] == '\\') {
|
|
|
|
|
size_t backslash_count{2};
|
|
|
|
|
for(size_t i = 3; i <= pos; i++) {
|
|
|
|
|
if(target[pos-i] == '\\') { backslash_count++; }
|
|
|
|
|
else { break; }
|
|
|
|
|
}
|
|
|
|
|
if(backslash_count % 2 == 0) { return false; }
|
|
|
|
|
}
|
|
|
|
|
pos++;
|
|
|
|
|
}
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
simdjson_inline bool raw_json_string::is_free_from_unescaped_quote(const char* target) noexcept {
|
|
|
|
|
size_t pos{0};
|
|
|
|
|
// if the content has no escape character, just scan through it quickly!
|
|
|
|
|
for(;target[pos] && target[pos] != '\\';pos++) {}
|
|
|
|
|
// slow path may begin.
|
|
|
|
|
bool escaping{false};
|
|
|
|
|
for(;target[pos];pos++) {
|
|
|
|
|
if((target[pos] == '"') && !escaping) {
|
|
|
|
|
return false;
|
|
|
|
|
} else if(target[pos] == '\\') {
|
|
|
|
|
escaping = !escaping;
|
|
|
|
|
} else {
|
|
|
|
|
escaping = false;
|
|
|
|
|
while(target[pos]) {
|
|
|
|
|
const char * result = strchr(target+pos, '"');
|
|
|
|
|
if(result == nullptr) { return true; }
|
|
|
|
|
pos = result - target;
|
|
|
|
|
if(pos != 0 && target[pos-1] != '\\') { return false; }
|
|
|
|
|
if(pos > 1 && target[pos-2] == '\\') {
|
|
|
|
|
size_t backslash_count{2};
|
|
|
|
|
for(size_t i = 3; i <= pos; i++) {
|
|
|
|
|
if(target[pos-i] == '\\') { backslash_count++; }
|
|
|
|
|
else { break; }
|
|
|
|
|
}
|
|
|
|
|
if(backslash_count % 2 == 0) { return false; }
|
|
|
|
|
}
|
|
|
|
|
pos++;
|
|
|
|
|
}
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
@@ -51979,7 +51985,7 @@ simdjson_inline bool raw_json_string::unsafe_is_equal(size_t length, std::string
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
simdjson_inline bool raw_json_string::unsafe_is_equal(std::string_view target) const noexcept {
|
|
|
|
|
// Assumptions: does not contain unescaped quote characters, and
|
|
|
|
|
// Assumptions: does not contain unescaped quote characters("), and
|
|
|
|
|
// the raw content is quote terminated within a valid JSON string.
|
|
|
|
|
if(target.size() <= SIMDJSON_PADDING) {
|
|
|
|
|
return (raw()[target.size()] == '"') && !memcmp(raw(), target.data(), target.size());
|
|
|
|
@@ -63403,36 +63409,39 @@ simdjson_inline const char * raw_json_string::raw() const noexcept { return rein
|
|
|
|
|
|
|
|
|
|
simdjson_inline bool raw_json_string::is_free_from_unescaped_quote(std::string_view target) noexcept {
|
|
|
|
|
size_t pos{0};
|
|
|
|
|
// if the content has no escape character, just scan through it quickly!
|
|
|
|
|
for(;pos < target.size() && target[pos] != '\\';pos++) {}
|
|
|
|
|
// slow path may begin.
|
|
|
|
|
bool escaping{false};
|
|
|
|
|
for(;pos < target.size();pos++) {
|
|
|
|
|
if((target[pos] == '"') && !escaping) {
|
|
|
|
|
return false;
|
|
|
|
|
} else if(target[pos] == '\\') {
|
|
|
|
|
escaping = !escaping;
|
|
|
|
|
} else {
|
|
|
|
|
escaping = false;
|
|
|
|
|
while(pos < target.size()) {
|
|
|
|
|
pos = target.find('"', pos);
|
|
|
|
|
if(pos == std::string_view::npos) { return true; }
|
|
|
|
|
if(pos != 0 && target[pos-1] != '\\') { return false; }
|
|
|
|
|
if(pos > 1 && target[pos-2] == '\\') {
|
|
|
|
|
size_t backslash_count{2};
|
|
|
|
|
for(size_t i = 3; i <= pos; i++) {
|
|
|
|
|
if(target[pos-i] == '\\') { backslash_count++; }
|
|
|
|
|
else { break; }
|
|
|
|
|
}
|
|
|
|
|
if(backslash_count % 2 == 0) { return false; }
|
|
|
|
|
}
|
|
|
|
|
pos++;
|
|
|
|
|
}
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
simdjson_inline bool raw_json_string::is_free_from_unescaped_quote(const char* target) noexcept {
|
|
|
|
|
size_t pos{0};
|
|
|
|
|
// if the content has no escape character, just scan through it quickly!
|
|
|
|
|
for(;target[pos] && target[pos] != '\\';pos++) {}
|
|
|
|
|
// slow path may begin.
|
|
|
|
|
bool escaping{false};
|
|
|
|
|
for(;target[pos];pos++) {
|
|
|
|
|
if((target[pos] == '"') && !escaping) {
|
|
|
|
|
return false;
|
|
|
|
|
} else if(target[pos] == '\\') {
|
|
|
|
|
escaping = !escaping;
|
|
|
|
|
} else {
|
|
|
|
|
escaping = false;
|
|
|
|
|
while(target[pos]) {
|
|
|
|
|
const char * result = strchr(target+pos, '"');
|
|
|
|
|
if(result == nullptr) { return true; }
|
|
|
|
|
pos = result - target;
|
|
|
|
|
if(pos != 0 && target[pos-1] != '\\') { return false; }
|
|
|
|
|
if(pos > 1 && target[pos-2] == '\\') {
|
|
|
|
|
size_t backslash_count{2};
|
|
|
|
|
for(size_t i = 3; i <= pos; i++) {
|
|
|
|
|
if(target[pos-i] == '\\') { backslash_count++; }
|
|
|
|
|
else { break; }
|
|
|
|
|
}
|
|
|
|
|
if(backslash_count % 2 == 0) { return false; }
|
|
|
|
|
}
|
|
|
|
|
pos++;
|
|
|
|
|
}
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
@@ -63444,7 +63453,7 @@ simdjson_inline bool raw_json_string::unsafe_is_equal(size_t length, std::string
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
simdjson_inline bool raw_json_string::unsafe_is_equal(std::string_view target) const noexcept {
|
|
|
|
|
// Assumptions: does not contain unescaped quote characters, and
|
|
|
|
|
// Assumptions: does not contain unescaped quote characters("), and
|
|
|
|
|
// the raw content is quote terminated within a valid JSON string.
|
|
|
|
|
if(target.size() <= SIMDJSON_PADDING) {
|
|
|
|
|
return (raw()[target.size()] == '"') && !memcmp(raw(), target.data(), target.size());
|
|
|
|
@@ -74861,36 +74870,39 @@ simdjson_inline const char * raw_json_string::raw() const noexcept { return rein
|
|
|
|
|
|
|
|
|
|
simdjson_inline bool raw_json_string::is_free_from_unescaped_quote(std::string_view target) noexcept {
|
|
|
|
|
size_t pos{0};
|
|
|
|
|
// if the content has no escape character, just scan through it quickly!
|
|
|
|
|
for(;pos < target.size() && target[pos] != '\\';pos++) {}
|
|
|
|
|
// slow path may begin.
|
|
|
|
|
bool escaping{false};
|
|
|
|
|
for(;pos < target.size();pos++) {
|
|
|
|
|
if((target[pos] == '"') && !escaping) {
|
|
|
|
|
return false;
|
|
|
|
|
} else if(target[pos] == '\\') {
|
|
|
|
|
escaping = !escaping;
|
|
|
|
|
} else {
|
|
|
|
|
escaping = false;
|
|
|
|
|
while(pos < target.size()) {
|
|
|
|
|
pos = target.find('"', pos);
|
|
|
|
|
if(pos == std::string_view::npos) { return true; }
|
|
|
|
|
if(pos != 0 && target[pos-1] != '\\') { return false; }
|
|
|
|
|
if(pos > 1 && target[pos-2] == '\\') {
|
|
|
|
|
size_t backslash_count{2};
|
|
|
|
|
for(size_t i = 3; i <= pos; i++) {
|
|
|
|
|
if(target[pos-i] == '\\') { backslash_count++; }
|
|
|
|
|
else { break; }
|
|
|
|
|
}
|
|
|
|
|
if(backslash_count % 2 == 0) { return false; }
|
|
|
|
|
}
|
|
|
|
|
pos++;
|
|
|
|
|
}
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
simdjson_inline bool raw_json_string::is_free_from_unescaped_quote(const char* target) noexcept {
|
|
|
|
|
size_t pos{0};
|
|
|
|
|
// if the content has no escape character, just scan through it quickly!
|
|
|
|
|
for(;target[pos] && target[pos] != '\\';pos++) {}
|
|
|
|
|
// slow path may begin.
|
|
|
|
|
bool escaping{false};
|
|
|
|
|
for(;target[pos];pos++) {
|
|
|
|
|
if((target[pos] == '"') && !escaping) {
|
|
|
|
|
return false;
|
|
|
|
|
} else if(target[pos] == '\\') {
|
|
|
|
|
escaping = !escaping;
|
|
|
|
|
} else {
|
|
|
|
|
escaping = false;
|
|
|
|
|
while(target[pos]) {
|
|
|
|
|
const char * result = strchr(target+pos, '"');
|
|
|
|
|
if(result == nullptr) { return true; }
|
|
|
|
|
pos = result - target;
|
|
|
|
|
if(pos != 0 && target[pos-1] != '\\') { return false; }
|
|
|
|
|
if(pos > 1 && target[pos-2] == '\\') {
|
|
|
|
|
size_t backslash_count{2};
|
|
|
|
|
for(size_t i = 3; i <= pos; i++) {
|
|
|
|
|
if(target[pos-i] == '\\') { backslash_count++; }
|
|
|
|
|
else { break; }
|
|
|
|
|
}
|
|
|
|
|
if(backslash_count % 2 == 0) { return false; }
|
|
|
|
|
}
|
|
|
|
|
pos++;
|
|
|
|
|
}
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
@@ -74902,7 +74914,7 @@ simdjson_inline bool raw_json_string::unsafe_is_equal(size_t length, std::string
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
simdjson_inline bool raw_json_string::unsafe_is_equal(std::string_view target) const noexcept {
|
|
|
|
|
// Assumptions: does not contain unescaped quote characters, and
|
|
|
|
|
// Assumptions: does not contain unescaped quote characters("), and
|
|
|
|
|
// the raw content is quote terminated within a valid JSON string.
|
|
|
|
|
if(target.size() <= SIMDJSON_PADDING) {
|
|
|
|
|
return (raw()[target.size()] == '"') && !memcmp(raw(), target.data(), target.size());
|
|
|
|
@@ -86440,36 +86452,39 @@ simdjson_inline const char * raw_json_string::raw() const noexcept { return rein
|
|
|
|
|
|
|
|
|
|
simdjson_inline bool raw_json_string::is_free_from_unescaped_quote(std::string_view target) noexcept {
|
|
|
|
|
size_t pos{0};
|
|
|
|
|
// if the content has no escape character, just scan through it quickly!
|
|
|
|
|
for(;pos < target.size() && target[pos] != '\\';pos++) {}
|
|
|
|
|
// slow path may begin.
|
|
|
|
|
bool escaping{false};
|
|
|
|
|
for(;pos < target.size();pos++) {
|
|
|
|
|
if((target[pos] == '"') && !escaping) {
|
|
|
|
|
return false;
|
|
|
|
|
} else if(target[pos] == '\\') {
|
|
|
|
|
escaping = !escaping;
|
|
|
|
|
} else {
|
|
|
|
|
escaping = false;
|
|
|
|
|
while(pos < target.size()) {
|
|
|
|
|
pos = target.find('"', pos);
|
|
|
|
|
if(pos == std::string_view::npos) { return true; }
|
|
|
|
|
if(pos != 0 && target[pos-1] != '\\') { return false; }
|
|
|
|
|
if(pos > 1 && target[pos-2] == '\\') {
|
|
|
|
|
size_t backslash_count{2};
|
|
|
|
|
for(size_t i = 3; i <= pos; i++) {
|
|
|
|
|
if(target[pos-i] == '\\') { backslash_count++; }
|
|
|
|
|
else { break; }
|
|
|
|
|
}
|
|
|
|
|
if(backslash_count % 2 == 0) { return false; }
|
|
|
|
|
}
|
|
|
|
|
pos++;
|
|
|
|
|
}
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
simdjson_inline bool raw_json_string::is_free_from_unescaped_quote(const char* target) noexcept {
|
|
|
|
|
size_t pos{0};
|
|
|
|
|
// if the content has no escape character, just scan through it quickly!
|
|
|
|
|
for(;target[pos] && target[pos] != '\\';pos++) {}
|
|
|
|
|
// slow path may begin.
|
|
|
|
|
bool escaping{false};
|
|
|
|
|
for(;target[pos];pos++) {
|
|
|
|
|
if((target[pos] == '"') && !escaping) {
|
|
|
|
|
return false;
|
|
|
|
|
} else if(target[pos] == '\\') {
|
|
|
|
|
escaping = !escaping;
|
|
|
|
|
} else {
|
|
|
|
|
escaping = false;
|
|
|
|
|
while(target[pos]) {
|
|
|
|
|
const char * result = strchr(target+pos, '"');
|
|
|
|
|
if(result == nullptr) { return true; }
|
|
|
|
|
pos = result - target;
|
|
|
|
|
if(pos != 0 && target[pos-1] != '\\') { return false; }
|
|
|
|
|
if(pos > 1 && target[pos-2] == '\\') {
|
|
|
|
|
size_t backslash_count{2};
|
|
|
|
|
for(size_t i = 3; i <= pos; i++) {
|
|
|
|
|
if(target[pos-i] == '\\') { backslash_count++; }
|
|
|
|
|
else { break; }
|
|
|
|
|
}
|
|
|
|
|
if(backslash_count % 2 == 0) { return false; }
|
|
|
|
|
}
|
|
|
|
|
pos++;
|
|
|
|
|
}
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
@@ -86481,7 +86496,7 @@ simdjson_inline bool raw_json_string::unsafe_is_equal(size_t length, std::string
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
simdjson_inline bool raw_json_string::unsafe_is_equal(std::string_view target) const noexcept {
|
|
|
|
|
// Assumptions: does not contain unescaped quote characters, and
|
|
|
|
|
// Assumptions: does not contain unescaped quote characters("), and
|
|
|
|
|
// the raw content is quote terminated within a valid JSON string.
|
|
|
|
|
if(target.size() <= SIMDJSON_PADDING) {
|
|
|
|
|
return (raw()[target.size()] == '"') && !memcmp(raw(), target.data(), target.size());
|
|
|
|
@@ -98336,36 +98351,39 @@ simdjson_inline const char * raw_json_string::raw() const noexcept { return rein
|
|
|
|
|
|
|
|
|
|
simdjson_inline bool raw_json_string::is_free_from_unescaped_quote(std::string_view target) noexcept {
|
|
|
|
|
size_t pos{0};
|
|
|
|
|
// if the content has no escape character, just scan through it quickly!
|
|
|
|
|
for(;pos < target.size() && target[pos] != '\\';pos++) {}
|
|
|
|
|
// slow path may begin.
|
|
|
|
|
bool escaping{false};
|
|
|
|
|
for(;pos < target.size();pos++) {
|
|
|
|
|
if((target[pos] == '"') && !escaping) {
|
|
|
|
|
return false;
|
|
|
|
|
} else if(target[pos] == '\\') {
|
|
|
|
|
escaping = !escaping;
|
|
|
|
|
} else {
|
|
|
|
|
escaping = false;
|
|
|
|
|
while(pos < target.size()) {
|
|
|
|
|
pos = target.find('"', pos);
|
|
|
|
|
if(pos == std::string_view::npos) { return true; }
|
|
|
|
|
if(pos != 0 && target[pos-1] != '\\') { return false; }
|
|
|
|
|
if(pos > 1 && target[pos-2] == '\\') {
|
|
|
|
|
size_t backslash_count{2};
|
|
|
|
|
for(size_t i = 3; i <= pos; i++) {
|
|
|
|
|
if(target[pos-i] == '\\') { backslash_count++; }
|
|
|
|
|
else { break; }
|
|
|
|
|
}
|
|
|
|
|
if(backslash_count % 2 == 0) { return false; }
|
|
|
|
|
}
|
|
|
|
|
pos++;
|
|
|
|
|
}
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
simdjson_inline bool raw_json_string::is_free_from_unescaped_quote(const char* target) noexcept {
|
|
|
|
|
size_t pos{0};
|
|
|
|
|
// if the content has no escape character, just scan through it quickly!
|
|
|
|
|
for(;target[pos] && target[pos] != '\\';pos++) {}
|
|
|
|
|
// slow path may begin.
|
|
|
|
|
bool escaping{false};
|
|
|
|
|
for(;target[pos];pos++) {
|
|
|
|
|
if((target[pos] == '"') && !escaping) {
|
|
|
|
|
return false;
|
|
|
|
|
} else if(target[pos] == '\\') {
|
|
|
|
|
escaping = !escaping;
|
|
|
|
|
} else {
|
|
|
|
|
escaping = false;
|
|
|
|
|
while(target[pos]) {
|
|
|
|
|
const char * result = strchr(target+pos, '"');
|
|
|
|
|
if(result == nullptr) { return true; }
|
|
|
|
|
pos = result - target;
|
|
|
|
|
if(pos != 0 && target[pos-1] != '\\') { return false; }
|
|
|
|
|
if(pos > 1 && target[pos-2] == '\\') {
|
|
|
|
|
size_t backslash_count{2};
|
|
|
|
|
for(size_t i = 3; i <= pos; i++) {
|
|
|
|
|
if(target[pos-i] == '\\') { backslash_count++; }
|
|
|
|
|
else { break; }
|
|
|
|
|
}
|
|
|
|
|
if(backslash_count % 2 == 0) { return false; }
|
|
|
|
|
}
|
|
|
|
|
pos++;
|
|
|
|
|
}
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
@@ -98377,7 +98395,7 @@ simdjson_inline bool raw_json_string::unsafe_is_equal(size_t length, std::string
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
simdjson_inline bool raw_json_string::unsafe_is_equal(std::string_view target) const noexcept {
|
|
|
|
|
// Assumptions: does not contain unescaped quote characters, and
|
|
|
|
|
// Assumptions: does not contain unescaped quote characters("), and
|
|
|
|
|
// the raw content is quote terminated within a valid JSON string.
|
|
|
|
|
if(target.size() <= SIMDJSON_PADDING) {
|
|
|
|
|
return (raw()[target.size()] == '"') && !memcmp(raw(), target.data(), target.size());
|
|
|
|
@@ -109709,36 +109727,39 @@ simdjson_inline const char * raw_json_string::raw() const noexcept { return rein
|
|
|
|
|
|
|
|
|
|
simdjson_inline bool raw_json_string::is_free_from_unescaped_quote(std::string_view target) noexcept {
|
|
|
|
|
size_t pos{0};
|
|
|
|
|
// if the content has no escape character, just scan through it quickly!
|
|
|
|
|
for(;pos < target.size() && target[pos] != '\\';pos++) {}
|
|
|
|
|
// slow path may begin.
|
|
|
|
|
bool escaping{false};
|
|
|
|
|
for(;pos < target.size();pos++) {
|
|
|
|
|
if((target[pos] == '"') && !escaping) {
|
|
|
|
|
return false;
|
|
|
|
|
} else if(target[pos] == '\\') {
|
|
|
|
|
escaping = !escaping;
|
|
|
|
|
} else {
|
|
|
|
|
escaping = false;
|
|
|
|
|
while(pos < target.size()) {
|
|
|
|
|
pos = target.find('"', pos);
|
|
|
|
|
if(pos == std::string_view::npos) { return true; }
|
|
|
|
|
if(pos != 0 && target[pos-1] != '\\') { return false; }
|
|
|
|
|
if(pos > 1 && target[pos-2] == '\\') {
|
|
|
|
|
size_t backslash_count{2};
|
|
|
|
|
for(size_t i = 3; i <= pos; i++) {
|
|
|
|
|
if(target[pos-i] == '\\') { backslash_count++; }
|
|
|
|
|
else { break; }
|
|
|
|
|
}
|
|
|
|
|
if(backslash_count % 2 == 0) { return false; }
|
|
|
|
|
}
|
|
|
|
|
pos++;
|
|
|
|
|
}
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
simdjson_inline bool raw_json_string::is_free_from_unescaped_quote(const char* target) noexcept {
|
|
|
|
|
size_t pos{0};
|
|
|
|
|
// if the content has no escape character, just scan through it quickly!
|
|
|
|
|
for(;target[pos] && target[pos] != '\\';pos++) {}
|
|
|
|
|
// slow path may begin.
|
|
|
|
|
bool escaping{false};
|
|
|
|
|
for(;target[pos];pos++) {
|
|
|
|
|
if((target[pos] == '"') && !escaping) {
|
|
|
|
|
return false;
|
|
|
|
|
} else if(target[pos] == '\\') {
|
|
|
|
|
escaping = !escaping;
|
|
|
|
|
} else {
|
|
|
|
|
escaping = false;
|
|
|
|
|
while(target[pos]) {
|
|
|
|
|
const char * result = strchr(target+pos, '"');
|
|
|
|
|
if(result == nullptr) { return true; }
|
|
|
|
|
pos = result - target;
|
|
|
|
|
if(pos != 0 && target[pos-1] != '\\') { return false; }
|
|
|
|
|
if(pos > 1 && target[pos-2] == '\\') {
|
|
|
|
|
size_t backslash_count{2};
|
|
|
|
|
for(size_t i = 3; i <= pos; i++) {
|
|
|
|
|
if(target[pos-i] == '\\') { backslash_count++; }
|
|
|
|
|
else { break; }
|
|
|
|
|
}
|
|
|
|
|
if(backslash_count % 2 == 0) { return false; }
|
|
|
|
|
}
|
|
|
|
|
pos++;
|
|
|
|
|
}
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
@@ -109750,7 +109771,7 @@ simdjson_inline bool raw_json_string::unsafe_is_equal(size_t length, std::string
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
simdjson_inline bool raw_json_string::unsafe_is_equal(std::string_view target) const noexcept {
|
|
|
|
|
// Assumptions: does not contain unescaped quote characters, and
|
|
|
|
|
// Assumptions: does not contain unescaped quote characters("), and
|
|
|
|
|
// the raw content is quote terminated within a valid JSON string.
|
|
|
|
|
if(target.size() <= SIMDJSON_PADDING) {
|
|
|
|
|
return (raw()[target.size()] == '"') && !memcmp(raw(), target.data(), target.size());
|
|
|
|
@@ -121095,36 +121116,39 @@ simdjson_inline const char * raw_json_string::raw() const noexcept { return rein
|
|
|
|
|
|
|
|
|
|
simdjson_inline bool raw_json_string::is_free_from_unescaped_quote(std::string_view target) noexcept {
|
|
|
|
|
size_t pos{0};
|
|
|
|
|
// if the content has no escape character, just scan through it quickly!
|
|
|
|
|
for(;pos < target.size() && target[pos] != '\\';pos++) {}
|
|
|
|
|
// slow path may begin.
|
|
|
|
|
bool escaping{false};
|
|
|
|
|
for(;pos < target.size();pos++) {
|
|
|
|
|
if((target[pos] == '"') && !escaping) {
|
|
|
|
|
return false;
|
|
|
|
|
} else if(target[pos] == '\\') {
|
|
|
|
|
escaping = !escaping;
|
|
|
|
|
} else {
|
|
|
|
|
escaping = false;
|
|
|
|
|
while(pos < target.size()) {
|
|
|
|
|
pos = target.find('"', pos);
|
|
|
|
|
if(pos == std::string_view::npos) { return true; }
|
|
|
|
|
if(pos != 0 && target[pos-1] != '\\') { return false; }
|
|
|
|
|
if(pos > 1 && target[pos-2] == '\\') {
|
|
|
|
|
size_t backslash_count{2};
|
|
|
|
|
for(size_t i = 3; i <= pos; i++) {
|
|
|
|
|
if(target[pos-i] == '\\') { backslash_count++; }
|
|
|
|
|
else { break; }
|
|
|
|
|
}
|
|
|
|
|
if(backslash_count % 2 == 0) { return false; }
|
|
|
|
|
}
|
|
|
|
|
pos++;
|
|
|
|
|
}
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
simdjson_inline bool raw_json_string::is_free_from_unescaped_quote(const char* target) noexcept {
|
|
|
|
|
size_t pos{0};
|
|
|
|
|
// if the content has no escape character, just scan through it quickly!
|
|
|
|
|
for(;target[pos] && target[pos] != '\\';pos++) {}
|
|
|
|
|
// slow path may begin.
|
|
|
|
|
bool escaping{false};
|
|
|
|
|
for(;target[pos];pos++) {
|
|
|
|
|
if((target[pos] == '"') && !escaping) {
|
|
|
|
|
return false;
|
|
|
|
|
} else if(target[pos] == '\\') {
|
|
|
|
|
escaping = !escaping;
|
|
|
|
|
} else {
|
|
|
|
|
escaping = false;
|
|
|
|
|
while(target[pos]) {
|
|
|
|
|
const char * result = strchr(target+pos, '"');
|
|
|
|
|
if(result == nullptr) { return true; }
|
|
|
|
|
pos = result - target;
|
|
|
|
|
if(pos != 0 && target[pos-1] != '\\') { return false; }
|
|
|
|
|
if(pos > 1 && target[pos-2] == '\\') {
|
|
|
|
|
size_t backslash_count{2};
|
|
|
|
|
for(size_t i = 3; i <= pos; i++) {
|
|
|
|
|
if(target[pos-i] == '\\') { backslash_count++; }
|
|
|
|
|
else { break; }
|
|
|
|
|
}
|
|
|
|
|
if(backslash_count % 2 == 0) { return false; }
|
|
|
|
|
}
|
|
|
|
|
pos++;
|
|
|
|
|
}
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
@@ -121136,7 +121160,7 @@ simdjson_inline bool raw_json_string::unsafe_is_equal(size_t length, std::string
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
simdjson_inline bool raw_json_string::unsafe_is_equal(std::string_view target) const noexcept {
|
|
|
|
|
// Assumptions: does not contain unescaped quote characters, and
|
|
|
|
|
// Assumptions: does not contain unescaped quote characters("), and
|
|
|
|
|
// the raw content is quote terminated within a valid JSON string.
|
|
|
|
|
if(target.size() <= SIMDJSON_PADDING) {
|
|
|
|
|
return (raw()[target.size()] == '"') && !memcmp(raw(), target.data(), target.size());
|
|
|
|
|