Go to the documentation of this file.
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,
74 vtkTypeUInt64 startWord,
75 size_t numWords,
int wordType);
77 vtkTypeUInt64 startWord,
79 {
return this->ReadAppendedData(
offset, buffer, startWord, numWords,
87 size_t numWords,
int wordType);
94 size_t maxWords,
int wordType);
121 vtkGetMacro(Abort,
int);
122 vtkSetMacro(Abort,
int);
130 vtkGetMacro(Progress,
float);
131 vtkSetMacro(Progress,
float);
144 vtkGetMacro(AttributesEncoding,
int);
161 return this->AppendedDataPosition;
170 int Parse(
const char*,
unsigned int)
override;
190 int ReadBlock(vtkTypeUInt64 block,
unsigned char* buffer);
193 vtkTypeUInt64 startWord,
197 vtkTypeUInt64 startWord,
void PushOpenElement(vtkXMLDataElement *element)
int CheckPrimaryAttributes()
Parse XML to handle element tags and attributes.
size_t ReadCompressedData(unsigned char *data, vtkTypeUInt64 startWord, size_t numWords, size_t wordSize)
int Parse(const char *) override
Parse the XML message.
vtkTypeInt64 AppendedDataPosition
int ParseBuffer(const char *buffer, unsigned int count) override
vtkInputStream * DataStream
#define VTK_ENCODING_NONE
~vtkXMLDataParser() override
size_t PartialLastBlockUncompressedSize
void FindAppendedDataPosition()
size_t ReadUncompressedData(unsigned char *data, vtkTypeUInt64 startWord, size_t numWords, size_t wordSize)
size_t BlockUncompressedSize
void CharacterDataHandler(const char *data, int length) override
If you need the text inside XMLElements, turn IgnoreCharacterData off.
vtkTypeInt64 * BlockStartOffsets
size_t AsciiDataBufferLength
unsigned char * ReadBlock(vtkTypeUInt64 block)
vtkTypeInt64 AsciiDataPosition
vtkXMLDataElement * GetRootElement()
Get the root element from the XML document.
vtkTypeInt64 GetAppendedDataPosition()
Returns the byte index of where appended data starts (if the file is using appended data).
int ReadBlock(vtkTypeUInt64 block, unsigned char *buffer)
vtkXMLDataElement ** OpenElements
int ParsingComplete() override
size_t GetWordTypeSize(int wordType)
Get the size of a word of the given type.
unsigned int OpenElementsSize
vtkInputStream * InlineDataStream
int ParseAsciiData(int wordType)
size_t ReadAppendedData(vtkTypeInt64 offset, char *buffer, vtkTypeUInt64 startWord, size_t numWords)
int ReadCompressionHeader()
vtkXMLDataElement * PopOpenElement()
void PerformByteSwap(void *data, size_t numWords, size_t wordSize)
void AddCharacterData(const char *c, size_t length)
vtkXMLDataElement * RootElement
size_t ReadBinaryData(void *buffer, vtkTypeUInt64 startWord, size_t maxWords, int wordType)
Read from a data section starting at the current position in the stream.
void AddElement(vtkXMLDataElement *element)
size_t ReadInlineData(vtkXMLDataElement *element, int isAscii, void *buffer, vtkTypeUInt64 startWord, size_t numWords, int wordType)
Read inline data from inside the given element.
void StartElement(const char *name, const char **atts) override
virtual void SetCompressor(vtkDataCompressor *)
Get/Set the compressor used to decompress binary and appended data after reading from the file.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
void SeekInlineDataPosition(vtkXMLDataElement *element)
a simple class to control print indentation
vtkInputStream * AppendedDataStream
Abstract interface for data compression classes.
Represents an XML element and those nested inside.
size_t ReadAsciiData(void *buffer, vtkTypeUInt64 startWord, size_t numWords, int wordType)
Read from an ascii data section starting at the current position in the stream.
unsigned char * AsciiDataBuffer
size_t * BlockCompressedSizes
vtkDataCompressor * Compressor
#define VTK_ENCODING_UNKNOWN
size_t ReadInlineData(vtkXMLDataElement *element, int isAscii, char *buffer, vtkTypeUInt64 startWord, size_t numWords)
static vtkXMLDataParser * New()
int Parse(const char *, unsigned int) override
int Parse() override
Parse the XML input and check that the file is safe to read.
unsigned int NumberOfOpenElements
void EndElement(const char *) override
virtual void CharacterDataHandler(const char *data, int length)
size_t FindBlockSize(vtkTypeUInt64 block)
void UpdateProgress(float progress)
size_t ReadAppendedData(vtkTypeInt64 offset, void *buffer, vtkTypeUInt64 startWord, size_t numWords, int wordType)
Read from an appended data section starting at the given appended data offset.
Used by vtkXMLReader to parse VTK XML files.