SdlWalker

Assists in walking an SDL tree which supports the StAX method of parsing.

Constructors

this
this(Tag* tag, char[] sdl)
Undocumented in source.

Members

Functions

childrenDepth
size_t childrenDepth()
Undocumented in source. Be warned that the author may not have intended to support it.
pop
bool pop(size_t depth, bool allowSkipChildren)

Parses the next tag at the given depth.

Variables

tag
Tag* tag;

A pointer to the tag structure that will be populated after parsing every tag.

tagAlreadyPopped
bool tagAlreadyPopped;
Undocumented in source.

Examples

Tag tag;
SdlWalker walker = SdlWalker(&tag, sdl);
while(walker.pop()) {
    // use tag to process the current tag

    auto depth = tag.childrenDepth();
    while(walker.pop(depth)) {
        // process tag again as a child tag
    }

}

Meta