mirror of
https://github.com/simdjson/simdjson
synced 2026-06-08 17:27:07 +00:00
c1dffac28c
* This moves all DOM (benchmark + test) files to a subdir * Missing file. * CMake + DLL is not pretty. * Capitalizing AND * Fixing mismatch endif * Flipping the order. * onedemand => ondemand
13 lines
472 B
C++
13 lines
472 B
C++
#include <iostream>
|
|
#include "simdjson.h"
|
|
|
|
int main() {
|
|
simdjson::error_code error;
|
|
simdjson::padded_string numberstring = "1.2"_padded; // our JSON input ("1.2")
|
|
simdjson::dom::parser parser;
|
|
double value; // variable where we store the value to be parsed
|
|
error = parser.parse(numberstring).get(value);
|
|
if (error) { std::cerr << error << std::endl; return EXIT_FAILURE; }
|
|
std::cout << "I parsed " << value << " from " << numberstring.data() << std::endl;
|
|
}
|