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()
override;
121 vtkGetMacro(Abort,
int);
122 vtkSetMacro(Abort,
int);
130 vtkGetMacro(Progress,
float);
131 vtkSetMacro(Progress,
float);
144 vtkGetMacro(AttributesEncoding,
int);
161 return this->AppendedDataPosition;
169 int Parse(
const char*)
override;
170 int Parse(
const char*,
unsigned int)
override;
177 int CheckPrimaryAttributes();
178 void FindAppendedDataPosition();
179 int ParseBuffer(
const char* buffer,
unsigned int count)
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);
273 const unsigned int eid=this->NumberOfOpenElements-1;
274 this->OpenElements[eid]->AddCharacterData(data, length);
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.
vtkInputStream * InlineDataStream
virtual void StartElement(const char *name, const char **atts)
vtkInputStream * AppendedDataStream
vtkTypeInt64 AppendedDataPosition
#define VTK_ENCODING_UNKNOWN
size_t * BlockCompressedSizes
vtkXMLDataElement ** OpenElements
virtual void CharacterDataHandler(const char *data, int length)
vtkTypeInt64 AsciiDataPosition
a simple class to control print indentation
size_t ReadAppendedData(vtkTypeInt64 offset, char *buffer, vtkTypeUInt64 startWord, size_t numWords)
#define VTK_ENCODING_NONE
vtkXMLDataElement * RootElement
vtkDataCompressor * Compressor
vtkTypeInt64 GetAppendedDataPosition()
Returns the byte index of where appended data starts (if the file is using appended data)...
unsigned int NumberOfOpenElements
virtual int ParsingComplete()
vtkInputStream * DataStream
size_t ReadInlineData(vtkXMLDataElement *element, int isAscii, char *buffer, vtkTypeUInt64 startWord, size_t numWords)
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
size_t BlockUncompressedSize
void CharacterDataHandler(const char *data, int length) override
If you need the text inside XMLElements, turn IgnoreCharacterData off.
vtkTypeInt64 * BlockStartOffsets
Used by vtkXMLReader to parse VTK XML files.
virtual void EndElement(const char *name)
size_t PartialLastBlockUncompressedSize
virtual int ParseBuffer(const char *buffer, unsigned int count)
unsigned int OpenElementsSize
static vtkXMLParser * New()
unsigned char * AsciiDataBuffer
size_t AsciiDataBufferLength