Kitlist
A list manager for maintaining kit lists
Loading...
Searching...
No Matches
KitParser Class Reference

Loads a kitlist from the file system. More...

#include "kitparser.hpp"

Classes

class  parse_exception
 XML parsing error. More...

Public Member Functions

 KitParser (const std::string filename)
 Defautl constructor.
std::unique_ptr< Modelparse ()
 Parses the XML, building the data Model.

Private Member Functions

void parse_items (const pugi::xml_node &node)
 Parses the items XML node.
void parse_categories (const pugi::xml_node &node)
 Parses the categories XML node.

Private Attributes

std::string filename
 The filename to be parsed.
std::unique_ptr< Modelmodel
 The Model representing the parsed file.

Detailed Description

Loads a kitlist from the file system.

The file is an XML structured file described by kitlist.dtd which is included in the source distribution tarball.

Definition at line 43 of file kitparser.hpp.

Constructor & Destructor Documentation

◆ KitParser()

KitParser::KitParser ( const std::string filename)
inline

Defautl constructor.

Definition at line 68 of file kitparser.hpp.

Member Function Documentation

◆ parse()

unique_ptr< Model > KitParser::parse ( )

Parses the XML, building the data Model.

Returns
A unique_ptr to the Model.
Exceptions
parse_exception.

Definition at line 75 of file kitparser.cpp.

◆ parse_categories()

void KitParser::parse_categories ( const pugi::xml_node & node)
private

Parses the categories XML node.

Parameters
nodethe XML node containing a list of categories.

Definition at line 46 of file kitparser.cpp.

◆ parse_items()

void KitParser::parse_items ( const pugi::xml_node & node)
private

Parses the items XML node.

Parameters
nodethe XML node containing a list of items.

Definition at line 30 of file kitparser.cpp.

Member Data Documentation

◆ filename

std::string KitParser::filename
private

The filename to be parsed.

Definition at line 46 of file kitparser.hpp.

◆ model

std::unique_ptr<Model> KitParser::model
private

The Model representing the parsed file.

Definition at line 49 of file kitparser.hpp.


The documentation for this class was generated from the following files:
Copyright 2008-2025 Frank Dean