File indexing completed on 2025-01-18 10:04:12
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019 #ifndef LDOM_XmlReader_HeaderFile
0020 #define LDOM_XmlReader_HeaderFile
0021
0022
0023 #define XML_BUFFER_SIZE 20480
0024
0025 #include <LDOM_BasicElement.hxx>
0026 #include <LDOM_OSStream.hxx>
0027
0028 class TCollection_AsciiString;
0029
0030
0031
0032
0033 class LDOM_XmlReader
0034 {
0035 public:
0036 enum RecordType {
0037 XML_UNKNOWN,
0038 XML_HEADER,
0039 XML_DOCTYPE,
0040 XML_COMMENT,
0041 XML_START_ELEMENT,
0042 XML_END_ELEMENT,
0043 XML_FULL_ELEMENT,
0044 XML_TEXT,
0045 XML_CDATA,
0046 XML_EOF
0047 };
0048
0049
0050 LDOM_XmlReader (const Handle(LDOM_MemManager)& aDocument,
0051 TCollection_AsciiString& anErrorString,
0052 const Standard_Boolean theTagPerStep = Standard_False);
0053
0054
0055
0056 RecordType ReadRecord (Standard_IStream& theIStream,
0057 LDOM_OSStream& theData,
0058 Standard_Boolean& theDocStart);
0059
0060
0061 LDOM_BasicElement& GetElement() const { return * myElement; }
0062
0063
0064 void CreateElement (const char *theName, const Standard_Integer theLen);
0065
0066 static Standard_Boolean getInteger (LDOMBasicString& theValue,
0067 const char * theStart,
0068 const char * theEnd);
0069
0070
0071
0072 LDOM_OSStream::BOMType GetBOM() const { return myBOM; }
0073
0074 private:
0075
0076 LDOM_XmlReader (const LDOM_XmlReader& theOther);
0077
0078
0079 LDOM_XmlReader& operator = (const LDOM_XmlReader& theOther);
0080
0081
0082 private:
0083
0084
0085 Standard_Boolean myEOF;
0086 TCollection_AsciiString & myError;
0087 Handle(LDOM_MemManager) myDocument;
0088 LDOM_BasicElement * myElement;
0089 const LDOM_BasicNode * myLastChild;
0090 const char * myPtr;
0091 const char * myEndPtr;
0092 char myBuffer [XML_BUFFER_SIZE+4];
0093 Standard_Boolean myTagPerStep;
0094 LDOM_OSStream::BOMType myBOM;
0095 };
0096
0097 #endif