From 7847c1c0326e654845868ab4ab4ec27863a3e777 Mon Sep 17 00:00:00 2001 From: Kim van der Riet Date: Fri, 3 Nov 2006 21:27:48 +0000 Subject: 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 --- cpp/src/qpid/framing/ProtocolVersionException.cpp | 63 +++++++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 cpp/src/qpid/framing/ProtocolVersionException.cpp (limited to 'cpp/src/qpid/framing/ProtocolVersionException.cpp') 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 + +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(); +} -- cgit v1.2.1