From e760842265e2dd3d352b59164cb8fda64420a5a9 Mon Sep 17 00:00:00 2001 From: Vincent Richard Date: Fri, 15 Nov 2013 21:46:03 +0100 Subject: Use "std::map" instead of "propertySet" in url class. --- src/utility/url.cpp | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) (limited to 'src/utility') diff --git a/src/utility/url.cpp b/src/utility/url.cpp index d3c5445d..f9157d64 100644 --- a/src/utility/url.cpp +++ b/src/utility/url.cpp @@ -130,26 +130,23 @@ const string url::build() const oss << urlUtils::encode(m_path); } - const std::vector > params - = m_params.getPropertyList(); - if (!params.empty()) + if (!m_params.empty()) { if (m_path.empty()) oss << "/"; oss << "?"; - for (unsigned int i = 0 ; i < params.size() ; ++i) + for (std::map ::const_iterator it = m_params.begin() ; + it != m_params.end() ; ++it) { - const ref prop = params[i]; - - if (i != 0) + if (it != m_params.begin()) oss << "&"; - oss << urlUtils::encode(prop->getName()); + oss << urlUtils::encode((*it).first); oss << "="; - oss << urlUtils::encode(prop->getValue ()); + oss << urlUtils::encode((*it).second); } } @@ -267,7 +264,7 @@ void url::parse(const string& str) portNum = UNSPECIFIED_PORT; // Extract parameters - m_params.removeAllProperties(); + m_params.clear(); if (!params.empty()) { @@ -300,7 +297,7 @@ void url::parse(const string& str) name = urlUtils::decode(name); value = urlUtils::decode(value); - m_params.setProperty(name, value); + m_params[name] = value; if (pos != string::npos) ++pos; @@ -393,13 +390,13 @@ void url::setPath(const string& path) } -const propertySet& url::getParams() const +const std::map & url::getParams() const { return (m_params); } -propertySet& url::getParams() +std::map & url::getParams() { return (m_params); } -- cgit