Ariles
writer.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 namespace ariles
14 {
15  namespace ns_pugixml
16  {
17  namespace impl
18  {
20  }
21 
22 
23  /**
24  * @brief Configuration writer class
25  */
26  class ARILES_VISIBILITY_ATTRIBUTE Writer : public ns_pugixml::Base<ariles::write::Visitor, impl::Writer>
27  {
28  public:
29  explicit Writer(const std::string &file_name);
30  explicit Writer(std::ostream &output_stream);
31 
32 
33  void flush();
34 
35 
36  /**
37  * @brief Starts a nested map in the configuration file
38  *
39  * @param[in] map_name name of the map
40  */
41  void descend(const std::string &map_name);
42  void ascend();
43 
44 
45  void startArray(const std::size_t size, const bool /*compact*/ = false);
46  void shiftArray();
47  void endArray();
48 
49 
50  void startRoot(const std::string &name);
51  void endRoot(const std::string &name);
52 
53 
54 #define ARILES_BASIC_TYPE(type) void writeElement(const type &element);
55 
57 
58 #undef ARILES_BASIC_TYPE
59  };
60  } // namespace ns_pugixml
61 } // namespace ariles
#define ARILES_BASIC_TYPES_LIST
Definition: helpers.h:105
class ARILES_VISIBILITY_ATTRIBUTE Writer
Definition: writer.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
Configuration writer class.
Definition: writer.h:26