Go to the documentation of this file.00001 #include "robot_instance/ApiMap.h"
00002
00003 std::string ApiMap::getXmlElementNode(TiXmlHandle baseHandle, const std::string& name)
00004 {
00005 if (baseHandle.FirstChildElement(name).ToElement())
00006 {
00007 return std::string(baseHandle.FirstChildElement(name).ToElement()->Attribute("node"));
00008 }
00009 else
00010 {
00011 std::stringstream err;
00012 err << "The ApiMap file has no element named [" << name << "]";
00013 NasaCommonLogging::Logger::log("gov.nasa.configuration.ApiMap", log4cpp::Priority::ERROR, err.str());
00014 throw std::runtime_error(err.str());
00015 }
00016
00017 return std::string();
00018 };
00019
00020 std::string ApiMap::getXmlElementValue(TiXmlHandle baseHandle, const std::string& name)
00021 {
00022 if (baseHandle.FirstChildElement(name).ToElement())
00023 {
00024 return std::string(baseHandle.FirstChildElement(name).ToElement()->Attribute("value"));
00025 }
00026 else
00027 {
00028 std::stringstream err;
00029 err << "The ApiMap file has no element named [" << name << "]";
00030 NasaCommonLogging::Logger::log("gov.nasa.configuration.ApiMap", log4cpp::Priority::ERROR, err.str());
00031 throw std::runtime_error(err.str());
00032 }
00033
00034 return std::string();
00035 };