Commit 60d0264f authored by kraus's avatar kraus

Merge branch '493-template-directory-not-found-when-path-contains-spaces' into 'master'

Resolve "Template directory not found when path contains spaces"

Closes #493

See merge request !310
parents c19e7144 3c12dbba
...@@ -153,19 +153,33 @@ private: ...@@ -153,19 +153,33 @@ private:
/// tries to retrieve command line parameter. /// tries to retrieve command line parameter.
/// @throws OptPilotException if parameter was not found. /// @throws OptPilotException if parameter was not found.
template<class T> template<class T>
T arg(const std::string name) { T arg(const std::string name);
T t;
std::map<std::string, std::string>::iterator it = arguments_.find(name);
if(it != arguments_.end()) {
std::istringstream iss(arguments_[name]);
iss >> t;
return t;
} else {
throw OptPilotException("CmdArguments::getArg", "argument not found!");
}
}
}; };
typedef boost::shared_ptr<CmdArguments> CmdArguments_t; typedef boost::shared_ptr<CmdArguments> CmdArguments_t;
template<class T>
inline T CmdArguments::arg(const std::string name) {
T t;
std::map<std::string, std::string>::iterator it = arguments_.find(name);
if(it != arguments_.end()) {
std::istringstream iss(arguments_[name]);
iss >> t;
return t;
} else {
throw OptPilotException("CmdArguments::getArg", "argument not found!");
}
}
template<>
inline std::string CmdArguments::arg<std::string>(const std::string name) {
std::map<std::string, std::string>::iterator it = arguments_.find(name);
if(it != arguments_.end()) {
return arguments_[name];
} else {
throw OptPilotException("CmdArguments::getArg", "argument not found!");
}
}
#endif #endif
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment