Main Page | Class Hierarchy | Class List | File List | Class Members

xmlSink.h

00001 /*********************************************************************
00002  *
00003  * Condor ClassAd library
00004  * Copyright (C) 1990-2003, Condor Team, Computer Sciences Department,
00005  * University of Wisconsin-Madison, WI and Rajesh Raman.
00006  *
00007  * This source code is covered by the Condor Public License, which can
00008  * be found in the accompanying LICENSE file, or online at
00009  * www.condorproject.org.
00010  *
00011  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
00012  * AND THE UNIVERSITY OF WISCONSIN-MADISON "AS IS" AND ANY EXPRESS OR
00013  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
00014  * WARRANTIES OF MERCHANTABILITY, OF SATISFACTORY QUALITY, AND FITNESS
00015  * FOR A PARTICULAR PURPOSE OR USE ARE DISCLAIMED. THE COPYRIGHT
00016  * HOLDERS AND CONTRIBUTORS AND THE UNIVERSITY OF WISCONSIN-MADISON
00017  * MAKE NO MAKE NO REPRESENTATION THAT THE SOFTWARE, MODIFICATIONS,
00018  * ENHANCEMENTS OR DERIVATIVE WORKS THEREOF, WILL NOT INFRINGE ANY
00019  * PATENT, COPYRIGHT, TRADEMARK, TRADE SECRET OR OTHER PROPRIETARY
00020  * RIGHT.
00021  *
00022  *********************************************************************/
00023 
00024 #ifndef __XMLSINK_H__
00025 #define __XMLSINK_H__
00026 
00027 #include "common.h"
00028 #include "exprTree.h"
00029 #include <vector>
00030 #include <utility>      // for pair template
00031 #include <string>
00032 
00033 BEGIN_NAMESPACE( classad )
00034 
00035 
00036 class ClassAdXMLUnParser
00037 {
00038  public:
00040         ClassAdXMLUnParser( );
00041 
00043         virtual ~ClassAdXMLUnParser( );
00044 
00046         void SetCompactSpacing(bool use_compact_spacing);
00047 
00052         void Unparse(std::string &buffer, ExprTree *expr);
00053 
00054  private:
00059         void Unparse(std::string &buffer, ExprTree *expr, int indent);
00060 
00061         void Unparse(std::string &buffer, Value &val, int indent);
00062         virtual void UnparseAux(std::string &buffer, 
00063                                                         std::vector< std::pair< std::string, ExprTree*> >& attrlist,
00064                                                         int indent);
00065         virtual void UnparseAux(std::string &buffer, std::vector<ExprTree*>&, 
00066                                                         int indent);
00067 
00068         bool compact_spacing;
00069 
00070 };
00071 
00072 
00073 END_NAMESPACE // classad
00074 
00075 #endif /*__XMLSINK_H__ */