![]() |
The Simons
|
00001 00002 // 00003 // SCL : Simons Component Library 00004 // 00006 // 00007 // Filename: XMLReader.h 00008 // Contents: XMLReader class 00009 // Author: Anthony J H Simons 00010 // Revised: 11 November 2005 00011 00012 // This software is distributed free in the hope that others will 00013 // find it useful. However, it comes WITHOUT ANY WARRANTY. No 00014 // liability can be accepted for software failure, merchantability 00015 // or fitness for a particular purpose. You can redistribute this 00016 // software in its original form, or in a modified form, provided 00017 // that this disclaimer is retained in the file banner. 00018 00019 #ifndef SCL_XML_READER 00020 #define SCL_XML_READER 00021 00022 #include "Reader.h" // Include my superclass type 00023 #include "XMLReaderID.h" // Include my pointer type 00024 00025 #include "StringID.h" // Depends on these pointer types 00026 #include "MapID.h" 00027 00037 00038 class XMLReader : public Reader { 00039 private: 00040 MapID idMap; 00041 Natural count; 00042 StringID getTag(); 00043 StringID getAt(StringID, StringID) const; 00044 Boolean isShort(StringID) const; 00045 00046 XMLReader(const XMLReader&); 00047 public: 00048 XMLReader(); 00049 virtual ~XMLReader(); 00050 virtual ObjectID clone() const; 00051 XMLReader(StringID); 00052 00053 virtual ReaderID get(ObjectID&); 00054 virtual ReaderID getField(StringID, ObjectID&); 00055 virtual Natural multiple() const; 00056 }; 00057 00059 00065 inline Natural XMLReader::multiple() const { 00066 return count; 00067 } 00068 00070 00073 inline XMLReaderID::XMLReaderID() {} 00074 00076 inline XMLReaderID::~XMLReaderID() {} 00077 00081 inline XMLReaderID::XMLReaderID(const Null* null) : 00082 ReaderID(null) {} 00083 00087 inline XMLReaderID::XMLReaderID(const XMLReader* stream) : 00088 ReaderID(stream) {} 00089 00093 inline XMLReaderID::XMLReaderID(const XMLReaderID& pointer) : 00094 ReaderID(pointer) {} 00095 00099 inline XMLReaderID& XMLReaderID::operator=(const XMLReader* stream) { 00100 assign(stream); 00101 return *this; 00102 } 00103 00108 inline XMLReaderID& XMLReaderID::operator=(const XMLReaderID& pointer) { 00109 assign(pointer); 00110 return *this; 00111 } 00112 00113 00114 #endif 00115