xmlSink.h

00001 /***************************************************************
00002  *
00003  * Copyright (C) 1990-2007, Condor Team, Computer Sciences Department,
00004  * University of Wisconsin-Madison, WI.
00005  * 
00006  * Licensed under the Apache License, Version 2.0 (the "License"); you
00007  * may not use this file except in compliance with the License.  You may
00008  * obtain a copy of the License at
00009  * 
00010  *    http://www.apache.org/licenses/LICENSE-2.0
00011  * 
00012  * Unless required by applicable law or agreed to in writing, software
00013  * distributed under the License is distributed on an "AS IS" BASIS,
00014  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00015  * See the License for the specific language governing permissions and
00016  * limitations under the License.
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>  // for pair template
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 // classad
00071 
00072 #endif /*__CLASSAD_XMLSINK_H__ */
 All Classes Functions Variables Typedefs Enumerations Enumerator Friends