32#ifndef vtkXMLDataParser_h
33#define vtkXMLDataParser_h
35#include "vtkIOXMLParserModule.h"
68 vtkTypeUInt64 startWord,
size_t numWords,
int wordType);
70 vtkXMLDataElement* element,
int isAscii,
char* buffer, vtkTypeUInt64 startWord,
size_t numWords)
72 return this->ReadInlineData(element, isAscii, buffer, startWord, numWords,
VTK_CHAR);
80 vtkTypeInt64 offset,
void* buffer, vtkTypeUInt64 startWord,
size_t numWords,
int wordType);
82 vtkTypeInt64 offset,
char* buffer, vtkTypeUInt64 startWord,
size_t numWords)
84 return this->ReadAppendedData(offset, buffer, startWord, numWords,
VTK_CHAR);
91 size_t ReadAsciiData(
void* buffer, vtkTypeUInt64 startWord,
size_t numWords,
int wordType);
97 size_t ReadBinaryData(
void* buffer, vtkTypeUInt64 startWord,
size_t maxWords,
int wordType);
124 vtkGetMacro(Abort,
int);
125 vtkSetMacro(Abort,
int);
133 vtkGetMacro(Progress,
float);
134 vtkSetMacro(Progress,
float);
147 vtkGetMacro(AttributesEncoding,
int);
170 int Parse(
const char*,
unsigned int)
override;
190 int ReadBlock(vtkTypeUInt64 block,
unsigned char* buffer);
193 unsigned char* data, vtkTypeUInt64 startWord,
size_t numWords,
size_t wordSize);
195 unsigned char* data, vtkTypeUInt64 startWord,
size_t numWords,
size_t wordSize);
Abstract interface for data compression classes.
a simple class to control print indentation
Represents an XML element and those nested inside.
void AddCharacterData(const char *c, size_t length)
Set/Get the character data between XML start/end tags.
Used by vtkXMLReader to parse VTK XML files.
static vtkXMLDataParser * New()
void PushOpenElement(vtkXMLDataElement *element)
int CheckPrimaryAttributes()
int ReadCompressionHeader()
virtual void SetCompressor(vtkDataCompressor *)
Get/Set the compressor used to decompress binary and appended data after reading from the file.
void UpdateProgress(float progress)
~vtkXMLDataParser() override
vtkXMLDataElement * PopOpenElement()
void FindAppendedDataPosition()
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkXMLDataElement * RootElement
vtkXMLDataElement ** OpenElements
size_t PartialLastBlockUncompressedSize
size_t ReadUncompressedData(unsigned char *data, vtkTypeUInt64 startWord, size_t numWords, size_t wordSize)
void StartElement(const char *name, const char **atts) override
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.
int Parse() override
Parse the XML input and check that the file is safe to read.
vtkInputStream * DataStream
vtkInputStream * InlineDataStream
int ReadBlock(vtkTypeUInt64 block, unsigned char *buffer)
size_t FindBlockSize(vtkTypeUInt64 block)
size_t ReadInlineData(vtkXMLDataElement *element, int isAscii, void *buffer, vtkTypeUInt64 startWord, size_t numWords, int wordType)
Read inline data from inside the given element.
vtkInputStream * AppendedDataStream
vtkDataCompressor * Compressor
vtkTypeInt64 GetAppendedDataPosition()
Returns the byte index of where appended data starts (if the file is using appended data).
size_t AsciiDataBufferLength
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.
void SeekInlineDataPosition(vtkXMLDataElement *element)
size_t ReadAppendedData(vtkTypeInt64 offset, char *buffer, vtkTypeUInt64 startWord, size_t numWords)
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.
size_t * BlockCompressedSizes
vtkXMLDataElement * GetRootElement()
Get the root element from the XML document.
vtkTypeInt64 AsciiDataPosition
unsigned int NumberOfOpenElements
int Parse(const char *) override
Parse the XML message.
size_t GetWordTypeSize(int wordType)
Get the size of a word of the given type.
void CharacterDataHandler(const char *data, int length) override
If you need the text inside XMLElements, turn IgnoreCharacterData off.
vtkTypeInt64 AppendedDataPosition
void EndElement(const char *) override
int ParseBuffer(const char *buffer, unsigned int count) override
int ParseAsciiData(int wordType)
size_t BlockUncompressedSize
int Parse(const char *, unsigned int) override
Parse the XML message.
void AddElement(vtkXMLDataElement *element)
unsigned char * AsciiDataBuffer
size_t ReadCompressedData(unsigned char *data, vtkTypeUInt64 startWord, size_t numWords, size_t wordSize)
unsigned char * ReadBlock(vtkTypeUInt64 block)
void PerformByteSwap(void *data, size_t numWords, size_t wordSize)
size_t ReadInlineData(vtkXMLDataElement *element, int isAscii, char *buffer, vtkTypeUInt64 startWord, size_t numWords)
int ParsingComplete() override
unsigned int OpenElementsSize
vtkTypeInt64 * BlockStartOffsets
Parse XML to handle element tags and attributes.
virtual void CharacterDataHandler(const char *data, int length)
#define VTK_ENCODING_UNKNOWN
#define VTK_ENCODING_NONE