1
0
mirror of https://github.com/falk-werner/webfuse-provider synced 2026-03-02 04:09:18 +00:00

refactor: renamed json_parse to json_doc

This commit is contained in:
Falk Werner
2020-07-12 15:26:30 +02:00
parent 2979904514
commit bf8ba05863
9 changed files with 42 additions and 53 deletions

View File

@@ -6,17 +6,17 @@ namespace webfuse_test
JsonDoc::JsonDoc(std::string const & json)
: contents(json)
{
doc = wfp_impl_json_parse(const_cast<char*>(contents.data()));
doc = wfp_impl_json_doc_loadb(const_cast<char*>(contents.data()), json.size());
}
JsonDoc::~JsonDoc()
{
wfp_impl_json_dispose(doc);
wfp_impl_json_doc_dispose(doc);
}
wfp_json const * JsonDoc::root()
{
return wfp_impl_json_root(doc);
return wfp_impl_json_doc_root(doc);
}
}

View File

@@ -1,7 +1,7 @@
#ifndef WFP_TEST_UTIL_JSON_DOC_HPP
#define WFP_TEST_UTIL_JSON_DOC_HPP
#include "webfuse_provider/impl/json/parser.h"
#include "webfuse_provider/impl/json/doc.h"
#include "webfuse_provider/impl/json/node.h"
#include <string>

View File

@@ -1,7 +1,7 @@
#include "webfuse_provider/test_util/webfuse_server.hpp"
#include "webfuse_provider/impl/util/lws_log.h"
#include "webfuse_provider/protocol_names.h"
#include "webfuse_provider/impl/json/parser.h"
#include "webfuse_provider/impl/json/doc.h"
#include "webfuse_provider/impl/json/node.h"
#include <libwebsockets.h>
@@ -198,10 +198,10 @@ public:
}
}
wfp_json_doc * doc = wfp_impl_json_parse_buffer(data, length);
wfp_json_doc * doc = wfp_impl_json_doc_loadb(data, length);
if (doc)
{
wfp_json const * message = wfp_impl_json_root(doc);
wfp_json const * message = wfp_impl_json_doc_root(doc);
wfp_json const * method = wfp_impl_json_object_get(message, "method");
if (wfp_impl_json_is_string(method))
{
@@ -221,7 +221,7 @@ public:
}
}
wfp_impl_json_dispose(doc);
wfp_impl_json_doc_dispose(doc);
}
}