c++: Starting the json codec impl

fb-json
Claudius Holeksa 2023-03-19 00:33:03 +01:00
parent 9704302b19
commit 29a71d1a4b
2 changed files with 42 additions and 0 deletions

View File

@ -0,0 +1,17 @@
#include "json.h"
namespace saw {
class json_codec::impl {
public:
};
json_codec::json_codec():
impl_{heap<json_codec::impl>()}
{}
json_codec::~json_codec(){}
}

View File

@ -0,0 +1,25 @@
#pragma once
#include "common.h"
namespace saw {
class json_codec {
public:
struct limits {
size_t depth = 8;
size_t length = 2048;
};
json_codec();
~json_codec();
template<class Schema, class Container>
error encode(typename message<Schema, Container>::reader reader, buffer& buffer);
template<class Schema, class Container>
error decode(typename message<Schema, Container>::builder builder, buffer& buffer, const limits& lim = limits{});
private:
class impl;
own<impl> impl_;
};
}