File tree Expand file tree Collapse file tree 7 files changed +22
-20
lines changed
include/sourcemeta/jsonbinpack Expand file tree Collapse file tree 7 files changed +22
-20
lines changed Original file line number Diff line number Diff line change 11noa_library(NAMESPACE sourcemeta PROJECT jsonbinpack NAME runtime
22 FOLDER "JSON BinPack/Runtime"
33 PRIVATE_HEADERS
4- decoder.h decoder_basic.h
5- encoder.h encoder_basic.h encoder_context.h
4+ decoder.h encoder.h
5+ input_stream.h
6+ output_stream.h
7+ encoder_context.h
68 plan.h plan_wrap.h varint.h
79 SOURCES
810 loader.cc loader_v1.h
Original file line number Diff line number Diff line change 66
77namespace sourcemeta ::jsonbinpack {
88
9- Decoder::Decoder (Stream &input) : BasicDecoder {input} {}
9+ Decoder::Decoder (Stream &input) : InputStream {input} {}
1010
1111auto Decoder::read (const Plan &encoding) -> sourcemeta::jsontoolkit::JSON {
1212 switch (encoding.index ()) {
Original file line number Diff line number Diff line change 66
77namespace sourcemeta ::jsonbinpack {
88
9- Encoder::Encoder (Stream &output) : BasicEncoder {output} {}
9+ Encoder::Encoder (Stream &output) : OutputStream {output} {}
1010
1111auto Encoder::write (const sourcemeta::jsontoolkit::JSON &document,
1212 const Plan &encoding) -> void {
Original file line number Diff line number Diff line change 33
44#include " runtime_export.h"
55
6- #include < sourcemeta/jsonbinpack/runtime_decoder_basic .h>
6+ #include < sourcemeta/jsonbinpack/runtime_input_stream .h>
77#include < sourcemeta/jsonbinpack/runtime_plan.h>
88
99#include < sourcemeta/jsontoolkit/json.h>
1313namespace sourcemeta ::jsonbinpack {
1414
1515// / @ingroup runtime
16- class SOURCEMETA_JSONBINPACK_RUNTIME_EXPORT Decoder : private BasicDecoder {
16+ class SOURCEMETA_JSONBINPACK_RUNTIME_EXPORT Decoder : private InputStream {
1717public:
1818 using Stream = std::basic_istream<sourcemeta::jsontoolkit::JSON::Char,
1919 sourcemeta::jsontoolkit::JSON::CharTraits>;
Original file line number Diff line number Diff line change 33
44#include " runtime_export.h"
55
6- #include < sourcemeta/jsonbinpack/runtime_encoder_basic .h>
6+ #include < sourcemeta/jsonbinpack/runtime_output_stream .h>
77#include < sourcemeta/jsonbinpack/runtime_plan.h>
88
99#include < sourcemeta/jsontoolkit/json.h>
1313namespace sourcemeta ::jsonbinpack {
1414
1515// / @ingroup runtime
16- class SOURCEMETA_JSONBINPACK_RUNTIME_EXPORT Encoder : private BasicEncoder {
16+ class SOURCEMETA_JSONBINPACK_RUNTIME_EXPORT Encoder : private OutputStream {
1717public:
1818 using Stream = std::basic_ostream<sourcemeta::jsontoolkit::JSON::Char,
1919 sourcemeta::jsontoolkit::JSON::CharTraits>;
Original file line number Diff line number Diff line change 1- #ifndef SOURCEMETA_JSONBINPACK_RUNTIME_DECODER_BASIC_H_
2- #define SOURCEMETA_JSONBINPACK_RUNTIME_DECODER_BASIC_H_
1+ #ifndef SOURCEMETA_JSONBINPACK_RUNTIME_INPUT_STREAM_H_
2+ #define SOURCEMETA_JSONBINPACK_RUNTIME_INPUT_STREAM_H_
33#ifndef DOXYGEN
44
55#include " runtime_export.h"
1818namespace sourcemeta ::jsonbinpack {
1919
2020// / @ingroup runtime
21- class SOURCEMETA_JSONBINPACK_RUNTIME_EXPORT BasicDecoder {
21+ class SOURCEMETA_JSONBINPACK_RUNTIME_EXPORT InputStream {
2222public:
23- BasicDecoder (
23+ InputStream (
2424 std::basic_istream<sourcemeta::jsontoolkit::JSON::Char,
2525 sourcemeta::jsontoolkit::JSON::CharTraits> &input)
2626 : stream{input} {
@@ -29,8 +29,8 @@ class SOURCEMETA_JSONBINPACK_RUNTIME_EXPORT BasicDecoder {
2929 }
3030
3131 // Prevent copying, as this class is tied to a stream resource
32- BasicDecoder (const BasicDecoder &) = delete ;
33- auto operator =(const BasicDecoder &) -> BasicDecoder & = delete ;
32+ InputStream (const InputStream &) = delete ;
33+ auto operator =(const InputStream &) -> InputStream & = delete ;
3434
3535 inline auto position () const noexcept -> std::uint64_t {
3636 return static_cast <std::uint64_t >(this ->stream .tellg ());
Original file line number Diff line number Diff line change 1- #ifndef SOURCEMETA_JSONBINPACK_RUNTIME_ENCODER_BASIC_H_
2- #define SOURCEMETA_JSONBINPACK_RUNTIME_ENCODER_BASIC_H_
1+ #ifndef SOURCEMETA_JSONBINPACK_RUNTIME_OUTPUT_STREAM_H_
2+ #define SOURCEMETA_JSONBINPACK_RUNTIME_OUTPUT_STREAM_H_
33#ifndef DOXYGEN
44
55#include " runtime_export.h"
2020namespace sourcemeta ::jsonbinpack {
2121
2222// / @ingroup runtime
23- class SOURCEMETA_JSONBINPACK_RUNTIME_EXPORT BasicEncoder {
23+ class SOURCEMETA_JSONBINPACK_RUNTIME_EXPORT OutputStream {
2424public:
25- BasicEncoder (
25+ OutputStream (
2626 std::basic_ostream<sourcemeta::jsontoolkit::JSON::Char,
2727 sourcemeta::jsontoolkit::JSON::CharTraits> &output)
2828 : stream{output} {
@@ -31,8 +31,8 @@ class SOURCEMETA_JSONBINPACK_RUNTIME_EXPORT BasicEncoder {
3131 }
3232
3333 // Prevent copying, as this class is tied to a stream resource
34- BasicEncoder (const BasicEncoder &) = delete ;
35- auto operator =(const BasicEncoder &) -> BasicEncoder & = delete ;
34+ OutputStream (const OutputStream &) = delete ;
35+ auto operator =(const OutputStream &) -> OutputStream & = delete ;
3636
3737 inline auto position () const noexcept -> std::uint64_t {
3838 return static_cast <std::uint64_t >(this ->stream .tellp ());
You can’t perform that action at this time.
0 commit comments