Ariles
writer.h
Go to the documentation of this file.
1 /**
2  @file
3  @author Jan Michalczyk
4  @author Alexander Sherikov
5 
6  @copyright 2014-2017 INRIA. Licensed under the Apache License, Version 2.0.
7  (see @ref LICENSE or http://www.apache.org/licenses/LICENSE-2.0)
8 
9  @copyright 2017-2020 Alexander Sherikov, Licensed under the Apache License, Version 2.0.
10  (see @ref LICENSE or http://www.apache.org/licenses/LICENSE-2.0)
11 
12  @brief
13 */
14 
15 #pragma once
16 
17 namespace ariles
18 {
19  namespace ns_yaml_cpp03
20  {
21  namespace impl
22  {
24  }
25 
26 
27  /**
28  * @brief Configuration writer class
29  */
30  class ARILES_VISIBILITY_ATTRIBUTE Writer : public ns_yaml_cpp03::Base<ariles::write::Visitor, impl::Writer>
31  {
32  public:
33  explicit Writer(const std::string &file_name);
34  explicit Writer(std::ostream &output_stream);
35 
36 
37 
38  /**
39  * @brief Starts a nested map in the configuration file
40  *
41  * @param[in] map_name name of the map
42  */
43  void descend(const std::string &map_name);
44 
45 
46  void startMap(const std::size_t /*num_entries*/);
47  void endMap();
48 
49 
50  void flush();
51 
52 
53  void startArray(const std::size_t /*size*/, const bool compact = false);
54  void endArray();
55 
56 
57  void startRoot(const std::string &name);
58  void endRoot(const std::string &name);
59 
60 
61 #define ARILES_BASIC_TYPE(type) void writeElement(const type &element);
62 
64 
65 #undef ARILES_BASIC_TYPE
66  };
67  } // namespace ns_yaml_cpp03
68 } // namespace ariles
ARILES_MACRO_SUBSTITUTE(ARILES_BASIC_INTEGER_TYPES_LIST) ARILES_MACRO_SUBSTITUTE(ARILES_BASIC_REAL_TYPES_LIST) void Writer
Definition: writer.cpp:195
#define ARILES_BASIC_TYPES_LIST
Definition: helpers.h:105
Configuration writer class.
Definition: writer.h:30
class ARILES_VISIBILITY_ATTRIBUTE Writer
Definition: writer.h:23
#define ARILES_VISIBILITY_ATTRIBUTE
Definition: helpers.h:69
Definition: basic.h:17