00001
00002
00003
00004
00005
00006
00007
00008 #ifndef incPERSIST_DUMP_OBJECT
00009 #define incPERSIST_DUMP_OBJECT
00010
00011
00012 #include <iostream>
00013 #include <string>
00014 #include <map>
00015 #include "../common/persistable_object.hpp"
00016 #include "config.hpp"
00017
00018 namespace ph {
00019 namespace persist {
00020
00021 class PERSIST_DECL dumpobj : public ph::common::object_writer
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072 {
00073 public:
00074 dumpobj(std::ostream *stream, std::ostream *console) :
00075 _stream(stream), _console(console),
00076 _tabs(0), _tagname(""), _data("")
00077 {};
00078
00079
00080 virtual bool start(const std::string &tagname);
00081 virtual bool attr(const std::string &name, const std::string &value);
00082 virtual bool data(const std::string &d);
00083 virtual bool end(const std::string &tagname);
00084
00085 private:
00086 std::ostream *_stream;
00087 std::ostream *_console;
00088 int _tabs;
00089 std::string _tagname;
00090 std::map<std::string, std::string> _attrs;
00091 std::string _data;
00092
00093 void object_start();
00094 void object_end();
00095 void data_object();
00096 void tabs();
00097 void cr();
00098 };
00099
00100 };
00101 };
00102
00103 #endif // incPERSIST_DUMP_OBJECT