Ariles
Loading...
Searching...
No Matches
reader.h
Go to the documentation of this file.
1/**
2 @file
3 @author Alexander Sherikov
4
5 @copyright 2018 Alexander Sherikov, Licensed under the Apache License, Version 2.0.
6 (see @ref LICENSE or http://www.apache.org/licenses/LICENSE-2.0)
7
8 @brief
9*/
10
11#pragma once
12
13namespace ariles2
14{
15 namespace ns_yaml_cpp
16 {
17 namespace impl
18 {
19 class Reader;
20 }
21
22
23 /**
24 * @brief Configuration reader class
25 */
26 class Reader : public serialization::PIMPLVisitor<read::Visitor, impl::Reader>
27 {
28 public:
29 /**
30 * @brief Constructor
31 *
32 * @param[in] file_name
33 */
34 explicit Reader(const std::string &file_name);
35
36
37 /**
38 * @brief Constructor
39 *
40 * @param[in] input_stream
41 */
42 explicit Reader(std::istream &input_stream);
43
44
45
46 void startMap(
48 const std::size_t min = 0,
49 const std::size_t max = 0);
50 bool startMapEntry(const std::string &child_name);
51 void endMapEntry();
52
53
55 const SizeLimitEnforcementType /*limit_type*/ = SIZE_LIMIT_NONE,
56 const std::size_t /*min*/ = 0,
57 const std::size_t /*max*/ = 0);
58 bool startIteratedMapElement(std::string &entry_name);
60 void endIteratedMap();
61
62
63 std::size_t startArray();
64 void startArrayElement();
65 void endArrayElement();
66 void endArray();
67
68
69#define ARILES2_BASIC_TYPE(type) void readElement(type &element);
70
72
73#undef ARILES2_BASIC_TYPE
74 };
75 } // namespace ns_yaml_cpp
76} // namespace ariles2
Configuration reader class.
Definition reader.h:27
bool startIteratedMapElement(std::string &entry_name)
Definition reader.cpp:123
bool startIteratedMap(const SizeLimitEnforcementType=SIZE_LIMIT_NONE, const std::size_t=0, const std::size_t=0)
Definition reader.cpp:105
void startMap(const SizeLimitEnforcementType limit_type=SIZE_LIMIT_NONE, const std::size_t min=0, const std::size_t max=0)
Definition reader.cpp:78
void endMapEntry()
endMapEntry from the current entry to its parent.
Definition reader.cpp:97
bool startMapEntry(const std::string &child_name)
startMapEntry to the entry with the given name
Definition reader.cpp:84
#define ARILES2_BASIC_TYPES_LIST
Definition helpers.h:72
#define CPPUT_MACRO_SUBSTITUTE(macro)
Definition misc.h:21