You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by ta...@apache.org on 2007/08/14 01:01:19 UTC

svn commit: r565560 - in /activemq/activemq-cpp/trunk/src/decaf/src/main: Makefile.am decaf/net/URI.h decaf/net/URISyntaxException.h

Author: tabish
Date: Mon Aug 13 16:01:18 2007
New Revision: 565560

URL: http://svn.apache.org/viewvc?view=rev&rev=565560
Log:
http://issues.apache.org/activemq/browse/AMQCPP-103

Adding start of URI class

Added:
    activemq/activemq-cpp/trunk/src/decaf/src/main/decaf/net/URISyntaxException.h
Modified:
    activemq/activemq-cpp/trunk/src/decaf/src/main/Makefile.am
    activemq/activemq-cpp/trunk/src/decaf/src/main/decaf/net/URI.h

Modified: activemq/activemq-cpp/trunk/src/decaf/src/main/Makefile.am
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/decaf/src/main/Makefile.am?view=diff&rev=565560&r1=565559&r2=565560
==============================================================================
--- activemq/activemq-cpp/trunk/src/decaf/src/main/Makefile.am (original)
+++ activemq/activemq-cpp/trunk/src/decaf/src/main/Makefile.am Mon Aug 13 16:01:18 2007
@@ -66,6 +66,7 @@
 h_sources = \
    decaf/net/BufferedSocket.h \
    decaf/net/SocketException.h \
+   decaf/net/URISyntaxException.h \
    decaf/net/TcpSocket.h \
    decaf/net/SocketError.h \
    decaf/net/SocketOutputStream.h \

Modified: activemq/activemq-cpp/trunk/src/decaf/src/main/decaf/net/URI.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/decaf/src/main/decaf/net/URI.h?view=diff&rev=565560&r1=565559&r2=565560
==============================================================================
--- activemq/activemq-cpp/trunk/src/decaf/src/main/decaf/net/URI.h (original)
+++ activemq/activemq-cpp/trunk/src/decaf/src/main/decaf/net/URI.h Mon Aug 13 16:01:18 2007
@@ -34,6 +34,53 @@
          */
         URI( const std::string& uri );
 
+        /**
+         * Constructs a URI from the given components.
+         * @param scheme - the uri scheme
+         * @param ssp - Scheme specific part
+         * @param fragment - Fragment
+         */
+        URI( const std::string& scheme,
+             const std::string& ssp,
+             const std::string& fragment);
+
+        /**
+         * Constructs a URI from the given components.
+         * @param scheme - Scheme name
+         * @param userInfo - User name and authorization information
+         * @param host - Host name
+         * @param port - Port number
+         * @param path - Path
+         * @param query - Query
+         * @param fragment - Fragment
+         */
+        URI( const std::string& scheme, const std::string& userInfo,
+             const std::string& host, int port,
+             const std::string& path, const std::string& query,
+             const std::string& fragment );
+
+        /**
+         * Constructs a URI from the given components.
+         * @param scheme - Scheme name
+         * @param host - Host name
+         * @param path - Path
+         * @param fragment - Fragment
+         */
+        URI( const std::string& scheme, const std::string& host,
+             const std::string& path, const std::string& fragment );
+
+        /**
+         * Constructs a URI from the given components.
+         * @param scheme - Scheme name
+         * @param authority - Authority
+         * @param path - Path
+         * @param query - Query
+         * @param fragment - Fragment
+         */
+        URI( const std::string& scheme, const std::string& authority,
+             const std::string& path, const std::string& query,
+             const std::string& fragment );
+
         virtual ~URI() {}
 
         /**

Added: activemq/activemq-cpp/trunk/src/decaf/src/main/decaf/net/URISyntaxException.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/decaf/src/main/decaf/net/URISyntaxException.h?view=auto&rev=565560
==============================================================================
--- activemq/activemq-cpp/trunk/src/decaf/src/main/decaf/net/URISyntaxException.h (added)
+++ activemq/activemq-cpp/trunk/src/decaf/src/main/decaf/net/URISyntaxException.h Mon Aug 13 16:01:18 2007
@@ -0,0 +1,93 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.
+ */
+
+#ifndef _DECAF_NET_URISYNTAXEXCEPTION_H_
+#define _DECAF_NET_URISYNTAXEXCEPTION_H_
+
+#include <decaf/util/Config.h>
+#include <decaf/lang/Exception.h>
+
+namespace decaf{
+namespace net{
+
+    class URISyntaxException : public lang::Exception {
+    public:
+
+        /**
+         * Default Constructor
+         */
+        URISyntaxException() throw() {}
+
+        /**
+         * Conversion Constructor from some other Exception
+         * @param An exception that should become this type of Exception
+         */
+        URISyntaxException( const Exception& ex ) throw()
+        : Exception()
+        {
+            *(Exception*)this = ex;
+        }
+
+        /**
+         * Copy Constructor
+         */
+        URISyntaxException( const URISyntaxException& ex ) throw()
+        : Exception()
+        {
+            *(Exception*)this = ex;
+        }
+
+        /**
+         * Constructor - Initializes the file name and line number where
+         * this message occured.  Sets the message to report, using an
+         * optional list of arguments to parse into the message
+         * @param file name where exception occurs
+         * @param line number where the exception occurred.
+         * @param message to report
+         * @param list of primitives that are formatted into the message
+         */
+        URISyntaxException( const char* file, const int lineNumber,
+                            const char* msg, ... ) throw ()
+        : Exception()
+        {
+            va_list vargs ;
+            va_start( vargs, msg );
+            buildMessage( msg, vargs );
+
+            // Set the first mark for this exception.
+            setMark( file, lineNumber );
+        }
+
+        /**
+         * Clones this exception.  This is useful for cases where you need
+         * to preserve the type of the original exception as well as the message.
+         * All subclasses should override.
+         */
+        virtual URISyntaxException* clone() const {
+            return new URISyntaxException( *this );
+        }
+
+        /**
+         * Destructor
+         */
+        virtual ~URISyntaxException() throw() {}
+
+    };
+
+}}
+
+#endif /*_DECAF_NET_URISYNTAXEXCEPTION_H_*/