16 #include <msgpack.hpp>
23 namespace ns_msgpack_compact
32 namespace ns_msgpack_compact
45 template <
class... t_Args>
57 std::stringstream str_stream;
66 catch (
const std::exception &e)
68 CPPUT_THROW(
"Failed to parse the configuration file: ", e.what());
78 const ::msgpack::object &
getRawNode(
const std::size_t depth)
101 namespace ns_msgpack_compact
117 const std::size_t size =
impl_->getRawNode().via.array.size;
119 impl_->emplace(0, size);
124 if (
impl_->back().isArray())
133 if (
impl_->back().isArray())
142 impl_->back().isCompleted(),
"Some entries were not parsed, which is not allowed by this visitor.");
149 const std::size_t size =
impl_->getRawNode().via.array.size;
150 impl_->emplace(0, size);
166 "Internal error: array has more elements than expected.");
176 #define ARILES2_BASIC_TYPE(type) \
177 void Reader::readElement(type &element) \
179 impl_->getRawNode() >> element; \
184 #undef ARILES2_BASIC_TYPE
void endMapEntry()
endMapEntry from the current entry to its parent.
void startMap(const SizeLimitEnforcementType limit_type=SIZE_LIMIT_NONE, const std::size_t min=0, const std::size_t max=0)
bool startMapEntry(const std::string &)
startMapEntry to the entry with the given name
Reader(const std::string &file_name)
Constructor.
const ::msgpack::object & getRawNode()
const ::msgpack::object & getRawNode(const std::size_t depth)
Get current node.
void initialize()
open configuration file
::msgpack::object_handle handle_
std::istream * input_stream_
FileVisitorImplementation()=default
void checkSize(const SizeLimitEnforcementType limit_type, const std::size_t size=0, const std::size_t min=0, const std::size_t max=0) const
std::vector< NodeWrapper > node_stack_
void emplace(t_Args &&...args)
void makeImplPtr(t_Args &&...args)
#define CPPUT_ASSERT(condition,...)
#define ARILES2_BASIC_TYPES_LIST
#define CPPUT_MACRO_SUBSTITUTE(macro)