mirror of
https://github.com/matrix-construct/construct
synced 2025-01-14 00:34:18 +01:00
ircd::json: Hello, goodbye.
This commit is contained in:
parent
fef1c0b1b8
commit
615ccdc426
2 changed files with 1 additions and 27 deletions
|
@ -34,13 +34,9 @@ namespace ircd::json
|
|||
|
||||
using members = std::initializer_list<member>;
|
||||
|
||||
// Validate JSON - checks if canonical value.
|
||||
// Validate JSON - checks if valid JSON (not canonical).
|
||||
bool valid(const string_view &, std::nothrow_t) noexcept;
|
||||
void valid(const string_view &);
|
||||
|
||||
// Convert to canonical JSON
|
||||
string_view canonize(const mutable_buffer &out, const string_view &in);
|
||||
std::string canonize(const string_view &in);
|
||||
}
|
||||
|
||||
inline std::ostream &
|
||||
|
|
22
ircd/json.cc
22
ircd/json.cc
|
@ -2008,28 +2008,6 @@ ircd::json::operator==(const value &a, const value &b)
|
|||
// json.h
|
||||
//
|
||||
|
||||
std::string
|
||||
ircd::json::canonize(const string_view &in)
|
||||
{
|
||||
std::string ret(size(in), char{});
|
||||
ret.resize(size(canonize(mutable_buffer{ret}, in)));
|
||||
return ret;
|
||||
}
|
||||
|
||||
ircd::string_view
|
||||
ircd::json::canonize(const mutable_buffer &out,
|
||||
const string_view &in)
|
||||
try
|
||||
{
|
||||
//TODO: XXX
|
||||
assert(0);
|
||||
return in;
|
||||
}
|
||||
catch(const qi::expectation_failure<const char *> &e)
|
||||
{
|
||||
throw expectation_failure(begin(in), e);
|
||||
}
|
||||
|
||||
bool
|
||||
ircd::json::valid(const string_view &s,
|
||||
std::nothrow_t)
|
||||
|
|
Loading…
Reference in a new issue