Ariles
Loading...
Searching...
No Matches
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
13namespace ariles2
14{
15 namespace ns_yaml_cpp
16 {
17 namespace impl
18 {
19 class Writer;
20 }
21
22
23 /**
24 * @brief Configuration reader class
25 */
26 class Writer : public serialization::PIMPLVisitor<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 startMap(const Parameters &, const std::size_t /*num_entries*/);
34 void startMapEntry(const std::string &map_name);
35 void endMap();
36
37
38 void flush();
39
40
41 void startArray(const std::size_t /*size*/, const bool compact = false);
42 void endArray();
43
44 void startRoot(const std::string &name, const Parameters &);
45 void endRoot(const std::string &name);
46
47
48#define ARILES2_BASIC_TYPE(type) void writeElement(const type &element, const Parameters &param);
49
51
52#undef ARILES2_BASIC_TYPE
53 };
54 } // namespace ns_yaml_cpp
55} // namespace ariles2
Configuration reader class.
Definition writer.h:27
void flush()
Flush the configuration to the output.
Definition writer.cpp:128
void endRoot(const std::string &name)
Definition writer.cpp:167
void startMap(const Parameters &, const std::size_t)
Starts a nested map in the configuration file.
Definition writer.cpp:98
void startRoot(const std::string &name, const Parameters &)
Definition writer.cpp:153
void startMapEntry(const std::string &map_name)
Starts a nested map in the configuration file.
Definition writer.cpp:108
void startArray(const std::size_t, const bool compact=false)
Definition writer.cpp:135
void endMap()
Ends a nested map in the configuration file.
Definition writer.cpp:116
#define ARILES2_BASIC_TYPES_LIST
Definition helpers.h:72
#define CPPUT_MACRO_SUBSTITUTE(macro)
Definition misc.h:21
GenericWriter< NameValuePair > Writer
Definition writer.h:252