Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef SERIALIZATION_BINARY_OR_TEXT_HPP_INCLUDED
00020 #define SERIALIZATION_BINARY_OR_TEXT_HPP_INCLUDED
00021
00022 #include "preprocessor.hpp"
00023
00024 #include <boost/iostreams/filtering_stream.hpp>
00025
00026 class config;
00027
00028
00029 class config_writer
00030 {
00031 public:
00032 config_writer(std::ostream &out, bool compress, int level = -1);
00033
00034 ~config_writer();
00035
00036 void write(const config &cfg);
00037
00038 void write_child(const std::string &key, const config &cfg);
00039 void write_key_val(const std::string &key, const std::string &value);
00040 void open_child(const std::string &key);
00041 void close_child(const std::string &key);
00042 bool good() const;
00043
00044 private:
00045 boost::iostreams::filtering_stream<boost::iostreams::output> filter_;
00046 std::ostream *out_ptr_;
00047 std::ostream &out_;
00048 bool compress_;
00049 unsigned int level_;
00050 std::string textdomain_;
00051 };
00052
00053 #endif