xml_formation.hh
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef XML_FORMATION_HH_
00018 # define XML_FORMATION_HH_
00019
00020 # include <xercesc/sax/EntityResolver.hpp>
00021 # include "xml/xml.hh"
00022
00023 BEGIN_NS(xml);
00024
00032 class XMLFormation : public XML
00033 {
00034 public:
00035 XMLFormation(const std::string& schema_path);
00036
00038 bool switchFormationId(int formation_id);
00039
00042 bool hasCoord(int player_id);
00046 Coordinates getCoord(int player_id);
00047
00048 virtual void parse(const std::string& filename);
00049
00050 protected:
00051 virtual const char* getExpectedRoot() const;
00052 virtual void initXMLInternal();
00053
00054 int formation_id_;
00055 std::string schema_path_;
00056 };
00057
00058
00059 class XMLFormationEntityResolver : public xercesc::EntityResolver
00060 {
00061 public:
00062 XMLFormationEntityResolver(const std::string& schema_path);
00063 xercesc::InputSource* resolveEntity(const XMLCh* const, const XMLCh* const);
00064
00065 private:
00066 std::string schema_path_;
00067 };
00068
00069
00070
00071 END_NS(xml);
00072
00073 #endif