summaryrefslogtreecommitdiff
path: root/cpp/src
diff options
context:
space:
mode:
authorGordon Sim <gsim@apache.org>2009-11-19 11:46:00 +0000
committerGordon Sim <gsim@apache.org>2009-11-19 11:46:00 +0000
commit1ea31fb5ea5e9240776600d81ae4742aefa51320 (patch)
tree41416cfa50902b240ef8a7175ee15718a9dea91e /cpp/src
parent82faa3a8fe5406506855e99373734e84f3f0d581 (diff)
downloadqpid-python-1ea31fb5ea5e9240776600d81ae4742aefa51320.tar.gz
QPID-664: Add spout & drain examples as per python client
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@882118 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src')
-rw-r--r--cpp/src/qpid/messaging/Address.cpp2
-rw-r--r--cpp/src/qpid/messaging/MapContent.cpp1
-rw-r--r--cpp/src/qpid/messaging/Variant.cpp8
3 files changed, 8 insertions, 3 deletions
diff --git a/cpp/src/qpid/messaging/Address.cpp b/cpp/src/qpid/messaging/Address.cpp
index fff7c453b8..5262cec0db 100644
--- a/cpp/src/qpid/messaging/Address.cpp
+++ b/cpp/src/qpid/messaging/Address.cpp
@@ -95,7 +95,7 @@ std::string Address::toStr() const
std::stringstream out;
out << impl->name;
if (!impl->subject.empty()) out << SUBJECT_DIVIDER << impl->subject;
- if (!impl->options.empty()) out << OPTIONS_DIVIDER << " {" << impl->options << "}";
+ if (!impl->options.empty()) out << OPTIONS_DIVIDER << impl->options;
return out.str();
}
Address::operator bool() const { return !impl->name.empty(); }
diff --git a/cpp/src/qpid/messaging/MapContent.cpp b/cpp/src/qpid/messaging/MapContent.cpp
index c653561fc9..6dba22be99 100644
--- a/cpp/src/qpid/messaging/MapContent.cpp
+++ b/cpp/src/qpid/messaging/MapContent.cpp
@@ -41,6 +41,7 @@ class MapContentImpl : public Variant
{
qpid::client::amqp0_10::MapCodec codec;
codec.encode(*this, msg->getContent());
+ msg->setContentType(qpid::client::amqp0_10::MapCodec::contentType);
}
};
diff --git a/cpp/src/qpid/messaging/Variant.cpp b/cpp/src/qpid/messaging/Variant.cpp
index 3b0c3312ca..71f9fbe646 100644
--- a/cpp/src/qpid/messaging/Variant.cpp
+++ b/cpp/src/qpid/messaging/Variant.cpp
@@ -566,19 +566,23 @@ Variant::operator const char*() const { return asString().c_str(); }
std::ostream& operator<<(std::ostream& out, const Variant::Map& map)
{
+ out << "{";
for (Variant::Map::const_iterator i = map.begin(); i != map.end(); ++i) {
if (i != map.begin()) out << ", ";
out << i->first << ":" << i->second;
}
+ out << "}";
return out;
}
std::ostream& operator<<(std::ostream& out, const Variant::List& list)
{
+ out << "[";
for (Variant::List::const_iterator i = list.begin(); i != list.end(); ++i) {
if (i != list.begin()) out << ", ";
out << *i;
}
+ out << "]";
return out;
}
@@ -586,10 +590,10 @@ std::ostream& operator<<(std::ostream& out, const Variant& value)
{
switch (value.getType()) {
case VAR_MAP:
- out << "{" << value.asMap() << "}";
+ out << value.asMap();
break;
case VAR_LIST:
- out << "[" << value.asList() << "]";
+ out << value.asList();
break;
case VAR_VOID:
out << "<void>";