diff options
author | Gordon Sim <gsim@apache.org> | 2007-11-06 17:27:27 +0000 |
---|---|---|
committer | Gordon Sim <gsim@apache.org> | 2007-11-06 17:27:27 +0000 |
commit | a2ded139f371d273afa858f49a5b7f6e0efc2394 (patch) | |
tree | 8fc04da8ffe3aa819843a101a75d98429f27eaa5 /python/qpid/codec.py | |
parent | a1a0ecfbf02293cf917db5e56d65d367be5ad5a7 (diff) | |
download | qpid-python-a2ded139f371d273afa858f49a5b7f6e0efc2394.tar.gz |
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
Diffstat (limited to 'python/qpid/codec.py')
-rw-r--r-- | python/qpid/codec.py | 17 |
1 files changed, 17 insertions, 0 deletions
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 |