mirror of
https://github.com/XRPLF/rippled.git
synced 2026-06-02 16:26:48 +00:00
adds extract string support for wscmd
This commit is contained in:
@@ -68,3 +68,11 @@ wscmd::cmd wscmd::parse(const std::string& m) {
|
||||
return command;
|
||||
}
|
||||
|
||||
bool wscmd::extract_string(wscmd::cmd command,const std::string& key,std::string& val) {
|
||||
if (command.args[key] != "") {
|
||||
val = command.args[key];
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -60,7 +60,7 @@ namespace wscmd {
|
||||
wscmd::cmd parse(const std::string& m);
|
||||
|
||||
template <typename T>
|
||||
bool extract_number(wscmd::cmd command,std::string key,T& val) {
|
||||
bool extract_number(wscmd::cmd command,const std::string& key,T& val) {
|
||||
if (command.args[key] != "") {
|
||||
std::istringstream buf(command.args[key]);
|
||||
|
||||
@@ -70,6 +70,8 @@ namespace wscmd {
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool extract_string(wscmd::cmd command,const std::string& key,std::string& val);
|
||||
} // namespace wscmd
|
||||
|
||||
#endif // WSCMD_HPP
|
||||
|
||||
Reference in New Issue
Block a user