xml::XMLFormation Class Reference
[XML Tools]

XML parser/writer tailored for team formation document files. More...

#include <xml_formation.hh>

Inheritance diagram for xml::XMLFormation:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 XMLFormation (const std::string &schema_path)
bool switchFormationId (int formation_id)
 Switch to a specific formation id.
bool hasCoord (int player_id)
 Test the presence of row and col indication for a player.
Coordinates getCoord (int player_id)
 Retrieve row and col for a player in current formation.
virtual void parse (const std::string &filename)
 Parse an xml file.

Protected Member Functions

virtual const char * getExpectedRoot () const
 Root node name we expect when loading the document.
virtual void initXMLInternal ()
 Initialize XML internals before parsing a document.

Protected Attributes

int formation_id_
std::string schema_path_

Detailed Description

XML parser/writer tailored for team formation document files.

Todo:
Explain the basic document structure.

Member Function Documentation

Coordinates xml::XMLFormation::getCoord ( int  player_id  ) 

Retrieve row and col for a player in current formation.

Methods in XML aren't very useful here... :/

Exceptions:
XMLError player_id not found

References Coordinates::col, and Coordinates::row.

Referenced by CTeam::placeTeam().

bool xml::XMLFormation::hasCoord ( int  player_id  ) 

Test the presence of row and col indication for a player.

Returns:
false if document doesn't contain a line for requested id.

Referenced by CTeam::placeTeam().

void xml::XMLFormation::parse ( const std::string &  filename  )  [virtual]

Parse an xml file.

Parameters:
filename File to parse.
Exceptions:
XMLError Thrown on any kind of error.

Reimplemented from xml::XML.

Referenced by CTeam::loadConfig().


The documentation for this class was generated from the following files:
Generated on Mon Apr 5 21:18:07 2010 for Stechec/TBT by  doxygen 1.6.3