Unverified Commit efe54d9e authored by Dennis Jenkins's avatar Dennis Jenkins Committed by GitHub

Merge pull request #202 from JenniferBuehler/add_query_access

Added support to get parameters from Query
parents 2a0d0db0 0c45ff5a
......@@ -9,7 +9,9 @@
#include <type_traits>
#include <stdexcept>
#include <array>
#include <vector>
#include <sstream>
#include <algorithm>
#include <sys/timerfd.h>
......@@ -103,6 +105,27 @@ namespace Uri {
params.clear();
}
// \brief Return iterator to the beginning of the parameters map
std::unordered_map<std::string, std::string>::const_iterator
parameters_begin() const {
return params.begin();
}
// \brief Return iterator to the end of the parameters map
std::unordered_map<std::string, std::string>::const_iterator
parameters_end() const {
return params.begin();
}
// \brief returns all parameters given in the query
std::vector<std::string> parameters() const {
std::vector<std::string> keys;
std::transform(params.begin(), params.end(), std::back_inserter(keys),
[](const std::unordered_map<std::string, std::string>::value_type
&pair) {return pair.first;});
return keys;
}
private:
//first is key second is value
std::unordered_map<std::string, std::string> params;
......
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