0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-11-25 16:22:35 +01:00

ircd::json::stack::member: Conversion constructions from other member categories.

This commit is contained in:
Jason Volk 2023-04-22 20:19:33 -07:00
parent 6c3420afbc
commit d80f29b65a
2 changed files with 40 additions and 0 deletions

View file

@ -41,6 +41,10 @@ struct ircd::json::stack::member
member(stack &s, const string_view &name, const json::value &); member(stack &s, const string_view &name, const json::value &);
template<class... T> member(object &po, const string_view &name, const json::tuple<T...> &t); template<class... T> member(object &po, const string_view &name, const json::tuple<T...> &t);
template<class... T> member(stack &s, const string_view &name, const json::tuple<T...> &t); template<class... T> member(stack &s, const string_view &name, const json::tuple<T...> &t);
explicit member(object &, const json::object::member &);
explicit member(stack &, const json::object::member &);
explicit member(object &, const json::member &);
explicit member(stack &, const json::member &);
member() = default; member() = default;
member(const member &) = delete; member(const member &) = delete;
member(member &&) noexcept; member(member &&) noexcept;

View file

@ -1712,6 +1712,42 @@ ircd::json::stack::member::member(object &po,
s->append(string_view{tmp, size_t(data(buf) - tmp)}); s->append(string_view{tmp, size_t(data(buf) - tmp)});
} }
ircd::json::stack::member::member(stack &s,
const json::member &m)
:member
{
stack::top<object>(s), m
}
{
}
ircd::json::stack::member::member(object &po,
const json::member &m)
:member
{
po, string_view{m.first}, m.second
}
{
}
ircd::json::stack::member::member(stack &s,
const json::object::member &om)
:member
{
stack::top<object>(s), om
}
{
}
ircd::json::stack::member::member(object &po,
const json::object::member &om)
:member
{
po, om.first, om.second
}
{
}
ircd::json::stack::member::member(stack &s, ircd::json::stack::member::member(stack &s,
const string_view &name, const string_view &name,
const json::value &value) const json::value &value)