diff options
author | Kim van der Riet <kpvdr@apache.org> | 2013-02-28 16:14:30 +0000 |
---|---|---|
committer | Kim van der Riet <kpvdr@apache.org> | 2013-02-28 16:14:30 +0000 |
commit | 9c73ef7a5ac10acd6a50d5d52bd721fc2faa5919 (patch) | |
tree | 2a890e1df09e5b896a9b4168a7b22648f559a1f2 /cpp/src/qpid/framing/FieldValue.cpp | |
parent | 172d9b2a16cfb817bbe632d050acba7e31401cd2 (diff) | |
download | qpid-python-asyncstore.tar.gz |
Update from trunk r1375509 through r1450773asyncstore
git-svn-id: https://svn.apache.org/repos/asf/qpid/branches/asyncstore@1451244 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid/framing/FieldValue.cpp')
-rw-r--r-- | cpp/src/qpid/framing/FieldValue.cpp | 14 |
1 files changed, 10 insertions, 4 deletions
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<List>()); } else if (typeOctet == 0xAA) { data.reset(new EncodedValue<Array>()); - } 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); |