unify json data type

This commit is contained in:
pantor
2021-09-01 16:40:43 +02:00
parent 4505fd0508
commit 12a2c9bbf2
8 changed files with 16 additions and 31 deletions

View File

@@ -7,8 +7,6 @@
#include <sstream>
#include <string>
#include <nlohmann/json.hpp>
#include "config.hpp"
#include "function_storage.hpp"
#include "parser.hpp"
@@ -19,8 +17,6 @@
namespace inja {
using json = nlohmann::json;
/*!
* \brief Class for changing the configuration.
*/

View File

@@ -7,8 +7,6 @@
namespace inja {
using json = nlohmann::json;
using Arguments = std::vector<const json *>;
using CallbackFunction = std::function<json(Arguments &args)>;
using VoidCallbackFunction = std::function<void(Arguments &args)>;

View File

@@ -27,6 +27,10 @@ SOFTWARE.
#include <nlohmann/json.hpp>
namespace inja {
using json = nlohmann::json;
}
#if (defined(__cpp_exceptions) || defined(__EXCEPTIONS) || defined(_CPPUNWIND)) && !defined(INJA_NOEXCEPTION)
#ifndef INJA_THROW
#define INJA_THROW(exception) throw exception

View File

@@ -4,8 +4,6 @@
#include <string>
#include <utility>
#include <nlohmann/json.hpp>
#include "function_storage.hpp"
#include "string_view.hpp"
@@ -100,9 +98,9 @@ public:
class LiteralNode : public ExpressionNode {
public:
const nlohmann::json value;
const json value;
explicit LiteralNode(const nlohmann::json& value, size_t pos) : ExpressionNode(pos), value(value) { }
explicit LiteralNode(const json& value, size_t pos) : ExpressionNode(pos), value(value) { }
void accept(NodeVisitor& v) const {
v.visit(*this);

View File

@@ -17,7 +17,6 @@
#include "token.hpp"
#include "utils.hpp"
#include <nlohmann/json.hpp>
namespace inja {

View File

@@ -7,8 +7,6 @@
#include <utility>
#include <vector>
#include <nlohmann/json.hpp>
#include "config.hpp"
#include "exceptions.hpp"
#include "node.hpp"
@@ -689,7 +687,7 @@ class Renderer : public NodeVisitor {
std::string ptr = node.key;
replace_substring(ptr, ".", "/");
ptr = "/" + ptr;
json_additional_data[nlohmann::json::json_pointer(ptr)] = *eval_expression_list(node.expression);
json_additional_data[json::json_pointer(ptr)] = *eval_expression_list(node.expression);
}
public: