diff options
author | Gordon Sim <gsim@apache.org> | 2010-03-11 18:23:46 +0000 |
---|---|---|
committer | Gordon Sim <gsim@apache.org> | 2010-03-11 18:23:46 +0000 |
commit | b00e749a170b09db7e24161baa809c11fa65531f (patch) | |
tree | 1356c7ecbc3555892d9be10ec9d86455335259fb /cpp/src/qpid/messaging/Connection.cpp | |
parent | 88086e0099c0fb67ac3a01c5f8793c0634b946a0 (diff) | |
download | qpid-python-b00e749a170b09db7e24161baa809c11fa65531f.tar.gz |
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
Diffstat (limited to 'cpp/src/qpid/messaging/Connection.cpp')
-rw-r--r-- | cpp/src/qpid/messaging/Connection.cpp | 37 |
1 files changed, 4 insertions, 33 deletions
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 |