29 #ifndef vtkXMLDataParser_h
30 #define vtkXMLDataParser_h
32 #include "vtkIOXMLParserModule.h"
54 enum { BigEndian, LittleEndian };
61 void* buffer, vtkTypeUInt64 startWord,
62 size_t numWords,
int wordType);
64 char* buffer, vtkTypeUInt64 startWord,
66 {
return this->ReadInlineData(element, isAscii, buffer, startWord,
73 size_t ReadAppendedData(vtkTypeInt64
offset,
void* buffer,
74 vtkTypeUInt64 startWord,
75 size_t numWords,
int wordType);
77 vtkTypeUInt64 startWord,
79 {
return this->ReadAppendedData(offset, buffer, startWord, numWords,
86 size_t ReadAsciiData(
void* buffer, vtkTypeUInt64 startWord,
87 size_t numWords,
int wordType);
93 size_t ReadBinaryData(
void* buffer, vtkTypeUInt64 startWord,
94 size_t maxWords,
int wordType);
108 size_t GetWordTypeSize(
int wordType);
114 int Parse() VTK_OVERRIDE;
121 vtkGetMacro(Abort,
int);
130 vtkGetMacro(Progress,
float);
144 vtkGetMacro(AttributesEncoding,
int);
153 void CharacterDataHandler(const
char*
data,
int length) VTK_OVERRIDE;
159 vtkTypeInt64 GetAppendedDataPosition()
161 return this->AppendedDataPosition;
169 int Parse(const
char*) VTK_OVERRIDE;
170 int Parse(const
char*,
unsigned int) VTK_OVERRIDE;
173 void StartElement(const
char*
name, const
char** atts) VTK_OVERRIDE;
174 void EndElement(const
char*) VTK_OVERRIDE;
176 int ParsingComplete() VTK_OVERRIDE;
177 int CheckPrimaryAttributes();
178 void FindAppendedDataPosition();
179 int ParseBuffer(const
char* buffer,
unsigned int count) VTK_OVERRIDE;
184 void FreeAllElements();
185 void PerformByteSwap(
void*
data,
size_t numWords,
size_t wordSize);
188 int ReadCompressionHeader();
189 size_t FindBlockSize(vtkTypeUInt64 block);
190 int ReadBlock(vtkTypeUInt64 block,
unsigned char* buffer);
191 unsigned char* ReadBlock(vtkTypeUInt64 block);
192 size_t ReadUncompressedData(
unsigned char* data,
193 vtkTypeUInt64 startWord,
196 size_t ReadCompressedData(
unsigned char* data,
197 vtkTypeUInt64 startWord,
205 int ParseAsciiData(
int wordType);
206 void FreeAsciiBuffer();
209 void UpdateProgress(
float progress);
216 unsigned int NumberOfOpenElements;
217 unsigned int OpenElementsSize;
220 vtkTypeInt64 AppendedDataPosition;
223 int AppendedDataMatched;
244 size_t NumberOfBlocks;
245 size_t BlockUncompressedSize;
246 size_t PartialLastBlockUncompressedSize;
247 size_t* BlockCompressedSizes;
248 vtkTypeInt64* BlockStartOffsets;
251 unsigned char* AsciiDataBuffer;
252 size_t AsciiDataBufferLength;
253 int AsciiDataWordType;
254 vtkTypeInt64 AsciiDataPosition;
262 int AttributesEncoding;
273 const unsigned int eid=this->NumberOfOpenElements-1;
virtual int Parse()
Parse the XML input.
Abstract interface for data compression classes.
Parse XML to handle element tags and attributes.
Represents an XML element and those nested inside.
#define VTK_ENCODING_UNKNOWN
void AddCharacterData(const char *c, size_t length)
Set/Get the character data between XML start/end tags.
a simple class to control print indentation
size_t ReadAppendedData(vtkTypeInt64 offset, char *buffer, vtkTypeUInt64 startWord, size_t numWords)
#define VTK_ENCODING_NONE
size_t ReadInlineData(vtkXMLDataElement *element, int isAscii, char *buffer, vtkTypeUInt64 startWord, size_t numWords)
vtkSetMacro(IgnoreDriverBugs, bool)
When set known driver bugs are ignored during driver feature detection.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
Used by vtkXMLReader to parse VTK XML files.
static vtkXMLParser * New()