mirror of
https://github.com/simdjson/simdjson
synced 2026-06-08 17:27:07 +00:00
e370a65383
* Improving portability. * Revisiting faulty logic regarding same-page overruns. * Disabling same-page overruns under VS. * Clarifying the documentation * Fix for issue 131 + being more explicit regarding memory realloc. * Fix for issue 137. * removing "using namespace std" throughout. Fix for 50 * Introducing typed malloc/free. * Introducing a custom class (padded_string) that solves several minor usability issues. * Updating amalgamation for testing.
22 lines
520 B
C++
22 lines
520 B
C++
#include <iostream>
|
|
|
|
#include "simdjson/jsonioutil.h"
|
|
#include "simdjson/jsonminifier.h"
|
|
|
|
int main(int argc, char *argv[]) {
|
|
if (argc != 2) {
|
|
std::cerr << "Usage: " << argv[0] << " <jsonfile>\n";
|
|
exit(1);
|
|
}
|
|
padded_string p;
|
|
std::string filename = argv[argc - 1];
|
|
try{
|
|
get_corpus(filename).swap(p);
|
|
} catch (const std::exception& e) {
|
|
std::cout << "Could not load the file " << filename << std::endl;
|
|
return EXIT_FAILURE;
|
|
}
|
|
jsonminify(p, p.data());
|
|
printf("%s",p.data());
|
|
}
|