MCPcopy Create free account
hub / github.com/boostorg/json / validate

Function validate

example/validate.cpp:84–96  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

82};
83
84bool
85validate( string_view s )
86{
87 // Parse with the null parser and return false on error
88 null_parser p;
89 boost::system::error_code ec;
90 p.write( s.data(), s.size(), ec );
91 if( ec )
92 return false;
93
94 // The string is valid JSON.
95 return true;
96}
97
98int
99main(int argc, char** argv)

Callers 1

mainFunction · 0.70

Calls 3

writeMethod · 0.45
dataMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected