MCPcopy Create free account
hub / github.com/PDAL/PDAL / parseJson

Function parseJson

pdal/util/private/JsonSupport.hpp:47–64  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

45{
46
47inline StatusWithReason parseJson(const std::string& s, NL::json& json)
48{
49 try
50 {
51 json = NL::json::parse(s);
52 }
53 catch (NL::json::parse_error& err)
54 {
55 // Look for a right bracket -- this indicates the start of the
56 // actual message from the parse error.
57 std::string s(err.what());
58 auto pos = s.find(']');
59 if (pos != std::string::npos)
60 s = s.substr(pos + 1);
61 return { -1, s };
62 }
63 return true;
64}
65
66inline std::string inferJsonType(const std::string& s)
67{

Callers 3

TESTFunction · 0.85
ingestMethod · 0.85
inferJsonTypeFunction · 0.85

Calls 3

parseFunction · 0.50
whatMethod · 0.45
findMethod · 0.45

Tested by 2

TESTFunction · 0.68
ingestMethod · 0.68