xmlgenerator.h

Go to the documentation of this file.
00001 //==========================================================================
00002 //  XMLGENERATOR.H - part of
00003 //
00004 //                     OMNeT++/OMNEST
00005 //            Discrete System Simulation in C++
00006 //
00007 //==========================================================================
00008 
00009 /*--------------------------------------------------------------*
00010   Copyright (C) 2002-2008 Andras Varga
00011   Copyright (C) 2006-2008 OpenSim Ltd.
00012 
00013   This file is distributed WITHOUT ANY WARRANTY. See the file
00014   `license' for details on this and other legal matters.
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
Generated on Tue Dec 2 11:16:31 2014 for OMNeT++ NEDXML by  doxygen 1.6.3