Skip to content

Commit

Permalink
Move reader in Readers/
Browse files Browse the repository at this point in the history
  • Loading branch information
bblanchon committed Oct 24, 2019
1 parent 47dbfbd commit 3831b76
Show file tree
Hide file tree
Showing 9 changed files with 24 additions and 38 deletions.
2 changes: 1 addition & 1 deletion extras/tests/Misc/Readers.cpp
Expand Up @@ -2,7 +2,7 @@
// Copyright Benoit Blanchon 2014-2019
// MIT License

#include <ArduinoJson.h>
#include <ArduinoJson/Deserialization/Reader.hpp>
#include <catch.hpp>

using namespace ARDUINOJSON_NAMESPACE;
Expand Down
Expand Up @@ -6,6 +6,8 @@

#include <ArduinoJson/Namespace.hpp>

#include <stdlib.h> // for size_t

namespace ARDUINOJSON_NAMESPACE {

// The default reader is a simple wrapper for Readers that are not copiable
Expand All @@ -31,5 +33,23 @@ struct BoundedReader {
// no default implementation because we need to pass the size to the
// constructor
};

} // namespace ARDUINOJSON_NAMESPACE

#include <ArduinoJson/Deserialization/Readers/IteratorReader.hpp>
#include <ArduinoJson/Deserialization/Readers/RamReader.hpp>

#if ARDUINOJSON_ENABLE_ARDUINO_STREAM
#include <ArduinoJson/Deserialization/Readers/ArduinoStreamReader.hpp>
#endif

#if ARDUINOJSON_ENABLE_ARDUINO_STRING
#include <ArduinoJson/Deserialization/Readers/ArduinoStringReader.hpp>
#endif

#if ARDUINOJSON_ENABLE_PROGMEM
#include <ArduinoJson/Deserialization/Readers/FlashReader.hpp>
#endif

#if ARDUINOJSON_ENABLE_STD_STREAM
#include <ArduinoJson/Deserialization/Readers/StdStreamReader.hpp>
#endif
Expand Up @@ -4,11 +4,6 @@

#pragma once

#include <ArduinoJson/Configuration.hpp>
#include <ArduinoJson/Deserialization/ReaderSelector.hpp>

#if ARDUINOJSON_ENABLE_ARDUINO_STREAM

#include <Stream.h>

namespace ARDUINOJSON_NAMESPACE {
Expand All @@ -33,5 +28,3 @@ struct Reader<TSource,
};

} // namespace ARDUINOJSON_NAMESPACE

#endif
Expand Up @@ -4,12 +4,8 @@

#pragma once

#include <ArduinoJson/Deserialization/RamReader.hpp>

namespace ARDUINOJSON_NAMESPACE {

#if ARDUINOJSON_ENABLE_ARDUINO_STRING

template <typename TSource>
struct Reader<TSource,
typename enable_if<is_base_of< ::String, TSource>::value>::type>
Expand All @@ -18,6 +14,4 @@ struct Reader<TSource,
: BoundedReader<const char*>(s.c_str(), s.length()) {}
};

#endif

} // namespace ARDUINOJSON_NAMESPACE
Expand Up @@ -4,11 +4,6 @@

#pragma once

#include <ArduinoJson/Configuration.hpp>
#include <ArduinoJson/Deserialization/ReaderSelector.hpp>

#if ARDUINOJSON_ENABLE_PROGMEM

namespace ARDUINOJSON_NAMESPACE {

template <>
Expand Down Expand Up @@ -55,5 +50,3 @@ struct BoundedReader<const __FlashStringHelper*, void> {
}
};
} // namespace ARDUINOJSON_NAMESPACE

#endif
Expand Up @@ -4,8 +4,6 @@

#pragma once

#include <ArduinoJson/Deserialization/ReaderSelector.hpp>

namespace ARDUINOJSON_NAMESPACE {

template <typename TIterator>
Expand Down
Expand Up @@ -4,7 +4,7 @@

#pragma once

#include <ArduinoJson/Deserialization/IteratorReader.hpp>
#include <ArduinoJson/Polyfills/type_traits.hpp>

namespace ARDUINOJSON_NAMESPACE {

Expand Down
Expand Up @@ -4,11 +4,6 @@

#pragma once

#include <ArduinoJson/Configuration.hpp>
#include <ArduinoJson/Deserialization/ReaderSelector.hpp>

#if ARDUINOJSON_ENABLE_STD_STREAM

#include <istream>

namespace ARDUINOJSON_NAMESPACE {
Expand All @@ -32,5 +27,3 @@ struct Reader<TSource, typename enable_if<
std::istream* _stream;
};
} // namespace ARDUINOJSON_NAMESPACE

#endif
7 changes: 1 addition & 6 deletions src/ArduinoJson/Deserialization/deserialize.hpp
Expand Up @@ -4,14 +4,9 @@

#pragma once

#include <ArduinoJson/Deserialization/ArduinoStreamReader.hpp>
#include <ArduinoJson/Deserialization/ArduinoStringReader.hpp>
#include <ArduinoJson/Deserialization/DeserializationError.hpp>
#include <ArduinoJson/Deserialization/FlashReader.hpp>
#include <ArduinoJson/Deserialization/IteratorReader.hpp>
#include <ArduinoJson/Deserialization/NestingLimit.hpp>
#include <ArduinoJson/Deserialization/RamReader.hpp>
#include <ArduinoJson/Deserialization/StdStreamReader.hpp>
#include <ArduinoJson/Deserialization/Reader.hpp>
#include <ArduinoJson/StringStorage/StringStorage.hpp>

namespace ARDUINOJSON_NAMESPACE {
Expand Down

0 comments on commit 3831b76

Please sign in to comment.