Ariles
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 
13 
14 namespace ariles
15 {
16  namespace ns_pugixml
17  {
18  namespace impl
19  {
21  }
22 
23 
24  /**
25  * @brief Configuration reader class
26  */
27  class ARILES_VISIBILITY_ATTRIBUTE Reader : public ns_pugixml::Base<ariles::read::Visitor, impl::Reader>
28  {
29  protected:
30  std::size_t getMapSize(const bool /*expect_empty*/);
31 
32 
33  public:
34  /**
35  * @brief Constructor
36  *
37  * @param[in] file_name
38  */
39  explicit Reader(const std::string &file_name);
40 
41 
42  /**
43  * @brief Constructor
44  *
45  * @param[in] input_stream
46  */
47  explicit Reader(std::istream &input_stream);
48 
49 
50  bool descend(const std::string &child_name);
51  void ascend();
52 
53 
54  bool getMapEntryNames(std::vector<std::string> &child_names);
55 
56 
57  std::size_t startArray();
58  void shiftArray();
59  void endArray();
60 
61  bool startRoot(const std::string &name);
62  void endRoot(const std::string &name);
63 
64 
65 #define ARILES_BASIC_TYPE(type) void readElement(type &element);
66 
68 
69 #undef ARILES_BASIC_TYPE
70  };
71  } // namespace ns_pugixml
72 } // namespace ariles
#define ARILES_BASIC_TYPES_LIST
Definition: helpers.h:105
Configuration reader class.
Definition: reader.h:27
class ARILES_VISIBILITY_ATTRIBUTE Reader
Definition: reader.h:23
ARILES_MACRO_SUBSTITUTE(ARILES_BASIC_NUMERIC_TYPES_LIST) void Writer
Definition: writer.cpp:224
#define ARILES_VISIBILITY_ATTRIBUTE
Definition: helpers.h:69
Definition: basic.h:17