Main Page   Modules   Class Hierarchy   Alphabetical List   Compound List   Compound Members  

CXSIParser Class Reference

Main class for the XSI parser. More...

#include <XSIParser.h>

List of all members.

Public Methods


Detailed Description

Main class for the XSI parser.


Member Function Documentation

SI_Error CXSIParser::AddEscapeChar const SI_Char *    i_szOriginalString,
SI_Char *    l_szNewString
 

adds an escape character in front of invalid ones (ie. \" )

Parameters:
in_pStr  Input String
out_pStr  Resulting String.

SI_Int CXSIParser::CheckNextToken CSIBCString   i_pReadString
 

Check the next token to verify wheter they are children templates or not

Parameters:
i_pReadString  place holder for the token
Returns:
TRUE/FALSE

SI_Void CXSIParser::CleardotXSINativeTemplates  
 

Clears the list of supported template (this is called prior to RegisterdotXSINativeTemplates).

See also:
RegisterdotXSINativeTemplates

SI_Error CXSIParser::Close  
 

Closes the file

CdotXSITemplates* CXSIParser::dotXSISupported   [inline]
 

Returns the template collection supported for the current version

Returns:
CdotXSITemplates* collection

CdotXSITemplates* CXSIParser::dotXSITemplate   [inline]
 

Returns the template collection of the Parser (only the toplevel ones).

Returns:
CdotXSITemplates* collection

SI_Bool CXSIParser::EndOfFile  
 

Checks whether we are at the end of file

CSIBCString& CXSIParser::FileName   [inline]
 

Returns the current file name

Returns:
CSIBCString Filename

SI_Int CXSIParser::FTK_Close  
 

Closes the filter

SI_Int CXSIParser::FTK_Eof  
 

Function to return whether we are at the end of file.

Returns:
1 for eof, 0 otherwise

SI_Int CXSIParser::FTK_FGetc  
 

Returns the next byte.

SI_Int CXSIParser::FTK_Getc  
 

Returns the next byte.

SI_Int CXSIParser::FTK_Open SI_Char *    in_szName,
_SI_FILE_MODE    in_Mode
 

Opens the file for filter for reading or writing

Parameters:
in_szName  Filename
in_Mode  Open Mode

SI_Int CXSIParser::FTK_Printf SI_Char *    in_szData
 

Prints an already formatted string as output.

SI_Long CXSIParser::FTK_Read void *    out_pBuffer,
SI_Long    size,
SI_Long    count
 

Reads from the Filter

Parameters:
out_pBuffer  Buffer to receive the read data
size  number of bytes to read per object
count  size of eash object

SI_Int CXSIParser::FTK_Seek SI_Long    in_lCount,
SI_Int    in_iMode
 

Seeks to a given position

Parameters:
in_lCount  Number of bytes to seek
in_iMode  How to move (relative to start, relative to end, relative to current)

SI_Long CXSIParser::FTK_Tell  
 

Returns the current position

SI_Void CXSIParser::FTK_Warning SI_Char *    in_szWarning,
SI_Int    in_iWarningLevel
 

Outputs a warning to the callback (or default if not set).

Parameters:
in_szWarning  Warning message
in_iWarningLevel  Level (SI_MESSAGE, SI_WARNING, SI_ERROR)

SI_Int CXSIParser::FTK_Write void *    int_pBuffer,
SI_Long    size,
SI_Long    count
 

Writes to the Filter

Parameters:
in_pBuffer  Buffer to write to filter
size  number of bytes to read per object
count  size of eash object

SI_Char * CXSIParser::GetCurrentTokenAsCharPtr  
 

Get the current token as a Char Pointer.

Returns:
SI_Char * current token.

SI_Float CXSIParser::GetCurrentTokenAsFloat  
 

Get the current token as a Float.

Returns:
SI_Float returns current token

SI_Int CXSIParser::GetCurrentTokenAsInteger  
 

Get the current token as a Integer.

Returns:
SI_Int returns current token

SI_Error CXSIParser::GetdotXSIFileVersion SI_Int    in_lIndex,
SI_Long *    out_plVersionMajor,
SI_Long *    out_plVersionMinor
 

Returns the Major & Minor number of a given supported version

Parameters:
SI_Int  Which version number to query
SI_Long  * Major version returned
SI_Long  * Minor version returned.

SI_Long CXSIParser::GetdotXSIFileVersionMajor   [inline]
 

returns the the Major XSI File Version.

Returns:
SI_Long Major version number

SI_Long CXSIParser::GetdotXSIFileVersionMinor   [inline]
 

returns the the Minor XSI File Version.

Returns:
SI_Long Minor version number

SI_Int CXSIParser::GetdotXSIFormat   [inline]
 

Returns the dotXSI file Format.

Returns:
SI_Int (0 text, 1 binary)

CdotXSITemplates * CXSIParser::GetdotXSINativeTemplates  
 

Retrieves the current list of native templates.

SI_Int CXSIParser::GetdotXSINumFileVersion  
 

Returns how many file version is supported

Returns:
SI_Int number of supported version

SI_Int CXSIParser::GetdotXSISystemFlags   [inline]
 

Returns the System Flags

Returns:
SI_Int System flags

SI_Error CXSIParser::GetLastError   [inline]
 

Returns the last error that occurred in the parser.

Returns:
SI_Error The error code indicating the last error that occurred.

SI_Int CXSIParser::GetNbSupportedTemplates  
 

returns the total number of supported templates.

Returns:
SI_Int number

SI_Error CXSIParser::GetNextPairAsFloat SI_Float &    fX,
SI_Float &    fY
 

Gets the next pair as a floating point number

Parameters:
fX  First value
fY  Second value

SI_Error CXSIParser::GetNextPairAsInt SI_Int &    nX,
SI_Int &    nY
 

Gets the next pair as a Integer number

Parameters:
fX  First value
fY  Second value

SI_Char * CXSIParser::GetNextTokenAsCharPtr  
 

returns the next token as a string

Returns:
SI_Char * token

SI_Float CXSIParser::GetNextTokenAsFloat  
 

returns the next token as a float

Returns:
SI_Float token

SI_Int CXSIParser::GetNextTokenAsInteger  
 

returns the next token as an integer

Returns:
SI_Int token

SI_Char * CXSIParser::GetNextTokenAsString  
 

returns the next token and turns it into a null terminated string and removes quotes

Returns:
SI_Char * token

SI_Error CXSIParser::GetNextTokensAsFloatArray SI_Int    numFloats,
SI_Int    fileStepCount,
SI_Int    fileSkipCount,
SI_Int    arrayStepCount,
SI_Int    arraySkipCount,
SI_Float *    i_pArray
 

returns the next tokens into an array of floats

Parameters:
numFloats  number of floats to read
fileStepCount  number of sequential floats to read first
fileSkipCount  number of tokens to skip before reading the next sequence of floats
arrayStepCount  number of sequential floats to write to first
arraySkipCount  number of array indices to skip before writing the next sequence of floats
i_pArray  array of floats to read.
Returns:
SI_Error

SI_Error CXSIParser::GetNextTokensAsIntegerArray SI_Int    numIntegers,
SI_Int    fileStepCount,
SI_Int    fileSkipCount,
SI_Int    arrayStepCount,
SI_Int    arraySkipCount,
SI_Int *    i_pArray
 

returns the next tokens into an array of Ints

Parameters:
numFloats  number of ints to read
fileStepCount  number of sequential ints to read first
fileSkipCount  number of tokens to skip before reading the next sequence of ints
arrayStepCount  number of sequential ints to write to first
arraySkipCount  number of array indices to skip before writing the next sequence of ints
i_pArray  array of ints to read.
Returns:
SI_Error

SI_Error CXSIParser::GetNextTokensAsUnsignedShortArray SI_Int    numIntegers,
SI_Int    fileStepCount,
SI_Int    fileSkipCount,
SI_Int    arrayStepCount,
SI_Int    arraySkipCount,
SI_UShort *    i_pArray
 

returns the next tokens into an array of Unsigned Shorts

Parameters:
numFloats  number of Unsigned Shorts to read
fileStepCount  number of sequential Unsigned Shorts to read first
fileSkipCount  number of tokens to skip before reading the next sequence of Unsigned Shorts
arrayStepCount  number of sequential Unsigned Shorts to write to first
arraySkipCount  number of array indices to skip before writing the next sequence of Unsigned Shorts
i_pArray  array of Unsigned Shorts to read.
Returns:
SI_Error

SI_Error CXSIParser::GetNextTrippletAsFloat SI_Float &    fX,
SI_Float &    fY,
SI_Float &    fZ
 

Gets the next tripplet as a floating point number.

Parameters:
fX  First value
fY  Second value
fZ  Third value

SI_Error CXSIParser::GetNextTrippletAsInt SI_Int &    nX,
SI_Int &    nY,
SI_Int &    nZ
 

Gets the next tripplet as a Integer number.

Parameters:
fX  First value
fY  Second value
fZ  Third value

SI_Int CXSIParser::GetOpenMode   [inline]
 

Returns the Input Mode

Returns:
The current input mode.

SI_READ_CALLBACK_FNC CXSIParser::GetReadCallback  
 

Returns the current Read Callback

SI_Int CXSIParser::GetString  
 

Returns a string as read (should not be used)

SI_Char* CXSIParser::GetSupportedTemplate SI_Int    in_lIndex
 

returns the name of a supported template

Returns:
SI_Char * template name

SI_Error CXSIParser::Open const CSIBCString   in_filename
 

Opens a file for either reading or writing

Parameters:
CSIBCString  input file name

SI_Error CXSIParser::Read  
 

Reads the file as it was set in the parser.

SI_Error CXSIParser::ReadFloatArray CdotXSITemplate   i_pNewTemplate,
SI_Int    i_nNbVertices,
SI_Char *    i_sName
 

Reads an array of floats into a named parameter

Parameters:
i_pNewTemplate  template to add the new parameter to
i_nNbVertices  number of floats to read
i_sName  Name of the new argument.
Returns:
SI_Error Error code indicating the success or failure of this command.

    Possible values:
  • SI_SUCCESS - The array was read correctly.
  • SI_ERR_BAD_ELEMENT - There was an error reading the array.

SI_Error CXSIParser::ReadGenericParameters CdotXSITemplate   i_pCurrentTemplate,
CdotXSITemplate   i_pNewTemplate,
SI_Int    i_nNbParam
 

This function is used to read the parameters which are generic (no special cases). Reads the parameters into the new template based on the parameter list from the current template. Generic parameter read. This is used by most of the callbacks because most of the templates have some generic parameters that can be read in batch.

Parameters:
i_pCurrentTemplate  current template
i_pNewTemplate  New template (starts empty)
i_nNbParam  Number of parameters to read.
Returns:
SI_Error Error code indicating the success or failure of this command.

    Possible values:
  • SI_SUCCESS - The parameters were read correctly.
  • SI_ERR_BAD_ELEMENT - There was an error reading a parameter.

SI_Error CXSIParser::ReadIntegerArray CdotXSITemplate   i_pNewTemplate,
SI_Int    i_nNbVertices,
SI_Char *    i_sName
 

Reads an array of integers into a named parameter

Parameters:
i_pNewTemplate  template to add the new parameter to
i_nNbVertices  number of integers to read
i_sName  Name of the new argument.
Returns:
SI_Error Error code indicating the success or failure of this command.

    Possible values:
  • SI_SUCCESS - The array was read correctly.
  • SI_ERR_BAD_ELEMENT - There was an error reading the array.

SI_Error CXSIParser::ReadParameterValue SI_TinyVariant   o_vValue,
SI_Int    i_nLastInt
 

Reads the next value based on the type expected in the Variant

Parameters:
o_vValue  Variant to receive the value based on its type.
i_nLastInt  unused.
Returns:
SI_Error Error code indicating the success or failure of this command.

    Possible values:
  • SI_SUCCESS - The parameter was read correctly.
  • SI_ERR_BAD_ELEMENT - There was an error reading the parameter.

SI_Bool CXSIParser::ReadTemplate CSIBCString   i_sTemplateName,
CdotXSITemplate   i_pParent
 

Recursive function to read the templates.

Parameters:
CSIBCString  * name of template.
CdotXSITemplate  * Parent template.

SI_Void CXSIParser::RegisterdotXSINativeTemplates SI_Long    in_iMajor,
SI_Long    in_iMinor
 

Registers the supported templates for a given version

Parameters:
i_lMajor  Major version requested
i_lMinor  Minor version requested

SI_Int CXSIParser::SetdotXSIFileVersion SI_Int    in_iMajor,
SI_Int    in_iMinor
 

Sets the file version

Parameters:
SI_Int  Major version
SI_Int  Minor version

SI_Void CXSIParser::SetdotXSIFormat SI_Int    dotXSIFormat [inline]
 

Sets the dotXSI file Format.

Parameters:
Sets  the format (0 - text, 1 - binary).

SI_Void CXSIParser::SetdotXSISystemFlags SI_Int    dotXSISystemFlags [inline]
 

Sets the System flags

Parameters:
SI_Int  The system flags.

SI_Void CXSIParser::SetOpenMode SI_Int    i_nMode
 

Sets the Open Mode

Parameters:
i_nMode  Mode

SI_Void CXSIParser::SetReadCallback SI_READ_CALLBACK_FNC    in_pCallback
 

Initializes the Read callback with a user defined function.

Parameters:
in_pCallback  Callback function to use.

SI_Void CXSIParser::SetWarningCallback SI_WARNING_CALLBACK_FNC    in_pfncCallback
 

Initializes the Warning callback with a user defined function.

Parameters:
in_pfncCallback  Function pointer to receive all warning messages.

SI_Error CXSIParser::Write  
 

Writes the file as specified.

SI_Void CXSIParser::WriteGenericParameters CdotXSITemplate   i_pCurrentTemplate,
SI_Int    i_nNbParams,
SI_Int    i_nLevel
 

Write out the parameters that are generic from a given template

Parameters:
i_pCurrentTemplate  Template to write from
i_nNbParams  Number of parameters to output
i_nLevel  Current level (for indentation).

SI_Void CXSIParser::WriteParameterValue SI_TinyVariant   i_vValue,
SI_Int    i_nLevel,
SI_Int    in_nFlag = 0
 

Generic parameter write. This is used by most of the callbacks because most of the templates have some generic parameters that can be written in batch.

Parameters:
i_vValue  Variant holding the value to output
i_nLevel  Current level for indentation
in_nFlag  Unused

SI_Void CXSIParser::WriteTabs SI_Int    i_nLevel
 

Indent the output by so many levels. This is per line of output.

Parameters:
i_nLevel  Number of levels to indent.

SI_Void CXSIParser::WriteTemplate CdotXSITemplates   dotXSITemplates,
SI_Int    i_nInd,
SI_Int    i_nLevel
 

Recursive function to write out the templates

Parameters:
CdotXSITemplates  * Parent template collection
SI_Int  Index of the children (which children in the collection we are exporting)
SI_Int  Indentation (how much to indent to keep the look indented as we nest down).


The documentation for this class was generated from the following files: © Copyright 2001-2003 Avid Technology, Inc. All rights reserved.

© Copyright 2001-2003 Avid Technology, Inc. All rights reserved.