From eda249ff22edb3726243da81ff48c82e4d88e872 Mon Sep 17 00:00:00 2001 From: Alan Conway Date: Tue, 4 Nov 2008 19:52:49 +0000 Subject: constants.rb: generate type code constants for AMQP types. Useful with Array. framing/Array: - added some std:::vector like functions & typedefs. - use TypeCode enums, human readable ostream << operator. git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@711365 13f79535-47bb-0310-9956-ffa450edef68 --- cpp/src/qpid/framing/FieldValue.cpp | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'cpp/src/qpid/framing/FieldValue.cpp') diff --git a/cpp/src/qpid/framing/FieldValue.cpp b/cpp/src/qpid/framing/FieldValue.cpp index 9107ceeeea..ecf469236d 100644 --- a/cpp/src/qpid/framing/FieldValue.cpp +++ b/cpp/src/qpid/framing/FieldValue.cpp @@ -109,10 +109,10 @@ bool FieldValue::operator==(const FieldValue& v) const *data == *v.data; } -StringValue::StringValue(const std::string& v) : +Str8Value::Str8Value(const std::string& v) : FieldValue( - 0xA4, - new VariableWidthValue<4>( + TYPE_CODE_STR8, + new VariableWidthValue<1>( reinterpret_cast(v.data()), reinterpret_cast(v.data()+v.size()))) { @@ -168,4 +168,13 @@ ArrayValue::ArrayValue(const Array& a) : FieldValue(0xaa, new EncodedValueprint(out); + out << TypeCode(typeOctet) << '('; + if (data->convertsToString()) out << data->getString(); + else if (data->convertsToInt()) out << data->getInt(); + else data->print(out); + out << ')'; +} + }} -- cgit v1.2.1