From 53df223b3e2d08aed1bb70649c1f0269e0639f84 Mon Sep 17 00:00:00 2001 From: Gordon Sim Date: Thu, 18 Mar 2010 18:37:28 +0000 Subject: QPID-2452: Fixed control over the encoding used when sending a string valued variant. The user is currently responsible for correctly setting any encoding (e.g. utf8). If none is specified it will be transfered as an amqp0-10 vbin. Fixed bug preventing correct assignment of encoding in variants. git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@924939 13f79535-47bb-0310-9956-ffa450edef68 --- cpp/src/qpid/framing/FieldValue.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'cpp/src/qpid/framing') diff --git a/cpp/src/qpid/framing/FieldValue.cpp b/cpp/src/qpid/framing/FieldValue.cpp index fd911645f4..ce5a50117c 100644 --- a/cpp/src/qpid/framing/FieldValue.cpp +++ b/cpp/src/qpid/framing/FieldValue.cpp @@ -130,6 +130,21 @@ Str16Value::Str16Value(const std::string& v) : reinterpret_cast(v.data()+v.size()))) {} +Var16Value::Var16Value(const std::string& v, uint8_t code) : + FieldValue( + code, + new VariableWidthValue<2>( + reinterpret_cast(v.data()), + reinterpret_cast(v.data()+v.size()))) +{} +Var32Value::Var32Value(const std::string& v, uint8_t code) : + FieldValue( + code, + new VariableWidthValue<4>( + reinterpret_cast(v.data()), + reinterpret_cast(v.data()+v.size()))) +{} + Struct32Value::Struct32Value(const std::string& v) : FieldValue( 0xAB, -- cgit v1.2.1