Commit ce4666cf authored by kraus's avatar kraus
Browse files

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

(cherry picked from commit 60d0264f)

3c12dbba handle string arguments separately
parent 0ee8863f
......@@ -153,19 +153,33 @@ private:
/// tries to retrieve command line parameter.
/// @throws OptPilotException if parameter was not found.
template<class T>
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!");
}
}
T arg(const std::string name);
};
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
\ 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