xmlSource.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_XMLSOURCE_H__
00022 #define __CLASSAD_XMLSOURCE_H__
00023 
00024 #include "classad/xmlLexer.h"
00025 
00026 BEGIN_NAMESPACE( classad )
00027 
00028 class ClassAd;
00029 
00030 class ClassAdXMLParser
00031 {
00032     public:
00033         ClassAdXMLParser();
00034         ~ClassAdXMLParser();
00035         ClassAd *ParseClassAd(const std::string &buffer);
00036         ClassAd *ParseClassAd(const std::string &buffer, int &offset);
00037         ClassAd *ParseClassAd(FILE *file);
00038         ClassAd *ParseClassAd(std::istream& stream);
00039         bool ParseClassAd(const std::string &buffer, ClassAd &ad, int &offset);
00040         bool ParseClassAd(const std::string &buffer, ClassAd &ad);
00041         bool ParseClassAd(FILE *file, ClassAd &ad);
00042         bool ParseClassAd(std::istream& stream, ClassAd &ad);
00043     private:
00044         // The copy constructor and assignment operator are defined
00045         // to be private so we don't have to write them, or worry about
00046         // them being inappropriately used. The day we want them, we can 
00047         // write them. 
00048         ClassAdXMLParser(const ClassAdXMLParser &)            { return;       }
00049         ClassAdXMLParser &operator=(const ClassAdXMLParser &) { return *this; }
00050 
00051         ClassAd  *ParseClassAd(void);
00052         ExprTree *ParseAttribute(std::string &attribute_name);
00053         ExprTree *ParseThing(void);
00054         ExprTree *ParseList(void);
00055         ExprTree *ParseNumberOrString(XMLLexer::TagID tag_id);
00056         ExprTree *ParseBool(void);
00057         ExprTree *ParseUndefinedOrError(XMLLexer::TagID tag_id);
00058         ExprTree *ParseAbsTime(void);
00059         ExprTree *ParseRelTime(void);
00060         ExprTree *ParseExpr(void);
00061         void SwallowEndTag(XMLLexer::TagID tag_id);
00062 
00063         XMLLexer lexer;
00064 };
00065 
00066 END_NAMESPACE
00067 
00068 #endif//__CLASSAD_XMLSOURCE_H__
 All Classes Functions Variables Typedefs Enumerations Enumerator Friends