From 9c73ef7a5ac10acd6a50d5d52bd721fc2faa5919 Mon Sep 17 00:00:00 2001 From: Kim van der Riet Date: Thu, 28 Feb 2013 16:14:30 +0000 Subject: Update from trunk r1375509 through r1450773 git-svn-id: https://svn.apache.org/repos/asf/qpid/branches/asyncstore@1451244 13f79535-47bb-0310-9956-ffa450edef68 --- cpp/src/qpid/framing/FieldValue.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 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 ce5a50117c..4abed0f77f 100644 --- a/cpp/src/qpid/framing/FieldValue.cpp +++ b/cpp/src/qpid/framing/FieldValue.cpp @@ -23,6 +23,7 @@ #include "qpid/framing/Buffer.h" #include "qpid/framing/Endian.h" #include "qpid/framing/List.h" +#include "qpid/framing/Uuid.h" #include "qpid/framing/reply_exceptions.h" #include "qpid/Msg.h" @@ -43,7 +44,9 @@ void FieldValue::setType(uint8_t type) data.reset(new EncodedValue()); } else if (typeOctet == 0xAA) { data.reset(new EncodedValue()); - } else { + } else if (typeOctet == 0x48) { + data.reset(new UuidData()); + } else { uint8_t lenType = typeOctet >> 4; switch(lenType){ case 0: @@ -213,9 +216,12 @@ Integer8Value::Integer8Value(int8_t v) : Integer16Value::Integer16Value(int16_t v) : FieldValue(0x11, new FixedWidthValue<2>(v)) {} -UuidValue::UuidValue(const unsigned char* v) : - FieldValue(0x48, new FixedWidthValue<16>(v)) -{} + +UuidData::UuidData() {} +UuidData::UuidData(const unsigned char* bytes) : FixedWidthValue<16>(bytes) {} +bool UuidData::convertsToString() const { return true; } +std::string UuidData::getString() const { return Uuid(rawOctets()).str(); } +UuidValue::UuidValue(const unsigned char* v) : FieldValue(0x48, new UuidData(v)) {} void FieldValue::print(std::ostream& out) const { data->print(out); -- cgit v1.2.1