mirror of
https://github.com/simdjson/simdjson
synced 2026-06-08 17:27:07 +00:00
bdc2b07339
* rough prototype working. Needs more test and fine tuning. * prototype working on large files. * prototype working on large files. * Adding benchmarks * jsonstream API adjustment * type * minor fixes and cleaning. * minor fixes and cleaning. * removing warnings * removing some copies * runtime dispatch error fix * makefile linking src/jsonstream.cpp * fixing arm stage 1 headers * fixing stage 2 headers * fixing stage 1 arm header * making jsonstream portable * cleaning imports * including <algorithms> for windows compiler * cleaning benchmark imports * adding jsonstream to amalgamation * merged main into branch * bug fix where JsonStream would bug on rare cases. * Addind a JsonStream Demo to Amalgamation * Fix for https://github.com/lemire/simdjson/issues/345 * Follow up test and fix for https://github.com/lemire/simdjson/issues/345 (#347) * Final (?) fix for https://github.com/lemire/simdjson/issues/345 * Verbose basictest * Being more forgiving of powers of ten. * Let us zero the tail end. * add basic fuzzers (#348) * add basic fuzzing using libFuzzer * let cmake respect cflags, otherwise the fuzzer flags go unnoticed also, integrates badly with oss-fuzz * add new fuzzer for minification, simplify the old one * add fuzzer for the dump example * clang format * adding Paul Dreik * rough prototype working. Needs more test and fine tuning. * prototype working on large files. * prototype working on large files. * Adding benchmarks * jsonstream API adjustment * type * minor fixes and cleaning. * Fixing issue 351 (#352) * Fixing issues 351 and 353 * minor fixes and cleaning. * removing warnings * removing some copies * Fix ARM compile errors on g++ 7.4 (#354) * Fix ARM compilation errors * Update singleheader * runtime dispatch error fix * makefile linking src/jsonstream.cpp * fixing arm stage 1 headers * fixing stage 2 headers * fixing stage 1 arm header * fix integer overflow in subnormal_power10 (#355) detected by oss-fuzz https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=18714 * Adding new test file, following https://github.com/lemire/simdjson/pull/355 * making jsonstream portable * cleaning imports * including <algorithms> for windows compiler * cleaning benchmark imports * adding jsonstream to amalgamation * merged main into branch * bug fix where JsonStream would bug on rare cases. * Addind a JsonStream Demo to Amalgamation * merging main * rough prototype working. Needs more test and fine tuning. * prototype working on large files. * prototype working on large files. * Adding benchmarks * jsonstream API adjustment * minor fixes and cleaning. * minor fixes and cleaning. * removing warnings * removing some copies * runtime dispatch error fix * makefile linking src/jsonstream.cpp * fixing arm stage 1 headers * fixing stage 2 headers * fixing stage 1 arm header * making jsonstream portable * cleaning imports * including <algorithms> for windows compiler * cleaning benchmark imports * adding jsonstream to amalgamation * bug fix where JsonStream would bug on rare cases. * Addind a JsonStream Demo to Amalgamation * rough prototype working. Needs more test and fine tuning. * minor fixes and cleaning. * adding jsonstream to amalgamation * merged main into branch * Addind a JsonStream Demo to Amalgamation * merging main * merging main * make file fix
46 lines
1.6 KiB
C++
46 lines
1.6 KiB
C++
#ifndef SIMDJSON_SIMDJSON_H
|
|
#define SIMDJSON_SIMDJSON_H
|
|
|
|
#include <string>
|
|
|
|
namespace simdjson {
|
|
// Represents the minimal architecture that would support an implementation
|
|
enum class Architecture {
|
|
WESTMERE,
|
|
HASWELL,
|
|
ARM64,
|
|
NONE,
|
|
// TODO remove 'native' in favor of runtime dispatch?
|
|
// the 'native' enum class value should point at a good default on the current
|
|
// machine
|
|
#ifdef IS_X86_64
|
|
NATIVE = WESTMERE
|
|
#elif defined(IS_ARM64)
|
|
NATIVE = ARM64
|
|
#endif
|
|
};
|
|
|
|
enum ErrorValues {
|
|
SUCCESS = 0,
|
|
SUCCESS_AND_HAS_MORE, //No errors and buffer still has more data
|
|
CAPACITY, // This ParsedJson can't support a document that big
|
|
MEMALLOC, // Error allocating memory, most likely out of memory
|
|
TAPE_ERROR, // Something went wrong while writing to the tape (stage 2), this
|
|
// is a generic error
|
|
DEPTH_ERROR, // Your document exceeds the user-specified depth limitation
|
|
STRING_ERROR, // Problem while parsing a string
|
|
T_ATOM_ERROR, // Problem while parsing an atom starting with the letter 't'
|
|
F_ATOM_ERROR, // Problem while parsing an atom starting with the letter 'f'
|
|
N_ATOM_ERROR, // Problem while parsing an atom starting with the letter 'n'
|
|
NUMBER_ERROR, // Problem while parsing a number
|
|
UTF8_ERROR, // the input is not valid UTF-8
|
|
UNITIALIZED, // unknown error, or uninitialized document
|
|
EMPTY, // no structural document found
|
|
UNESCAPED_CHARS, // found unescaped characters in a string.
|
|
UNCLOSED_STRING, // missing quote at the end
|
|
UNEXPECTED_ERROR // indicative of a bug in simdjson
|
|
};
|
|
const std::string &error_message(const int);
|
|
} // namespace simdjson
|
|
#endif // SIMDJSON_SIMDJSON_H
|