c++: Starting the json codec impl
parent
9704302b19
commit
29a71d1a4b
|
@ -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(){}
|
||||
}
|
|
@ -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_;
|
||||
};
|
||||
}
|
Loading…
Reference in New Issue