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);
130 vtkGetMacro(Progress,
float);
144 vtkGetMacro(AttributesEncoding,
int);
161 return this->AppendedDataPosition;
170 virtual int Parse(
const char*,
unsigned int);
190 int ReadBlock(vtkTypeUInt64 block,
unsigned char* buffer);
193 vtkTypeUInt64 startWord,
197 vtkTypeUInt64 startWord,
virtual int Parse()
Parse the XML input and check that the file is safe to read.
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)
vtkTypeInt64 AppendedDataPosition
virtual int Parse(const char *, unsigned int)
vtkInputStream * DataStream
#define VTK_ENCODING_NONE
size_t PartialLastBlockUncompressedSize
void FindAppendedDataPosition()
size_t ReadUncompressedData(unsigned char *data, vtkTypeUInt64 startWord, size_t numWords, size_t wordSize)
size_t BlockUncompressedSize
vtkTypeInt64 * BlockStartOffsets
size_t AsciiDataBufferLength
unsigned char * ReadBlock(vtkTypeUInt64 block)
vtkTypeInt64 AsciiDataPosition
vtkXMLDataElement * GetRootElement()
Get the root element from the XML document.
virtual void EndElement(const char *)
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
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.
virtual void SetCompressor(vtkDataCompressor *)
Get/Set the compressor used to decompress binary and appended data after reading from the file.
void SeekInlineDataPosition(vtkXMLDataElement *element)
a simple class to control print indentation
vtkInputStream * AppendedDataStream
int ParseBuffer(const char *buffer, unsigned int count)
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
virtual void StartElement(const char *name, const char **atts)
vtkSetMacro(IgnoreDriverBugs, bool)
Updates the extensions string.
virtual void CharacterDataHandler(const char *data, int length)
If you need the text inside XMLElements, turn IgnoreCharacterData off.
vtkDataCompressor * Compressor
#define VTK_ENCODING_UNKNOWN
size_t ReadInlineData(vtkXMLDataElement *element, int isAscii, char *buffer, vtkTypeUInt64 startWord, size_t numWords)
static vtkXMLDataParser * New()
unsigned int NumberOfOpenElements
virtual int Parse(const char *)
Parse the XML message.
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.
void PrintSelf(ostream &os, vtkIndent indent)
Methods invoked by print to print information about the object including superclasses.