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

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