Main Page | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

XMLWriter.hpp

Go to the documentation of this file.
00001 /*==========================================================================
00002  * Copyright (c) 2004 University of Massachusetts.  All Rights Reserved.
00003  *
00004  * Use of the Lemur Toolkit for Language Modeling and Information Retrieval
00005  * is subject to the terms of the software license set forth in the LICENSE
00006  * file included with this software, and also available at
00007  * http://www.lemurproject.org/license.html
00008  *
00009  *==========================================================================
00010  */
00011 
00012 
00013 //
00014 // XMLWriter.h
00015 //
00016 // 8 October 2003 - tds
00017 //
00018 
00019 #ifndef MONITOR_XMLWRITER_H
00020 #define MONITOR_XMLWRITER_H
00021 
00022 #include "indri/XMLNode.hpp"
00023 #include <string>
00024 #include <map>
00025 namespace indri
00026 {
00027   namespace xml
00028   {
00029     
00030     class XMLWriter {
00031     private:
00032       XMLNode* _node;
00033 
00034       void _writeChar( char ch, std::string& output ) const;
00035       void _writeTabs( int tabs, std::string& output ) const;
00036       void _writeTag( const std::string& tag,
00037                       const std::map<std::string,std::string>& attributes,
00038                       std::string& output,
00039                       bool opening ) const;
00040       void _writeEndOfLine( std::string& output ) const;
00041       void _writeXML( int tabs, const XMLNode* node, std::string& output ) const;
00042 
00043     public:
00044       XMLWriter( XMLNode* node ); 
00045       void write( std::string& output );
00046     };
00047   }
00048 }
00049 
00050 #endif // MONITOR_XMLWRITER_H
00051 

Generated on Tue Jun 15 11:02:56 2010 for Lemur by doxygen 1.3.4