mirror of
https://github.com/simdjson/simdjson
synced 2026-06-08 17:27:07 +00:00
Put anonymous namespace in front of everything
This commit is contained in:
@@ -8,6 +8,7 @@
|
||||
|
||||
namespace simdjson {
|
||||
namespace SIMDJSON_IMPLEMENTATION {
|
||||
namespace {
|
||||
|
||||
using namespace simd;
|
||||
|
||||
@@ -64,6 +65,7 @@ really_inline simd8<bool> must_be_2_3_continuation(const simd8<uint8_t> prev2, c
|
||||
return simd8<int8_t>(is_third_byte | is_fourth_byte) > int8_t(0);
|
||||
}
|
||||
|
||||
} // namespace {
|
||||
} // namespace SIMDJSON_IMPLEMENTATION
|
||||
} // namespace simdjson
|
||||
|
||||
@@ -83,7 +85,7 @@ really_inline simd8<bool> must_be_2_3_continuation(const simd8<uint8_t> prev2, c
|
||||
//
|
||||
namespace simdjson {
|
||||
namespace SIMDJSON_IMPLEMENTATION {
|
||||
|
||||
namespace {
|
||||
namespace stage1 {
|
||||
|
||||
really_inline uint64_t json_string_scanner::find_escaped(uint64_t backslash) {
|
||||
@@ -92,6 +94,7 @@ really_inline uint64_t json_string_scanner::find_escaped(uint64_t backslash) {
|
||||
}
|
||||
|
||||
} // namespace stage1
|
||||
} // namespace {
|
||||
|
||||
WARN_UNUSED error_code implementation::minify(const uint8_t *buf, size_t len, uint8_t *dst, size_t &dst_len) const noexcept {
|
||||
return haswell::stage1::json_minifier::minify<128>(buf, len, dst, dst_len);
|
||||
@@ -107,6 +110,23 @@ WARN_UNUSED bool implementation::validate_utf8(const char *buf, size_t len) cons
|
||||
return simdjson::haswell::stage1::generic_validate_utf8(buf,len);
|
||||
}
|
||||
|
||||
WARN_UNUSED error_code dom_parser_implementation::stage2(dom::document &_doc) noexcept {
|
||||
error_code result = stage2::parse_structurals<false>(*this, _doc);
|
||||
if (result) { return result; }
|
||||
|
||||
// If we didn't make it to the end, it's an error
|
||||
if ( next_structural_index != n_structural_indexes ) {
|
||||
logger::log_string("More than one JSON value at the root of the document, or extra characters at the end of the JSON!");
|
||||
return error = TAPE_ERROR;
|
||||
}
|
||||
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
WARN_UNUSED error_code dom_parser_implementation::stage2_next(dom::document &_doc) noexcept {
|
||||
return stage2::parse_structurals<true>(*this, _doc);
|
||||
}
|
||||
|
||||
WARN_UNUSED error_code dom_parser_implementation::parse(const uint8_t *_buf, size_t _len, dom::document &_doc) noexcept {
|
||||
error_code err = stage1(_buf, _len, false);
|
||||
if (err) { return err; }
|
||||
|
||||
Reference in New Issue
Block a user