diff options
| author | Kenneth Anthony Giusti <kgiusti@apache.org> | 2010-09-22 12:51:10 +0000 |
|---|---|---|
| committer | Kenneth Anthony Giusti <kgiusti@apache.org> | 2010-09-22 12:51:10 +0000 |
| commit | 475d0274faa05752358c451c4b08bfba4724498c (patch) | |
| tree | 57c936c36788e4f35100937b977d35f2daab7160 /qpid/cpp/src/qmf | |
| parent | 862c6a9d25312230c6ac45fe4badfab6dd7173bb (diff) | |
| download | qpid-python-475d0274faa05752358c451c4b08bfba4724498c.tar.gz | |
QPID-2880: allow boolean values in method call map/list arguments.
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@999919 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/cpp/src/qmf')
| -rw-r--r-- | qpid/cpp/src/qmf/engine/ValueImpl.cpp | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/qpid/cpp/src/qmf/engine/ValueImpl.cpp b/qpid/cpp/src/qmf/engine/ValueImpl.cpp index c58c28e166..409bf64c35 100644 --- a/qpid/cpp/src/qmf/engine/ValueImpl.cpp +++ b/qpid/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()))); |
