ircd::json: Split back into tool.h

This commit is contained in:
Jason Volk 2023-04-18 19:35:17 -07:00
parent c77df219b5
commit a10992b813
2 changed files with 30 additions and 14 deletions

View File

@ -39,20 +39,7 @@ namespace ircd::json
#include "strung.h"
#include "tuple/tuple.h"
#include "stack/stack.h"
// Convenience toolset for higher level operations.
namespace ircd::json
{
strung append(const array &, const string_view &val);
strung prepend(const array &, const string_view &val);
void merge(stack::object &out, const vector &);
strung remove(const object &, const string_view &key);
strung remove(const object &, const size_t &index);
strung insert(const object &, const member &);
strung replace(const object &, const member &);
strung replace(const object &, const members &);
}
#include "tool.h"
// Exports to ircd::
namespace ircd

29
include/ircd/json/tool.h Normal file
View File

@ -0,0 +1,29 @@
// Matrix Construct
//
// Copyright (C) Matrix Construct Developers, Authors & Contributors
// Copyright (C) 2016-2023 Jason Volk <jason@zemos.net>
//
// Permission to use, copy, modify, and/or distribute this software for any
// purpose with or without fee is hereby granted, provided that the above
// copyright notice and this permission notice is present in all copies. The
// full license for this software is available in the LICENSE file.
#pragma once
#define HAVE_IRCD_JSON_TOOL_H
// Convenience toolset for higher level operations.
namespace ircd::json
{
strung append(const array &, const string_view &val);
strung prepend(const array &, const string_view &val);
void merge(stack::object &out, const vector &);
strung remove(const object &, const string_view &key);
strung remove(const object &, const size_t &index);
strung insert(const object &, const member &);
strung replace(const object &, const members &);
strung replace(const object &, const member &);
}