|
INET Framework for OMNeT++/OMNEST
|
00001 // 00002 // Marek Cerny, 2MSK 00003 // FIT VUT 2011 00004 // 00005 // This program is free software: you can redistribute it and/or modify 00006 // it under the terms of the GNU Lesser General Public License as published by 00007 // the Free Software Foundation, either version 3 of the License, or 00008 // (at your option) any later version. 00009 // 00010 // This program is distributed in the hope that it will be useful, 00011 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00013 // GNU Lesser General Public License for more details. 00014 // 00015 // You should have received a copy of the GNU Lesser General Public License 00016 // along with this program. If not, see http://www.gnu.org/licenses/. 00017 // 00018 00019 #ifndef XMLPARSER_H_ 00020 #define XMLPARSER_H_ 00021 00022 #include <omnetpp.h> 00023 00024 using namespace std; 00025 00026 /* 00027 * Set of static methods that can be used by multiple modules for unified 00028 * access to various pars of the configuration XML file. 00029 * 00030 * The idea is to provide tools that will take care about tag parsing while 00031 * the calling module can focus on extracting actual aplication-specific data. 00032 */ 00033 class xmlParser { 00034 public: 00035 static cXMLElement * GetDevice(const char *deviceType, const char *deviceId, const char *configFile); 00036 static cXMLElement * GetInterface(cXMLElement *iface, cXMLElement *device); 00037 static cXMLElement * GetStaticRoute6(cXMLElement *route, cXMLElement *device); 00038 static cXMLElement * GetOspfProcess6(cXMLElement *process, cXMLElement *device); 00039 static cXMLElement * GetIPv6Address(cXMLElement *addr, cXMLElement *iface); 00040 static cXMLElement * GetAdvPrefix(cXMLElement *prefix, cXMLElement *iface); 00041 static cXMLElement * GetIsisRouting(cXMLElement * device); 00042 static bool Str2Int(int *retValue, const char *str); 00043 static bool Str2Bool(bool *ret, const char *str); 00044 }; 00045 00046 #endif /* XMLPARSER_H_ */