Skip to content

Commit 9265389

Browse files
authored
Rename BasicDecoder/BasicEncoder to InputStream/OutputStream (#835)
Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
1 parent 6a4c72d commit 9265389

File tree

7 files changed

+22
-20
lines changed

7 files changed

+22
-20
lines changed

src/runtime/CMakeLists.txt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
noa_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

src/runtime/decoder_common.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
namespace sourcemeta::jsonbinpack {
88

9-
Decoder::Decoder(Stream &input) : BasicDecoder{input} {}
9+
Decoder::Decoder(Stream &input) : InputStream{input} {}
1010

1111
auto Decoder::read(const Plan &encoding) -> sourcemeta::jsontoolkit::JSON {
1212
switch (encoding.index()) {

src/runtime/encoder_common.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
namespace sourcemeta::jsonbinpack {
88

9-
Encoder::Encoder(Stream &output) : BasicEncoder{output} {}
9+
Encoder::Encoder(Stream &output) : OutputStream{output} {}
1010

1111
auto Encoder::write(const sourcemeta::jsontoolkit::JSON &document,
1212
const Plan &encoding) -> void {

src/runtime/include/sourcemeta/jsonbinpack/runtime_decoder.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
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>
@@ -13,7 +13,7 @@
1313
namespace sourcemeta::jsonbinpack {
1414

1515
/// @ingroup runtime
16-
class SOURCEMETA_JSONBINPACK_RUNTIME_EXPORT Decoder : private BasicDecoder {
16+
class SOURCEMETA_JSONBINPACK_RUNTIME_EXPORT Decoder : private InputStream {
1717
public:
1818
using Stream = std::basic_istream<sourcemeta::jsontoolkit::JSON::Char,
1919
sourcemeta::jsontoolkit::JSON::CharTraits>;

src/runtime/include/sourcemeta/jsonbinpack/runtime_encoder.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
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>
@@ -13,7 +13,7 @@
1313
namespace sourcemeta::jsonbinpack {
1414

1515
/// @ingroup runtime
16-
class SOURCEMETA_JSONBINPACK_RUNTIME_EXPORT Encoder : private BasicEncoder {
16+
class SOURCEMETA_JSONBINPACK_RUNTIME_EXPORT Encoder : private OutputStream {
1717
public:
1818
using Stream = std::basic_ostream<sourcemeta::jsontoolkit::JSON::Char,
1919
sourcemeta::jsontoolkit::JSON::CharTraits>;

src/runtime/include/sourcemeta/jsonbinpack/runtime_decoder_basic.h renamed to src/runtime/include/sourcemeta/jsonbinpack/runtime_input_stream.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
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"
@@ -18,9 +18,9 @@
1818
namespace sourcemeta::jsonbinpack {
1919

2020
/// @ingroup runtime
21-
class SOURCEMETA_JSONBINPACK_RUNTIME_EXPORT BasicDecoder {
21+
class SOURCEMETA_JSONBINPACK_RUNTIME_EXPORT InputStream {
2222
public:
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());

src/runtime/include/sourcemeta/jsonbinpack/runtime_encoder_basic.h renamed to src/runtime/include/sourcemeta/jsonbinpack/runtime_output_stream.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
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"
@@ -20,9 +20,9 @@
2020
namespace sourcemeta::jsonbinpack {
2121

2222
/// @ingroup runtime
23-
class SOURCEMETA_JSONBINPACK_RUNTIME_EXPORT BasicEncoder {
23+
class SOURCEMETA_JSONBINPACK_RUNTIME_EXPORT OutputStream {
2424
public:
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());

0 commit comments

Comments
 (0)