From a2ded139f371d273afa858f49a5b7f6e0efc2394 Mon Sep 17 00:00:00 2001 From: Gordon Sim Date: Tue, 6 Nov 2007 17:27:27 +0000 Subject: Add support for array type to c++ (and python, decode only for now) Change the type of the in-doubt field in dtx-coordination.recover to an array (to bring in line with amqp spec) git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@592494 13f79535-47bb-0310-9956-ffa450edef68 --- python/qpid/codec.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'python/qpid/codec.py') diff --git a/python/qpid/codec.py b/python/qpid/codec.py index 18928698a5..6399ad2a5d 100644 --- a/python/qpid/codec.py +++ b/python/qpid/codec.py @@ -510,6 +510,23 @@ class Codec: type = self.spec.structs[codec.decode_short()] return codec.decode_struct_body(type) + def decode_array(self): + size = self.decode_long() + code = self.decode_octet() + count = self.decode_long() + result = [] + for i in range(0, count): + if self.types.has_key(code): + value = self.decode(self.types[code]) + else: + w = width(code) + if fixed(code): + value = self.read(w) + else: + value = self.read(self.dec_num(w)) + result.append(value) + return result + def fixed(code): return (code >> 6) != 2 -- cgit v1.2.1