VTK
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
vtkXMLDataParser Class Reference

Used by vtkXMLReader to parse VTK XML files. More...

#include <vtkXMLDataParser.h>

Inheritance diagram for vtkXMLDataParser:
[legend]
Collaboration diagram for vtkXMLDataParser:
[legend]

Public Types

enum  { BigEndian, LittleEndian }
 
typedef vtkXMLParser Superclass
 
- Public Types inherited from vtkXMLParser
typedef vtkObject Superclass
 
- Public Types inherited from vtkObject
typedef vtkObjectBase Superclass
 

Public Member Functions

virtual int IsA (const char *type)
 
vtkXMLDataParserNewInstance () const
 
void PrintSelf (ostream &os, vtkIndent indent)
 
vtkXMLDataElementGetRootElement ()
 
size_t GetWordTypeSize (int wordType)
 
virtual int Parse ()
 
virtual void CharacterDataHandler (const char *data, int length)
 
size_t ReadInlineData (vtkXMLDataElement *element, int isAscii, void *buffer, vtkTypeUInt64 startWord, size_t numWords, int wordType)
 
size_t ReadInlineData (vtkXMLDataElement *element, int isAscii, char *buffer, vtkTypeUInt64 startWord, size_t numWords)
 
size_t ReadAppendedData (vtkTypeInt64 offset, void *buffer, vtkTypeUInt64 startWord, size_t numWords, int wordType)
 
size_t ReadAppendedData (vtkTypeInt64 offset, char *buffer, vtkTypeUInt64 startWord, size_t numWords)
 
size_t ReadAsciiData (void *buffer, vtkTypeUInt64 startWord, size_t numWords, int wordType)
 
size_t ReadBinaryData (void *buffer, vtkTypeUInt64 startWord, size_t maxWords, int wordType)
 
virtual void SetCompressor (vtkDataCompressor *)
 
virtual vtkDataCompressorGetCompressor ()
 
virtual int GetAbort ()
 
virtual void SetAbort (int)
 
virtual float GetProgress ()
 
virtual void SetProgress (float)
 
virtual void SetAttributesEncoding (int)
 
virtual int GetAttributesEncoding ()
 
vtkTypeInt64 GetAppendedDataPosition ()
 
- Public Member Functions inherited from vtkXMLParser
vtkXMLParserNewInstance () const
 
void PrintSelf (ostream &os, vtkIndent indent)
 
virtual void SetStream (istream *)
 
virtual istream * GetStream ()
 
vtkTypeInt64 TellG ()
 
void SeekG (vtkTypeInt64 position)
 
virtual int InitializeParser ()
 
virtual int ParseChunk (const char *inputString, unsigned int length)
 
virtual int CleanupParser ()
 
virtual void SetFileName (const char *)
 
virtual char * GetFileName ()
 
virtual void SetIgnoreCharacterData (int)
 
virtual int GetIgnoreCharacterData ()
 
virtual void SetEncoding (const char *)
 
virtual char * GetEncoding ()
 
- Public Member Functions inherited from vtkObject
vtkObjectNewInstance () const
 
virtual void DebugOn ()
 
virtual void DebugOff ()
 
bool GetDebug ()
 
void SetDebug (bool debugFlag)
 
virtual void Modified ()
 
virtual unsigned long GetMTime ()
 
unsigned long AddObserver (unsigned long event, vtkCommand *, float priority=0.0f)
 
unsigned long AddObserver (const char *event, vtkCommand *, float priority=0.0f)
 
vtkCommandGetCommand (unsigned long tag)
 
void RemoveObserver (vtkCommand *)
 
void RemoveObservers (unsigned long event, vtkCommand *)
 
void RemoveObservers (const char *event, vtkCommand *)
 
int HasObserver (unsigned long event, vtkCommand *)
 
int HasObserver (const char *event, vtkCommand *)
 
void RemoveObserver (unsigned long tag)
 
void RemoveObservers (unsigned long event)
 
void RemoveObservers (const char *event)
 
void RemoveAllObservers ()
 
int HasObserver (unsigned long event)
 
int HasObserver (const char *event)
 
template<class U , class T >
unsigned long AddObserver (unsigned long event, U observer, void(T::*callback)(), float priority=0.0f)
 
template<class U , class T >
unsigned long AddObserver (unsigned long event, U observer, void(T::*callback)(vtkObject *, unsigned long, void *), float priority=0.0f)
 
template<class U , class T >
unsigned long AddObserver (unsigned long event, U observer, bool(T::*callback)(vtkObject *, unsigned long, void *), float priority=0.0f)
 
int InvokeEvent (unsigned long event, void *callData)
 
int InvokeEvent (const char *event, void *callData)
 
int InvokeEvent (unsigned long event)
 
int InvokeEvent (const char *event)
 
- Public Member Functions inherited from vtkObjectBase
const char * GetClassName () const
 
virtual void Delete ()
 
virtual void FastDelete ()
 
void Print (ostream &os)
 
virtual void Register (vtkObjectBase *o)
 
virtual void UnRegister (vtkObjectBase *o)
 
void SetReferenceCount (int)
 
void PrintRevisions (ostream &)
 
virtual void PrintHeader (ostream &os, vtkIndent indent)
 
virtual void PrintTrailer (ostream &os, vtkIndent indent)
 
int GetReferenceCount ()
 

Static Public Member Functions

static int IsTypeOf (const char *type)
 
static vtkXMLDataParserSafeDownCast (vtkObjectBase *o)
 
static vtkXMLDataParserNew ()
 
- Static Public Member Functions inherited from vtkXMLParser
static int IsTypeOf (const char *type)
 
static vtkXMLParserSafeDownCast (vtkObjectBase *o)
 
static vtkXMLParserNew ()
 
- Static Public Member Functions inherited from vtkObject
static int IsTypeOf (const char *type)
 
static vtkObjectSafeDownCast (vtkObjectBase *o)
 
static vtkObjectNew ()
 
static void BreakOnError ()
 
static void SetGlobalWarningDisplay (int val)
 
static void GlobalWarningDisplayOn ()
 
static void GlobalWarningDisplayOff ()
 
static int GetGlobalWarningDisplay ()
 
- Static Public Member Functions inherited from vtkObjectBase
static int IsTypeOf (const char *name)
 
static vtkObjectBaseNew ()
 

Protected Member Functions

virtual vtkObjectBaseNewInstanceInternal () const
 
 vtkXMLDataParser ()
 
 ~vtkXMLDataParser ()
 
virtual int Parse (const char *)
 
virtual int Parse (const char *, unsigned int)
 
virtual void StartElement (const char *name, const char **atts)
 
virtual void EndElement (const char *)
 
int ParsingComplete ()
 
int CheckPrimaryAttributes ()
 
void FindAppendedDataPosition ()
 
int ParseBuffer (const char *buffer, unsigned int count)
 
void AddElement (vtkXMLDataElement *element)
 
void PushOpenElement (vtkXMLDataElement *element)
 
vtkXMLDataElementPopOpenElement ()
 
void FreeAllElements ()
 
void PerformByteSwap (void *data, size_t numWords, size_t wordSize)
 
int ReadCompressionHeader ()
 
size_t FindBlockSize (vtkTypeUInt64 block)
 
int ReadBlock (vtkTypeUInt64 block, unsigned char *buffer)
 
unsigned char * ReadBlock (vtkTypeUInt64 block)
 
size_t ReadUncompressedData (unsigned char *data, vtkTypeUInt64 startWord, size_t numWords, size_t wordSize)
 
size_t ReadCompressedData (unsigned char *data, vtkTypeUInt64 startWord, size_t numWords, size_t wordSize)
 
void SeekInlineDataPosition (vtkXMLDataElement *element)
 
int ParseAsciiData (int wordType)
 
void FreeAsciiBuffer ()
 
void UpdateProgress (float progress)
 
- Protected Member Functions inherited from vtkXMLParser
 vtkXMLParser ()
 
 ~vtkXMLParser ()
 
virtual int CreateParser ()
 
virtual int ParseXML ()
 
virtual void ReportStrayAttribute (const char *element, const char *attr, const char *value)
 
virtual void ReportMissingAttribute (const char *element, const char *attr)
 
virtual void ReportBadAttribute (const char *element, const char *attr, const char *value)
 
virtual void ReportUnknownElement (const char *element)
 
virtual void ReportXmlParseError ()
 
vtkTypeInt64 GetXMLByteIndex ()
 
int ParseBuffer (const char *buffer)
 
- Protected Member Functions inherited from vtkObject
 vtkObject ()
 
virtual ~vtkObject ()
 
virtual void RegisterInternal (vtkObjectBase *, int check)
 
virtual void UnRegisterInternal (vtkObjectBase *, int check)
 
void InternalGrabFocus (vtkCommand *mouseEvents, vtkCommand *keypressEvents=NULL)
 
void InternalReleaseFocus ()
 
- Protected Member Functions inherited from vtkObjectBase
 vtkObjectBase ()
 
virtual ~vtkObjectBase ()
 
virtual void CollectRevisions (ostream &)
 
virtual void ReportReferences (vtkGarbageCollector *)
 
 vtkObjectBase (const vtkObjectBase &)
 
void operator= (const vtkObjectBase &)
 

Protected Attributes

vtkXMLDataElementRootElement
 
vtkXMLDataElement ** OpenElements
 
unsigned int NumberOfOpenElements
 
unsigned int OpenElementsSize
 
vtkTypeInt64 AppendedDataPosition
 
int AppendedDataMatched
 
int ByteOrder
 
int HeaderType
 
vtkInputStreamDataStream
 
vtkInputStreamInlineDataStream
 
vtkInputStreamAppendedDataStream
 
vtkDataCompressorCompressor
 
size_t NumberOfBlocks
 
size_t BlockUncompressedSize
 
size_t PartialLastBlockUncompressedSize
 
size_t * BlockCompressedSizes
 
vtkTypeInt64 * BlockStartOffsets
 
unsigned char * AsciiDataBuffer
 
size_t AsciiDataBufferLength
 
int AsciiDataWordType
 
vtkTypeInt64 AsciiDataPosition
 
float Progress
 
int Abort
 
int AttributesEncoding
 
- Protected Attributes inherited from vtkXMLParser
istream * Stream
 
char * FileName
 
char * Encoding
 
int ParseError
 
const char * InputString
 
int InputStringLength
 
void * Parser
 
int IgnoreCharacterData
 
- Protected Attributes inherited from vtkObject
bool Debug
 
vtkTimeStamp MTime
 
vtkSubjectHelper * SubjectHelper
 
- Protected Attributes inherited from vtkObjectBase
vtkAtomicInt32 ReferenceCount
 
vtkWeakPointerBase ** WeakPointers
 

Additional Inherited Members

- Static Protected Member Functions inherited from vtkXMLParser
static int IsSpace (char c)
 

Detailed Description

Used by vtkXMLReader to parse VTK XML files.

vtkXMLDataParser provides a subclass of vtkXMLParser that constructs a representation of an XML data format's file using vtkXMLDataElement to represent each XML element. This representation is then used by vtkXMLReader and its subclasses to traverse the structure of the file and extract data.

See also
vtkXMLDataElement
Events:
vtkCommand::ProgressEvent

Definition at line 41 of file vtkXMLDataParser.h.

Member Typedef Documentation

Definition at line 44 of file vtkXMLDataParser.h.

Member Enumeration Documentation

anonymous enum

Enumerate big and little endian byte order settings.

Enumerator
BigEndian 
LittleEndian 

Definition at line 53 of file vtkXMLDataParser.h.

Constructor & Destructor Documentation

vtkXMLDataParser::vtkXMLDataParser ( )
protected
vtkXMLDataParser::~vtkXMLDataParser ( )
protected

Member Function Documentation

static int vtkXMLDataParser::IsTypeOf ( const char *  type)
static
virtual int vtkXMLDataParser::IsA ( const char *  name)
virtual

Return 1 if this class is the same type of (or a subclass of) the named class. Returns 0 otherwise. This method works in combination with vtkTypeMacro found in vtkSetGet.h.

Reimplemented from vtkXMLParser.

static vtkXMLDataParser* vtkXMLDataParser::SafeDownCast ( vtkObjectBase o)
static
virtual vtkObjectBase* vtkXMLDataParser::NewInstanceInternal ( ) const
protectedvirtual

Reimplemented from vtkXMLParser.

vtkXMLDataParser* vtkXMLDataParser::NewInstance ( ) const
void vtkXMLDataParser::PrintSelf ( ostream &  os,
vtkIndent  indent 
)
virtual

Methods invoked by print to print information about the object including superclasses. Typically not called by the user (use Print() instead) but used in the hierarchical print process to combine the output of several classes.

Reimplemented from vtkObject.

static vtkXMLDataParser* vtkXMLDataParser::New ( )
static
vtkXMLDataElement* vtkXMLDataParser::GetRootElement ( )

Get the root element from the XML document.

size_t vtkXMLDataParser::ReadInlineData ( vtkXMLDataElement element,
int  isAscii,
void *  buffer,
vtkTypeUInt64  startWord,
size_t  numWords,
int  wordType 
)

Read inline data from inside the given element. Returns the number of words read.

size_t vtkXMLDataParser::ReadInlineData ( vtkXMLDataElement element,
int  isAscii,
char *  buffer,
vtkTypeUInt64  startWord,
size_t  numWords 
)
inline

Read inline data from inside the given element. Returns the number of words read.

Definition at line 61 of file vtkXMLDataParser.h.

size_t vtkXMLDataParser::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. Returns the number of words read.

size_t vtkXMLDataParser::ReadAppendedData ( vtkTypeInt64  offset,
char *  buffer,
vtkTypeUInt64  startWord,
size_t  numWords 
)
inline

Read from an appended data section starting at the given appended data offset. Returns the number of words read.

Definition at line 74 of file vtkXMLDataParser.h.

size_t vtkXMLDataParser::ReadAsciiData ( void *  buffer,
vtkTypeUInt64  startWord,
size_t  numWords,
int  wordType 
)

Read from an ascii data section starting at the current position in the stream. Returns the number of words read.

size_t vtkXMLDataParser::ReadBinaryData ( void *  buffer,
vtkTypeUInt64  startWord,
size_t  maxWords,
int  wordType 
)

Read from a data section starting at the current position in the stream. Returns the number of words read.

virtual void vtkXMLDataParser::SetCompressor ( vtkDataCompressor )
virtual

Get/Set the compressor used to decompress binary and appended data after reading from the file.

virtual vtkDataCompressor* vtkXMLDataParser::GetCompressor ( )
virtual

Get/Set the compressor used to decompress binary and appended data after reading from the file.

size_t vtkXMLDataParser::GetWordTypeSize ( int  wordType)

Get the size of a word of the given type.

virtual int vtkXMLDataParser::Parse ( )
virtual

Parse the XML input and check that the file is safe to read. Returns 1 for okay, 0 for error.

Reimplemented from vtkXMLParser.

virtual int vtkXMLDataParser::GetAbort ( )
virtual

Get/Set flag to abort reading of data. This may be set by a progress event observer.

virtual void vtkXMLDataParser::SetAbort ( int  )
virtual

Get/Set flag to abort reading of data. This may be set by a progress event observer.

virtual float vtkXMLDataParser::GetProgress ( )
virtual

Get/Set progress of reading data. This may be checked by a progress event observer.

virtual void vtkXMLDataParser::SetProgress ( float  )
virtual

Get/Set progress of reading data. This may be checked by a progress event observer.

virtual void vtkXMLDataParser::SetAttributesEncoding ( int  )
virtual

Get/Set the character encoding that will be used to set the attributes's encoding type of each vtkXMLDataElement created by this parser (i.e., the data element attributes will use that encoding internally). If set to VTK_ENCODING_NONE (default), the attribute encoding type will not be changed and will default to the vtkXMLDataElement default encoding type (see vtkXMLDataElement::AttributeEncoding).

virtual int vtkXMLDataParser::GetAttributesEncoding ( )
virtual

Get/Set the character encoding that will be used to set the attributes's encoding type of each vtkXMLDataElement created by this parser (i.e., the data element attributes will use that encoding internally). If set to VTK_ENCODING_NONE (default), the attribute encoding type will not be changed and will default to the vtkXMLDataElement default encoding type (see vtkXMLDataElement::AttributeEncoding).

void vtkXMLDataParser::CharacterDataHandler ( const char *  data,
int  length 
)
inlinevirtual

If you need the text inside XMLElements, turn IgnoreCharacterData off. This method will then be called when the file is parsed, and the text will be stored in each XMLDataElement. VTK XML Readers store the information elsewhere, so the default is to ignore it.

Reimplemented from vtkXMLParser.

Definition at line 258 of file vtkXMLDataParser.h.

vtkTypeInt64 vtkXMLDataParser::GetAppendedDataPosition ( )
inline

Returns the byte index of where appended data starts (if the file is using appended data). Valid after the XML is parsed.

Definition at line 145 of file vtkXMLDataParser.h.

virtual int vtkXMLDataParser::Parse ( const char *  inputString)
protectedvirtual

Parse the XML message. If length is specified, parse only the first "length" characters

Reimplemented from vtkXMLParser.

virtual int vtkXMLDataParser::Parse ( const char *  inputString,
unsigned  length 
)
protectedvirtual

Parse the XML message. If length is specified, parse only the first "length" characters

Reimplemented from vtkXMLParser.

virtual void vtkXMLDataParser::StartElement ( const char *  name,
const char **  atts 
)
protectedvirtual

Reimplemented from vtkXMLParser.

virtual void vtkXMLDataParser::EndElement ( const char *  )
protectedvirtual

Reimplemented from vtkXMLParser.

int vtkXMLDataParser::ParsingComplete ( )
protectedvirtual

Reimplemented from vtkXMLParser.

int vtkXMLDataParser::CheckPrimaryAttributes ( )
protected
void vtkXMLDataParser::FindAppendedDataPosition ( )
protected
int vtkXMLDataParser::ParseBuffer ( const char *  buffer,
unsigned int  count 
)
protectedvirtual

Reimplemented from vtkXMLParser.

void vtkXMLDataParser::AddElement ( vtkXMLDataElement element)
protected
void vtkXMLDataParser::PushOpenElement ( vtkXMLDataElement element)
protected
vtkXMLDataElement* vtkXMLDataParser::PopOpenElement ( )
protected
void vtkXMLDataParser::FreeAllElements ( )
protected
void vtkXMLDataParser::PerformByteSwap ( void *  data,
size_t  numWords,
size_t  wordSize 
)
protected
int vtkXMLDataParser::ReadCompressionHeader ( )
protected
size_t vtkXMLDataParser::FindBlockSize ( vtkTypeUInt64  block)
protected
int vtkXMLDataParser::ReadBlock ( vtkTypeUInt64  block,
unsigned char *  buffer 
)
protected
unsigned char* vtkXMLDataParser::ReadBlock ( vtkTypeUInt64  block)
protected
size_t vtkXMLDataParser::ReadUncompressedData ( unsigned char *  data,
vtkTypeUInt64  startWord,
size_t  numWords,
size_t  wordSize 
)
protected
size_t vtkXMLDataParser::ReadCompressedData ( unsigned char *  data,
vtkTypeUInt64  startWord,
size_t  numWords,
size_t  wordSize 
)
protected
void vtkXMLDataParser::SeekInlineDataPosition ( vtkXMLDataElement element)
protected
int vtkXMLDataParser::ParseAsciiData ( int  wordType)
protected
void vtkXMLDataParser::FreeAsciiBuffer ( )
protected
void vtkXMLDataParser::UpdateProgress ( float  progress)
protected

Member Data Documentation

vtkXMLDataElement* vtkXMLDataParser::RootElement
protected

Definition at line 199 of file vtkXMLDataParser.h.

vtkXMLDataElement** vtkXMLDataParser::OpenElements
protected

Definition at line 202 of file vtkXMLDataParser.h.

unsigned int vtkXMLDataParser::NumberOfOpenElements
protected

Definition at line 203 of file vtkXMLDataParser.h.

unsigned int vtkXMLDataParser::OpenElementsSize
protected

Definition at line 204 of file vtkXMLDataParser.h.

vtkTypeInt64 vtkXMLDataParser::AppendedDataPosition
protected

Definition at line 207 of file vtkXMLDataParser.h.

int vtkXMLDataParser::AppendedDataMatched
protected

Definition at line 210 of file vtkXMLDataParser.h.

int vtkXMLDataParser::ByteOrder
protected

Definition at line 213 of file vtkXMLDataParser.h.

int vtkXMLDataParser::HeaderType
protected

Definition at line 216 of file vtkXMLDataParser.h.

vtkInputStream* vtkXMLDataParser::DataStream
protected

Definition at line 220 of file vtkXMLDataParser.h.

vtkInputStream* vtkXMLDataParser::InlineDataStream
protected

Definition at line 224 of file vtkXMLDataParser.h.

vtkInputStream* vtkXMLDataParser::AppendedDataStream
protected

Definition at line 227 of file vtkXMLDataParser.h.

vtkDataCompressor* vtkXMLDataParser::Compressor
protected

Definition at line 230 of file vtkXMLDataParser.h.

size_t vtkXMLDataParser::NumberOfBlocks
protected

Definition at line 231 of file vtkXMLDataParser.h.

size_t vtkXMLDataParser::BlockUncompressedSize
protected

Definition at line 232 of file vtkXMLDataParser.h.

size_t vtkXMLDataParser::PartialLastBlockUncompressedSize
protected

Definition at line 233 of file vtkXMLDataParser.h.

size_t* vtkXMLDataParser::BlockCompressedSizes
protected

Definition at line 234 of file vtkXMLDataParser.h.

vtkTypeInt64* vtkXMLDataParser::BlockStartOffsets
protected

Definition at line 235 of file vtkXMLDataParser.h.

unsigned char* vtkXMLDataParser::AsciiDataBuffer
protected

Definition at line 238 of file vtkXMLDataParser.h.

size_t vtkXMLDataParser::AsciiDataBufferLength
protected

Definition at line 239 of file vtkXMLDataParser.h.

int vtkXMLDataParser::AsciiDataWordType
protected

Definition at line 240 of file vtkXMLDataParser.h.

vtkTypeInt64 vtkXMLDataParser::AsciiDataPosition
protected

Definition at line 241 of file vtkXMLDataParser.h.

float vtkXMLDataParser::Progress
protected

Definition at line 244 of file vtkXMLDataParser.h.

int vtkXMLDataParser::Abort
protected

Definition at line 247 of file vtkXMLDataParser.h.

int vtkXMLDataParser::AttributesEncoding
protected

Definition at line 249 of file vtkXMLDataParser.h.


The documentation for this class was generated from the following file: