summaryrefslogtreecommitdiff
path: root/cpp/src
diff options
context:
space:
mode:
authorKenneth Anthony Giusti <kgiusti@apache.org>2010-09-22 12:51:10 +0000
committerKenneth Anthony Giusti <kgiusti@apache.org>2010-09-22 12:51:10 +0000
commiteb2f320af6e874d763fb2f2b3e81801424416cc1 (patch)
tree3630e84f77a50ddb83cbfbc0480d25280e7f5014 /cpp/src
parent1bdcd0996456626cb1180fb9227826f2d953cee1 (diff)
downloadqpid-python-eb2f320af6e874d763fb2f2b3e81801424416cc1.tar.gz
QPID-2880: allow boolean values in method call map/list arguments.
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@999919 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src')
-rw-r--r--cpp/src/qmf/engine/ValueImpl.cpp17
1 files changed, 15 insertions, 2 deletions
diff --git a/cpp/src/qmf/engine/ValueImpl.cpp b/cpp/src/qmf/engine/ValueImpl.cpp
index c58c28e166..409bf64c35 100644
--- a/cpp/src/qmf/engine/ValueImpl.cpp
+++ b/cpp/src/qmf/engine/ValueImpl.cpp
@@ -21,6 +21,7 @@
#include <qpid/framing/FieldValue.h>
#include <qpid/framing/FieldTable.h>
#include <qpid/framing/List.h>
+#include <qpid/log/Statement.h>
using namespace std;
using namespace qmf::engine;
@@ -153,6 +154,12 @@ void ValueImpl::initMap(const FieldTable& ft)
subval->impl->initList(subList);
insert(name.c_str(), subval);
}
+ } else if (amqType == 0x08) {
+ Value* subval(new Value(TYPE_BOOL));
+ subval->setBool(fvalue.get<int>() ? true : false);
+ insert(name.c_str(), subval);
+ } else {
+ QPID_LOG(error, "Unable to decode unsupported AMQP typecode=" << amqType << " map index=" << name);
}
}
}
@@ -185,7 +192,7 @@ void ValueImpl::mapToFieldTable(FieldTable& ft) const
ft.setInt64(name, subval.asInt64());
break;
case TYPE_BOOL:
- ft.setInt(name, subval.asBool() ? 1 : 0);
+ ft.set(name, FieldTable::ValuePtr(new BoolValue(subval.asBool())));
break;
case TYPE_FLOAT:
ft.setFloat(name, subval.asFloat());
@@ -274,6 +281,12 @@ void ValueImpl::initList(const List& fl)
subVal->impl->initList(subList);
appendToList(subVal);
}
+ } else if (amqType == 0x08) {
+ Value* subval(new Value(TYPE_BOOL));
+ subval->setBool(fvalue.get<int>() ? true : false);
+ appendToList(subval);
+ } else {
+ QPID_LOG(error, "Unable to decode unsupported AMQP typecode =" << amqType);
}
}
}
@@ -303,7 +316,7 @@ void ValueImpl::listToFramingList(List& fl) const
fl.push_back(List::ValuePtr(new Integer64Value(subval.asInt64())));
break;
case TYPE_BOOL:
- fl.push_back(List::ValuePtr(new IntegerValue(subval.asBool() ? 1 : 0)));
+ fl.push_back(List::ValuePtr(new BoolValue(subval.asBool() ? 1 : 0)));
break;
case TYPE_FLOAT:
fl.push_back(List::ValuePtr(new FloatValue(subval.asFloat())));