diff --git a/examples/wsperf/wscmd.cpp b/examples/wsperf/wscmd.cpp index 3a26e95266..253940af25 100644 --- a/examples/wsperf/wscmd.cpp +++ b/examples/wsperf/wscmd.cpp @@ -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; + } +} diff --git a/examples/wsperf/wscmd.hpp b/examples/wsperf/wscmd.hpp index 6b720ae69c..5ed3bf4030 100644 --- a/examples/wsperf/wscmd.hpp +++ b/examples/wsperf/wscmd.hpp @@ -60,7 +60,7 @@ namespace wscmd { wscmd::cmd parse(const std::string& m); template - 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