Ariles
writer.h
Go to the documentation of this file.
1 /**
2  @file
3  @author Alexander Sherikov
4 
5  @copyright 2018-2020 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_rapidjson
16  {
17  namespace impl
18  {
20  }
21 
22 
23  /**
24  * @brief Configuration writer class
25  */
26  class ARILES_VISIBILITY_ATTRIBUTE Writer : public ns_rapidjson::Base<ariles::write::Visitor, impl::Writer>
27  {
28  public:
29  explicit Writer(const std::string &file_name, const Flags &flags = Flags::DEFAULT);
30  explicit Writer(std::ostream &output_stream, const Flags &flags = Flags::DEFAULT);
31 
32  void flush();
33 
34 
35  void descend(const std::string &map_name);
36  void ascend();
37 
38  void startMap(const std::size_t /*num_entries*/);
39  void startArray(const std::size_t size, const bool /*compact*/ = false);
40 
41  void shiftArray();
42  void endArray();
43 
44 
45 
46 #define ARILES_BASIC_TYPE(type) void writeElement(const type &element);
47 
49 
50 #undef ARILES_BASIC_TYPE
51  };
52  } // namespace ns_rapidjson
53 } // namespace ariles
Configuration writer class.
Definition: writer.h:26
#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