Put anonymous namespace in front of everything

This commit is contained in:
John Keiser
2020-07-24 07:32:12 -07:00
parent 2f92a34bb7
commit 65148b123b
55 changed files with 188 additions and 41 deletions
@@ -9,6 +9,7 @@
namespace simdjson {
namespace SIMDJSON_IMPLEMENTATION {
namespace {
namespace stage1 {
class structural_scanner {
@@ -307,6 +308,7 @@ WARN_UNUSED bool implementation::validate_utf8(const char *buf, size_t len) cons
return true;
}
} // namespace {
} // namespace SIMDJSON_IMPLEMENTATION
} // namespace simdjson
@@ -320,6 +322,23 @@ WARN_UNUSED bool implementation::validate_utf8(const char *buf, size_t len) cons
namespace simdjson {
namespace SIMDJSON_IMPLEMENTATION {
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; }