MCPcopy Create free account
hub / github.com/ElementsProject/elements / ParsePrechecks

Function ParsePrechecks

src/univalue/lib/univalue_get.cpp:20–29  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

18namespace
19{
20static bool ParsePrechecks(const std::string& str)
21{
22 if (str.empty()) // No empty string allowed
23 return false;
24 if (str.size() >= 1 && (json_isspace(str[0]) || json_isspace(str[str.size()-1]))) // No padding allowed
25 return false;
26 if (str.size() != strlen(str.c_str())) // No embedded NUL characters allowed
27 return false;
28 return true;
29}
30
31bool ParseInt32(const std::string& str, int32_t *out)
32{

Callers 3

ParseInt32Function · 0.85
ParseInt64Function · 0.85
ParseDoubleFunction · 0.85

Calls 3

json_isspaceFunction · 0.85
emptyMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected