From ff04bf79f43b19094d757f78c036ff07ea50e0ce Mon Sep 17 00:00:00 2001 From: Jonathan Robie Date: Fri, 26 Nov 2010 17:42:53 +0000 Subject: Binds integer, floating point, or string-typed headers using appropriate datatypes. git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@1039478 13f79535-47bb-0310-9956-ffa450edef68 --- cpp/src/qpid/xml/XmlExchange.cpp | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) (limited to 'cpp/src/qpid/xml/XmlExchange.cpp') diff --git a/cpp/src/qpid/xml/XmlExchange.cpp b/cpp/src/qpid/xml/XmlExchange.cpp index 85a6cb4f57..b7ff5d211d 100644 --- a/cpp/src/qpid/xml/XmlExchange.cpp +++ b/cpp/src/qpid/xml/XmlExchange.cpp @@ -234,12 +234,23 @@ bool XmlExchange::matches(Query& query, Deliverable& msg, const qpid::framing::F if (args) { FieldTable::ValueMap::const_iterator v = args->begin(); for(; v != args->end(); ++v) { - // ### TODO: Do types properly - if (v->second->convertsTo()) { - QPID_LOG(trace, "XmlExchange, external variable: " << v->first << " = " << v->second->getData().getString().c_str()); - Item::Ptr value = context->getItemFactory()->createString(X(v->second->getData().getString().c_str()), context.get()); + + if (v->second->convertsTo()) { + QPID_LOG(trace, "XmlExchange, external variable (double): " << v->first << " = " << v->second->get()); + Item::Ptr value = context->getItemFactory()->createDouble(v->second->get(), context.get()); + context->setExternalVariable(X(v->first.c_str()), value); + } + else if (v->second->convertsTo()) { + QPID_LOG(trace, "XmlExchange, external variable (int):" << v->first << " = " << v->second->getData().getInt()); + Item::Ptr value = context->getItemFactory()->createInteger(v->second->get(), context.get()); context->setExternalVariable(X(v->first.c_str()), value); } + else if (v->second->convertsTo()) { + QPID_LOG(trace, "XmlExchange, external variable (string):" << v->first << " = " << v->second->getData().getString().c_str()); + Item::Ptr value = context->getItemFactory()->createString(X(v->second->get().c_str()), context.get()); + context->setExternalVariable(X(v->first.c_str()), value); + } + } } -- cgit v1.2.1