From b00e749a170b09db7e24161baa809c11fa65531f Mon Sep 17 00:00:00 2001 From: Gordon Sim Date: Thu, 11 Mar 2010 18:23:46 +0000 Subject: QPID-2382: Created separate utility class for handling updates from failover exchange; cleaned up reconnection options git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@921971 13f79535-47bb-0310-9956-ffa450edef68 --- cpp/src/qpid/messaging/Connection.cpp | 37 ++++------------------------------- 1 file changed, 4 insertions(+), 33 deletions(-) (limited to 'cpp/src/qpid/messaging/Connection.cpp') diff --git a/cpp/src/qpid/messaging/Connection.cpp b/cpp/src/qpid/messaging/Connection.cpp index 230c9d5dbf..4873899787 100644 --- a/cpp/src/qpid/messaging/Connection.cpp +++ b/cpp/src/qpid/messaging/Connection.cpp @@ -67,40 +67,11 @@ Session Connection::newSession(bool transactional, const std::string& name) return impl->newSession(transactional, name); } Session Connection::getSession(const std::string& name) const { return impl->getSession(name); } - -InvalidOptionString::InvalidOptionString(const std::string& msg) : Exception(msg) {} - -void parseKeyValuePair(const std::string& in, Variant::Map& out) -{ - std::string::size_type i = in.find('='); - if (i == std::string::npos || i == in.size() || in.find('=', i+1) != std::string::npos) { - throw InvalidOptionString(QPID_MSG("Cannot parse name-value pair from " << in)); - } else { - out[in.substr(0, i)] = in.substr(i+1); - } -} - -void parseOptionString(const std::string& in, Variant::Map& out) -{ - std::string::size_type start = 0; - std::string::size_type i = in.find('&'); - while (i != std::string::npos) { - parseKeyValuePair(in.substr(start, i-start), out); - if (i < in.size()) { - start = i+1; - i = in.find('&', start); - } else { - i = std::string::npos; - } - } - parseKeyValuePair(in.substr(start), out); +void Connection::setOption(const std::string& name, const Variant& value) +{ + impl->setOption(name, value); } -Variant::Map parseOptionString(const std::string& in) -{ - Variant::Map map; - parseOptionString(in, map); - return map; -} +InvalidOptionString::InvalidOptionString(const std::string& msg) : Exception(msg) {} }} // namespace qpid::messaging -- cgit v1.2.1