CMMLParser.cpp File Reference

#include <libCMMLParse/CMMLParser.h>
#include <libCMMLParse/xtag.h>
#include <libCMMLTags/libCMMLTags.h>
#include <libilliCore/StringHelper.h>
#include <fstream>

Include dependency graph for CMMLParser.cpp:

Include dependency graph

Go to the source code of this file.

Defines

#define XTAG_PARSE_INTO(tagParser, parseMethod, TagType, parentTagSetter, parentTag)
#define XTAG_SET_ATTRIBUTE(tagParser, attributeName, tag, attributeSetter)
#define XTAG_REQUIRED_ATTRIBUTE(tagParser, attributeName, tag)
#define XTAG_PARSE_CHILD(parentParser, tagName, tagParser, tagType, setterMethod, parentTag)
#define XTAG_EXACTLY_ONE_CHILD(parentParser, tagName)
#define XTAG_PARSE_LIST(TagType, listTagName, tagParser, parentParser, parentTag, parentGetListMethod)
#define XTAG_SET_CDATA(tagParser, tag)


Define Documentation

#define XTAG_EXACTLY_ONE_CHILD parentParser,
tagName   ) 
 

Value:

{ \
                XTag *locParser = xtag_first_child(parentParser, tagName); \
                if (locParser != NULL) { \
                        /* Found at least one child */ \
                        locParser = xtag_next_child(parentParser, tagName); \
                        if (locParser) { \
                                /* Danger will robinson, found more than one child */ \
                                return false; \
                        } \
                } else { \
                        /* Found no child */ \
                        return false; \
                } \
        };

Definition at line 266 of file CMMLParser.cpp.

Referenced by CMMLParser::parseHeadTag(), and CMMLParser::parseRootTag().

#define XTAG_PARSE_CHILD parentParser,
tagName,
tagParser,
tagType,
setterMethod,
parentTag   ) 
 

Value:

{ \
                XTag *locParser = NULL; \
                locParser = xtag_first_child(parentParser, tagName); \
                if (locParser) { \
                        XTAG_PARSE_INTO(locParser, tagParser, tagType, setterMethod, parentTag); \
                } \
        };

Definition at line 257 of file CMMLParser.cpp.

Referenced by CMMLParser::parseClipTag(), CMMLParser::parseHeadTag(), and CMMLParser::parseRootTag().

#define XTAG_PARSE_INTO tagParser,
parseMethod,
TagType,
parentTagSetter,
parentTag   ) 
 

Value:

{ \
                TagType *locTag = new TagType; \
                if (!parseMethod(tagParser, locTag)) { \
                        return false; \
                } \
                parentTag->parentTagSetter(locTag); \
        };

Definition at line 229 of file CMMLParser.cpp.

#define XTAG_PARSE_LIST TagType,
listTagName,
tagParser,
parentParser,
parentTag,
parentGetListMethod   ) 
 

Value:

{ \
                XTag *locTagListParser = NULL; \
                for (   locTagListParser = xtag_first_child(parentParser, listTagName); \
                                locTagListParser != NULL; \
                                locTagListParser = xtag_next_child(parentParser, listTagName)) { \
                        XTAG_PARSE_INTO(locTagListParser, tagParser, TagType, addTag, parentTag->parentGetListMethod()); \
                } \
        };

Definition at line 282 of file CMMLParser.cpp.

Referenced by CMMLParser::parseClipTag(), CMMLParser::parseHeadTag(), CMMLParser::parseImportTag(), CMMLParser::parseRootTag(), and CMMLParser::parseStreamTag().

#define XTAG_REQUIRED_ATTRIBUTE tagParser,
attributeName,
tag   ) 
 

Value:

{ \
                const char *locAttributeCString = xtag_get_attribute(tagParser, attributeName); \
                if (!locAttributeCString) { \
                        return false; \
                } else { \
                        /* free((void *) locAttributeCString); */ \
                } \
        };

Definition at line 247 of file CMMLParser.cpp.

Referenced by CMMLParser::parseAnchorTag(), CMMLParser::parseBaseTag(), CMMLParser::parseClipTag(), CMMLParser::parseImageTag(), and CMMLParser::parseParamTag().

#define XTAG_SET_ATTRIBUTE tagParser,
attributeName,
tag,
attributeSetter   ) 
 

Value:

{ \
                const char *locAttributeCString = xtag_get_attribute(tagParser, attributeName); \
                if (locAttributeCString) { \
                        tag->attributeSetter(StringHelper::toWStr(locAttributeCString)); \
                        /* free((void *) locAttributeCString); */ \
                } \
        };

Definition at line 238 of file CMMLParser.cpp.

Referenced by CMMLParser::parseAnchorTag(), CMMLParser::parseBaseTag(), CMMLParser::parseClipTag(), CMMLParser::parseDescTag(), CMMLParser::parseHeadTag(), CMMLParser::parseImageTag(), CMMLParser::parseImportTag(), CMMLParser::parseMetaTag(), CMMLParser::parseParamTag(), CMMLParser::parseRootTag(), CMMLParser::parseStreamTag(), and CMMLParser::parseTitleTag().

#define XTAG_SET_CDATA tagParser,
tag   ) 
 

Value:

{ \
                const char *locCData = xtag_get_pcdata(tagParser); \
                if (locCData) { \
                        tag->setText(StringHelper::toWStr(locCData)); \
                        /* free((void *) locCData); */ \
                } \
        };

Definition at line 292 of file CMMLParser.cpp.

Referenced by CMMLParser::parseAnchorTag(), CMMLParser::parseDescTag(), and CMMLParser::parseTitleTag().


Generated on Tue Feb 15 14:55:56 2005 for oggdsf by  doxygen 1.3.9