![]() |
The Simons
|
00001 00002 // 00003 // SCL : Simons Component Library 00004 // 00006 // 00007 // Filename: XMLWriter.h 00008 // Contents: XMLWriter class 00009 // Author: Anthony J H Simons 00010 // Revised: 8 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_WRITER 00020 #define SCL_XML_WRITER 00021 00022 #include "Writer.h" // Include my superclass type 00023 #include "XMLWriterID.h" // Include my pointer type 00024 00025 #include "StringID.h" // Depends on these pointer types 00026 #include "SetID.h" 00027 00037 00038 class XMLWriter : public Writer { 00039 private: 00040 SetID idSet; 00041 Natural indent; 00042 Void putLine(); 00043 Void putIndent(); 00044 Void putOpenTag(StringID); // Null 00045 Void putOpenTag(ObjectID, StringID); // Value 00046 Void putOpenTag(ObjectID, StringID, Boolean); // Object 00047 Void putCloseTag(ObjectID); 00048 XMLWriter(const XMLWriter&); 00049 public: 00050 XMLWriter(); 00051 virtual ~XMLWriter(); 00052 virtual ObjectID clone() const; 00053 XMLWriter(StringID); 00054 00055 virtual WriterID put(ObjectID); 00056 virtual WriterID putField(StringID, ObjectID); 00057 }; 00058 00060 00063 inline XMLWriterID::XMLWriterID() {} 00064 00066 inline XMLWriterID::~XMLWriterID() {} 00067 00071 inline XMLWriterID::XMLWriterID(const Null* null) : 00072 WriterID(null) {} 00073 00077 inline XMLWriterID::XMLWriterID(const XMLWriter* stream) : 00078 WriterID(stream) {} 00079 00083 inline XMLWriterID::XMLWriterID(const XMLWriterID& pointer) : 00084 WriterID(pointer) {} 00085 00089 inline XMLWriterID& XMLWriterID::operator=(const XMLWriter* stream) { 00090 assign(stream); 00091 return *this; 00092 } 00093 00098 inline XMLWriterID& XMLWriterID::operator=(const XMLWriterID& pointer) { 00099 assign(pointer); 00100 return *this; 00101 } 00102 00103 00104 #endif 00105