dictconvert.cpp File Reference

Convert an XML dictionary file to compile-time definitions. More...

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

Classes

struct  ConvertState
 State structure for XML parsing. More...

Typedefs

typedef SmartPtr< ULData > ULDataPtr
typedef std::map< std::string,
ULDataPtr
ULDataMap
typedef std::list< ULDataPtrULDataList

Enumerations

enum  CurrentState {
  StateIdle = 0, StateTypes, StateTypesBasic, StateTypesInterpretation,
  StateTypesMultiple, StateTypesCompound, StateTypesCompoundItem, StateTypesEnum,
  StateTypesEnumValue, StateTypesLabel, StateClasses, StateDone,
  StateError
}
 State-machine state for XML parsing. More...

Functions

void Convert_startElement (void *user_data, const char *name, const char **attrs)
 XML callback - Deal with start tag of an element.
void Convert_endElement (void *user_data, const char *name)
 XML callback - Deal with end tag of an element.
void Convert_warning (void *user_data, const char *msg,...)
 XML callback - Handle warnings during XML parsing.
void Convert_error (void *user_data, const char *msg,...)
 XML callback - Handle errors during XML parsing.
void Convert_fatalError (void *user_data, const char *msg,...)
 XML callback - Handle fatal errors during XML parsing.
int main_process (int argc, char *argv[])
 Do the main processing (less any pause before exit).
int main (int argc, char *argv[])
 Do the main processing and pause if required.
void AddType (ConvertState *State, std::string Name, std::string Detail, std::string TypeUL)
 Add a ULData item for a type.
std::string CConvert (const char *str)
 Convert a C-string to a C-source-code string (escape the quotes).
void warning (const char *Fmt,...)
 Display a warning message.
void error (const char *Fmt,...)
 Display an error message.

Variables

static bool DebugMode = false
 MXFLib debug flag.
bool PauseBeforeExit = false
 Should we pause before exit?
std::string UseName = "DictData"
 Name of the structure to build.
int TypesCount = 0
 The number of (new style) types sections found.
int ClassesCount = 0
 The number of (new style) classes sections found.
char * InputFile = ""
 Name of the file to be converted.
bool ULConsts = true
 Should we output UL consts?
bool OnlyConsts = false
 Should we only output UL consts?
bool LongFormConsts = false
 Should UL consts always be long-form?
std::string ULNamespace = "mxflib"
 Namespace for defining UL constants.
ULDataMap ULMap
ULDataList ULFixupList


Detailed Description

Convert an XML dictionary file to compile-time definitions.

Version:
Id
dictconvert.cpp,v 1.10 2007/03/31 14:23:00 matt-beard Exp

Typedef Documentation

typedef std::list<ULDataPtr> ULDataList [static]

typedef std::map<std::string, ULDataPtr> ULDataMap [static]

typedef SmartPtr<ULData> ULDataPtr [static]


Enumeration Type Documentation

enum CurrentState

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 values within an enumeration.
StateTypesLabel  Processing lablels, possibly inside a types section.
StateClasses  Processing classes.
StateDone  Finished processing.
StateError  Error encountered - process nothing else.


Function Documentation

void AddType ( ConvertState State,
std::string  Name,
std::string  Detail,
std::string  TypeUL 
)

Add a ULData item for a type.

std::string CConvert ( const char *  str  ) 

Convert a C-string to a C-source-code string (escape the quotes).

void Convert_endElement ( void *  user_data,
const char *  name 
)

XML callback - Deal with end tag of an element.

void Convert_error ( void *  user_data,
const char *  msg,
  ... 
)

XML callback - Handle errors during XML parsing.

void Convert_fatalError ( void *  user_data,
const char *  msg,
  ... 
)

XML callback - Handle fatal errors during XML parsing.

void Convert_startElement ( void *  user_data,
const char *  name,
const char **  attrs 
)

XML callback - Deal with start tag of an element.

void Convert_warning ( void *  user_data,
const char *  msg,
  ... 
)

XML callback - Handle warnings during XML parsing.

int main ( int  argc,
char *  argv[] 
)

Do the main processing and pause if required.

int main_process ( int  argc,
char *  argv[] 
)

Do the main processing (less any pause before exit).

printf(", Keyframe is at 0x%s", Int64toHexString(Pos->KeyLocation,8).c_str() );


Variable Documentation

int ClassesCount = 0

The number of (new style) classes sections found.

bool DebugMode = false [static]

MXFLib debug flag.

std::string Detail

char* InputFile = ""

Name of the file to be converted.

bool IsMulti

bool IsPack

bool IsSet

bool IsType

Tag LocalTag

bool LongFormConsts = false

Should UL consts always be long-form?

std::string Name

bool OnlyConsts = false

Should we only output UL consts?

ULDataPtr Parent

bool PauseBeforeExit = false

Should we pause before exit?

int TypesCount = 0

The number of (new style) types sections found.

ULPtr UL

bool ULConsts = true

Should we output UL consts?

ULDataList ULFixupList [static]

ULDataMap ULMap [static]

std::string ULNamespace = "mxflib"

Namespace for defining UL constants.

std::string UseName = "DictData"

Name of the structure to build.


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