![]() |
The Simons
|
00001 00002 // 00003 // SCL : Simons Component Library 00004 // 00006 // 00007 // Filename: Reader.h 00008 // Contents: Reader class 00009 // Author: Anthony J H Simons 00010 // Revised: 6 December 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_READER 00020 #define SCL_READER 00021 00022 #include "FormatStream.h" // Include the superclass type 00023 #include "ReaderID.h" // Include the pointer type 00024 00025 #include "StringID.h" // Depend on the pointer types 00026 #include "TextInputID.h" 00027 00037 00038 class Reader : public FormatStream { 00039 protected: 00040 TextInputID input; 00041 Reader(const Reader&); 00042 virtual FileStreamID fileStream() const; 00043 public: 00044 Reader(); 00045 virtual ~Reader(); 00046 Reader(StringID); 00047 virtual Natural multiple() const; 00048 InputID stream() const; 00049 virtual ReaderID get(ObjectID&); 00050 virtual ReaderID getField(StringID, ObjectID&); 00051 00052 }; 00053 00055 00061 inline InputID Reader::stream() const { 00062 return input; 00063 } 00064 00069 inline FileStreamID Reader::fileStream() const { 00070 return input; 00071 } 00072 00074 00077 inline ReaderID::ReaderID() {} 00078 00080 inline ReaderID::~ReaderID() {} 00081 00085 inline ReaderID::ReaderID(const Null* null) : 00086 FormatStreamID(null) {} 00087 00091 inline ReaderID::ReaderID(const Reader* stream) : 00092 FormatStreamID(stream) {} 00093 00097 inline ReaderID::ReaderID(const ReaderID& pointer) : 00098 FormatStreamID(pointer) {} 00099 00103 inline ReaderID& ReaderID::operator=(const Reader* stream) { 00104 assign(stream); 00105 return *this; 00106 } 00107 00112 inline ReaderID& ReaderID::operator=(const ReaderID& pointer) { 00113 assign(pointer); 00114 return *this; 00115 } 00116 00117 00118 #endif 00119