00001
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027 #ifndef _xmlReader_h
00028 #define _xmlReader_h
00029
00030 #include "BSUtilitiesError.h"
00031
00032 #include <tinyxml/tinyxml.h>
00033
00034 #include <string>
00035
00036 namespace BSUtilities {
00038 namespace xmlr {
00039
00041
00044 class XmlReadError : public BSUtilitiesError
00045 {
00046 private:
00048 static const std::string XMLREADERROR;
00049
00050 public:
00052
00054 XmlReadError (void) : BSUtilitiesError (XMLREADERROR) {}
00055
00057
00059 XmlReadError (const std::string message)
00060 : BSUtilitiesError (message) {}
00061 };
00062
00063 TiXmlHandle xmlInit (const std::string &filename);
00064
00065 void xmlFinish (TiXmlHandle &element);
00066
00068
00072 template<class X>
00073 void xmlLoad (const std::string &filename, X &obj)
00074 {
00075 TiXmlHandle root = xmlInit (filename);
00076 obj.load (root);
00077 xmlFinish (root);
00078 }
00079
00080
00081 }
00082 }
00083 #endif