00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 
00009 
00010 
00011 
00012 
00013 
00014 
00015 
00016 
00017 
00018 
00019 
00020 
00021 #ifndef __CLASSAD_XMLSINK_H__
00022 #define __CLASSAD_XMLSINK_H__
00023 
00024 #include "classad/common.h"
00025 #include "classad/exprTree.h"
00026 #include <vector>
00027 #include <utility>  
00028 #include <string>
00029 
00030 BEGIN_NAMESPACE( classad )
00031 
00032 
00033 class ClassAdXMLUnParser
00034 {
00035  public:
00037     ClassAdXMLUnParser( );
00038 
00040     virtual ~ClassAdXMLUnParser( );
00041 
00043     void SetCompactSpacing(bool use_compact_spacing);
00044 
00049     void Unparse(std::string &buffer, ExprTree *expr);
00050 
00051  private:
00056     void Unparse(std::string &buffer, ExprTree *expr, int indent);
00057 
00058     void Unparse(std::string &buffer, Value &val, int indent);
00059     virtual void UnparseAux(std::string &buffer, 
00060                             std::vector< std::pair< std::string, ExprTree*> >& attrlist,
00061                             int indent);
00062     virtual void UnparseAux(std::string &buffer, std::vector<ExprTree*>&, 
00063                             int indent);
00064 
00065     bool compact_spacing;
00066 
00067 };
00068 
00069 
00070 END_NAMESPACE 
00071 
00072 #endif