xmlgenerator.h
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 #ifndef __XMLGENERATOR_H
00019 #define __XMLGENERATOR_H
00020
00021
00022 #include <iostream>
00023 #include "nedelements.h"
00024
00025 NAMESPACE_BEGIN
00026
00032 NEDXML_API void generateXML(std::ostream& out, NEDElement *tree, bool srcloc, int indentsize = 4);
00033
00039 NEDXML_API std::string generateXML(NEDElement *tree, bool srcloc, int indentsize = 4);
00040
00046 class NEDXML_API NEDXMLGenerator
00047 {
00048 protected:
00049 bool printsrcloc;
00050 int indentsize;
00051 virtual void printAttrValue(std::ostream& out, const char *s);
00052 virtual void doGenerate(std::ostream& out, NEDElement *node, int level);
00053
00054 public:
00058 NEDXMLGenerator();
00059
00063 virtual ~NEDXMLGenerator();
00064
00072 virtual void setSourceLocationAttributes(bool srcloc);
00073
00077 virtual void setIndentSize(int indentsize);
00078
00087 virtual void generate(std::ostream& out, NEDElement *tree);
00088
00092 virtual std::string generate(NEDElement *tree);
00093
00094 };
00095
00096 NAMESPACE_END
00097
00098
00099 #endif