deftypes.cpp File Reference

Dictionary processing. More...

#include "mxflib/mxflib.h"
#include <stdarg.h>

Namespaces

namespace  mxflib

Typedefs

typedef ConstClassRecord const * ConstClassRecordPTR

Enumerations

enum  TypesCurrentState {
  StateIdle = 0, StateTypes, StateTypesBasic, StateTypesInterpretation,
  StateTypesMultiple, StateTypesCompound, StateTypesCompoundItem, StateTypesEnum,
  StateTypesEnumValue, StateTypesLabel, StateDone
}
 State-machine state for XML parsing. More...
enum  DictCurrentState {
  DictStateIdle = 0, DictStateDictionary, DictStateTypes, DictStateClasses,
  DictStateError
}
 State-machine state for XML parsing. More...

Functions

void DefTypes_startElement (void *user_data, const char *name, const char **attrs)
 XML parsing functions for defining types.
void DefTypes_endElement (void *user_data, const char *name)
void DictLoad_startElement (void *user_data, const char *name, const char **attrs)
 XML parsing functions for dictionary loading.
void DictLoad_endElement (void *user_data, const char *name)
bool ProcessClassElement (void *user_data, const char *name, const char **attrs)
 Process an XML element that has been determined to be part of a class definition.
void XML_warning (void *user_data, const char *msg,...)
 XML callback - Handle warnings during XML parsing.
void XML_error (void *user_data, const char *msg,...)
 XML callback - Handle errors during XML parsing.
void XML_fatalError (void *user_data, const char *msg,...)
 XML callback - Handle fatal errors during XML parsing.
bool DisableBuiltInTraits (void)
 Disable automatic loading of built-in traits.
void DefineTraits (void)
 Build the map of all known traits.
int ReadHexStringOrUL (const char *Source, int Max, UInt8 *Dest, const char *Sep)
 Read hex values separated by any of 'Sep', if it is a urn read any of the supported formats via StringToUL.
int LoadTypes (char *TypesFile, SymbolSpacePtr DefaultSymbolSpace)
 Load types from the specified XML definitions.
int LoadTypes (const ConstTypeRecord *TypesData, SymbolSpacePtr DefaultSymbolSpace)
 Load types from the specified in-memory definitions.
int LoadTypes (TypeRecordList &TypesData, SymbolSpacePtr DefaultSymbolSpace)
 Load types from the specified in-memory definitions.
void DefTypes_startElement (void *user_data, const char *name, const char **attrs)
 XML callback - Deal with start tag of an element.
void DefTypes_endElement (void *user_data, const char *name)
 XML callback - Deal with end tag of an element.
int LoadClasses (ClassRecordList &ClassesData, SymbolSpacePtr DefaultSymbolSpace)
 Load classes from the specified in-memory definitions.
ClassRecordPtr LoadClassesSub (ConstClassRecordPTR &ClassData, SymbolSpacePtr DefaultSymbolSpace)
 File local function to build class list from the specified in-memory definitions.
int LoadClasses (const ConstClassRecord *ClassData, SymbolSpacePtr DefaultSymbolSpace)
 Load classeses from the specified in-memory definitions.
int LoadDictionary (DictionaryPtr &DictionaryData, SymbolSpacePtr DefaultSymbolSpace, bool FastFail)
 Load dictionary from the specified in-memory definitions with a default symbol space.
int LoadDictionary (const ConstDictionaryRecord *DictionaryData, SymbolSpacePtr DefaultSymbolSpace, bool FastFail)
 Load dictionary from the specified in-memory definitions with a default symbol space.
int LoadDictionary (const char *DictFile, SymbolSpacePtr DefaultSymbolSpace, bool FastFail)
 Load dictionary from the specified XML definitions with a default symbol space.
void DictLoad_startElement (void *user_data, const char *name, const char **attrs)
 XML callback - Deal with start tag of an element.
bool ProcessClassElement (void *user_data, const char *name, const char **attrs)
 Process an XML element that has been determined to be part of a class definition.
void DictLoad_endElement (void *user_data, const char *name)
 XML callback - Deal with end tag of an element.

Variables

bool LoadBuiltInTraits = true
 Set when built-in traits need to be loaded.
XMLParserHandler DefTypes_XMLHandler
 Our XML handler.
static bool BasicClassesDefined = false
 Set true once the basic required classes have been loaded.
static XMLParserHandler DictLoad_XMLHandler
 Our XML handler.
static UInt8 BitCount [256]


Detailed Description

Dictionary processing.

Version:
Id
deftypes.cpp,v 1.24 2007/03/31 14:23:29 matt-beard Exp

Typedef Documentation

typedef ConstClassRecord const* ConstClassRecordPTR [static]


Enumeration Type Documentation

enum DictCurrentState

State-machine state for XML parsing.

Enumerator:
DictStateIdle  Processing not yet started.
DictStateDictionary  Within the outer tags.
DictStateTypes  Found a types section.
DictStateClasses  Found a classes section.
DictStateError  A fatal error occurred.

enum TypesCurrentState

State-machine state for XML parsing.

Enumerator:
StateIdle  Processing not yet started.
StateTypes  Processing types - not yet processing a types section.
StateTypesBasic  Processing basic types section.
StateTypesInterpretation  Processing interpretation types section.
StateTypesMultiple  Processing multiple types section.
StateTypesCompound  Processing compound types section.
StateTypesCompoundItem  Processing sub-items within a compound.
StateTypesEnum  Processing enumerated types section.
StateTypesEnumValue  Processing valuess within an enumeration.
StateTypesLabel  Processing labels types section.
StateDone  Finished processing.


Function Documentation

void @15::DefineTraits ( void   )  [static]

Build the map of all known traits.

void @15::DefTypes_endElement ( void *  user_data,
const char *  name 
) [static]

XML callback - Deal with end tag of an element.

void @15::DefTypes_endElement ( void *  user_data,
const char *  name 
) [static]

void @15::DefTypes_startElement ( void *  user_data,
const char *  name,
const char **  attrs 
) [static]

XML callback - Deal with start tag of an element.

void @15::DefTypes_startElement ( void *  user_data,
const char *  name,
const char **  attrs 
) [static]

XML parsing functions for defining types.

void @15::DictLoad_endElement ( void *  user_data,
const char *  name 
) [static]

XML callback - Deal with end tag of an element.

void @15::DictLoad_endElement ( void *  user_data,
const char *  name 
) [static]

void @15::DictLoad_startElement ( void *  user_data,
const char *  name,
const char **  attrs 
) [static]

XML callback - Deal with start tag of an element.

void @15::DictLoad_startElement ( void *  user_data,
const char *  name,
const char **  attrs 
) [static]

XML parsing functions for dictionary loading.

ClassRecordPtr @15::LoadClassesSub ( ConstClassRecordPTR ClassData,
SymbolSpacePtr  DefaultSymbolSpace 
) [static]

File local function to build class list from the specified in-memory definitions.

This function is called by LoadClasses() and is recursive DRAGONS: ClassData is changed by LoadClassesSub - at return it points to the next peer entry

Note:
There must be enough terminating entries (with Class == TypeNULL) to end any children
Returns:
The root class, or NULL on error

bool @15::ProcessClassElement ( void *  user_data,
const char *  name,
const char **  attrs 
) [static]

Process an XML element that has been determined to be part of a class definition.

Returns:
true if all OK

bool @15::ProcessClassElement ( void *  user_data,
const char *  name,
const char **  attrs 
) [static]

Process an XML element that has been determined to be part of a class definition.

Returns:
true if all OK

int @15::ReadHexStringOrUL ( const char *  Source,
int  Max,
UInt8 Dest,
const char *  Sep 
) [static]

Read hex values separated by any of 'Sep', if it is a urn read any of the supported formats via StringToUL.

Returns:
number of values read

void @15::XML_error ( void *  user_data,
const char *  msg,
  ... 
) [static]

XML callback - Handle errors during XML parsing.

void @15::XML_fatalError ( void *  user_data,
const char *  msg,
  ... 
) [static]

XML callback - Handle fatal errors during XML parsing.

void @15::XML_warning ( void *  user_data,
const char *  msg,
  ... 
) [static]

XML callback - Handle warnings during XML parsing.


Variable Documentation

bool BasicClassesDefined = false [static]

Set true once the basic required classes have been loaded.

UInt8 BitCount[256] [static]

Initial value:

 
    {
        0, 1, 1, 2, 1, 2, 2, 3, 1, 2, 2, 3, 2, 3, 3, 4,
        1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5,
        1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5,
        2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6,
        1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5,
        2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6,
        2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6,
        3, 4, 4, 5, 4, 5, 5, 6, 4, 5, 5, 6, 5, 6, 6, 7,
        1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5,
        2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6,
        2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6,
        3, 4, 4, 5, 4, 5, 5, 6, 4, 5, 5, 6, 5, 6, 6, 7,
        2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6,
        3, 4, 4, 5, 4, 5, 5, 6, 4, 5, 5, 6, 5, 6, 6, 7,
        3, 4, 4, 5, 4, 5, 5, 6, 4, 5, 5, 6, 5, 6, 6, 7,
        4, 5, 5, 6, 5, 6, 6, 7, 5, 6, 6, 7, 6, 7, 7, 8
    }

ClassRecordList ClassesToBuild

Top level classes that need to be built at the end of the parsing.

ClassRecordList ClassList

Class being built at this level (one for each level in the hierarchy).

TypesParserState ClassState

Parser state for types sub-parser.

SymbolSpacePtr DefaultSymbolSpace

Default symbol space to use for all classes (in current MXFClasses section).

SymbolSpacePtr DefaultSymbolSpace

Default symbol space to use for all types (in current MXFTypes section).

XMLParserHandler DefTypes_XMLHandler [static]

Initial value:

Our XML handler.

XMLParserHandler DictLoad_XMLHandler [static]

Initial value:

Our XML handler.

SymbolSpacePtr DictSymbolSpace

Default symbol space to use for all classes (in the whole dictionary).

bool LabelsOnly

True if this is a labels section rather than a full types section.

bool LoadBuiltInTraits = true [static]

Set when built-in traits need to be loaded.

TypeRecordPtr Parent

The current compound or enum being built (or NULL).

DictCurrentState State

Current state of the parser state-machine.

TypesCurrentState State

Current state of the parser state-machine.

TypeRecordList Types

The types being built.


Generated on Mon Apr 2 15:20:54 2007 for MXFLib by  doxygen 1.5.1-p1