summaryrefslogtreecommitdiff
path: root/cpp/src/qpid/framing/ProtocolVersionException.cpp
diff options
context:
space:
mode:
authorKim van der Riet <kpvdr@apache.org>2006-11-03 21:27:48 +0000
committerKim van der Riet <kpvdr@apache.org>2006-11-03 21:27:48 +0000
commit7847c1c0326e654845868ab4ab4ec27863a3e777 (patch)
tree9fbda427bca0f2b65de557d0f4914d3cbd968909 /cpp/src/qpid/framing/ProtocolVersionException.cpp
parentd817d3a1228da29ef39d177235c2878c282e0d27 (diff)
downloadqpid-python-7847c1c0326e654845868ab4ab4ec27863a3e777.tar.gz
Added protocol version and version exception classes in preparation for multi-protocol generation.
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@471002 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid/framing/ProtocolVersionException.cpp')
-rw-r--r--cpp/src/qpid/framing/ProtocolVersionException.cpp63
1 files changed, 63 insertions, 0 deletions
diff --git a/cpp/src/qpid/framing/ProtocolVersionException.cpp b/cpp/src/qpid/framing/ProtocolVersionException.cpp
new file mode 100644
index 0000000000..0ba500aad8
--- /dev/null
+++ b/cpp/src/qpid/framing/ProtocolVersionException.cpp
@@ -0,0 +1,63 @@
+/*
+ *
+ * Copyright (c) 2006 The Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+#include "qpid/framing/ProtocolVersionException.h"
+#include <sstream>
+
+using namespace qpid::framing;
+
+ProtocolVersionException::ProtocolVersionException() throw ()
+{
+}
+
+ProtocolVersionException::ProtocolVersionException(const std::string& str) throw () : Exception(str)
+{
+}
+
+ProtocolVersionException::ProtocolVersionException(const char* str) throw () : Exception(str)
+{
+}
+
+ProtocolVersionException::ProtocolVersionException(const ProtocolVersion& versionFound_, const std::string& str) throw () : Exception(str)
+
+{
+ versionFound = versionFound_;
+}
+
+ProtocolVersionException::ProtocolVersionException(const ProtocolVersion& versionFound_, const char* str) throw () : Exception(str)
+
+{
+ versionFound = versionFound_;
+}
+
+ProtocolVersionException::~ProtocolVersionException() throw ()
+{
+}
+
+const char* ProtocolVersionException::what() const throw()
+{
+ std::stringstream ss;
+ ss << "ProtocolVersionException: AMQP Version " << versionFound.toString() << " found: " << whatStr;
+ return ss.str().c_str();
+}
+
+std::string ProtocolVersionException::toString() const throw()
+{
+ std::stringstream ss;
+ ss << "ProtocolVersionException: AMQP Version " << versionFound.toString() << " found: " << whatStr;
+ return ss.str();
+}