Browse Source

moved exceptions out of libdns and created libexceptions

don't forget to make clean and autoreconf again


git-svn-id: svn://bind10.isc.org/svn/bind10/branches/parkinglot@735 e5f2f494-b856-4b98-b285-d166d9295462
Jelte Jansen 15 years ago
parent
commit
3a866699f9

+ 1 - 0
Makefile.am

@@ -44,6 +44,7 @@ include:
 	ln -s ${abs_top_srcdir}/src/lib/cc/cpp include/cc
 	ln -s ${abs_top_srcdir}/src/lib/cc/cpp include/cc
 	ln -s ${abs_top_srcdir}/src/lib/config/cpp include/config
 	ln -s ${abs_top_srcdir}/src/lib/config/cpp include/config
 	ln -s ${abs_top_srcdir}/src/lib/dns/cpp include/dns
 	ln -s ${abs_top_srcdir}/src/lib/dns/cpp include/dns
+	ln -s ${abs_top_srcdir}/src/lib/exceptions/cpp include/exceptions
 
 
 stree_symlinks:	pyshared include
 stree_symlinks:	pyshared include
 .PHONY: stree_symlinks
 .PHONY: stree_symlinks

+ 2 - 0
configure.ac

@@ -163,6 +163,8 @@ AC_CONFIG_FILES([Makefile
                  src/lib/config/python/isc/config/Makefile
                  src/lib/config/python/isc/config/Makefile
                  src/lib/dns/Makefile
                  src/lib/dns/Makefile
                  src/lib/dns/cpp/Makefile
                  src/lib/dns/cpp/Makefile
+                 src/lib/exceptions/cpp/Makefile
+                 src/lib/exceptions/Makefile
                  src/lib/auth/Makefile
                  src/lib/auth/Makefile
                  src/lib/auth/cpp/Makefile
                  src/lib/auth/cpp/Makefile
                ])
                ])

+ 2 - 1
src/bin/auth/Makefile.am

@@ -1,4 +1,4 @@
-AM_CPPFLAGS = -I$(top_builddir)/src/lib -I$(top_builddir)/src/lib/dns/cpp -I$(top_builddir)/include/dns/cpp -I$(top_builddir)/include -I$(top_srcdir)/ext
+AM_CPPFLAGS = -I$(top_builddir)/include -I$(top_builddir)/src/lib -I$(top_builddir)/src/lib/dns/cpp -I$(top_builddir)/include/dns/cpp -I$(top_builddir)/include -I$(top_srcdir)/ext
 
 
 pkglibexecdir = $(libexecdir)/@PACKAGE@
 pkglibexecdir = $(libexecdir)/@PACKAGE@
 
 
@@ -10,6 +10,7 @@ b10_auth_LDADD =  $(top_builddir)/src/lib/dns/cpp/.libs/libdns.a
 b10_auth_LDADD +=  $(top_builddir)/src/lib/auth/cpp/.libs/libauth.a
 b10_auth_LDADD +=  $(top_builddir)/src/lib/auth/cpp/.libs/libauth.a
 b10_auth_LDADD += $(top_builddir)/src/lib/config/cpp/libcfgclient.a
 b10_auth_LDADD += $(top_builddir)/src/lib/config/cpp/libcfgclient.a
 b10_auth_LDADD += $(top_builddir)/src/lib/cc/cpp/libcc.a
 b10_auth_LDADD += $(top_builddir)/src/lib/cc/cpp/libcc.a
+b10_auth_LDADD += $(top_builddir)/src/lib/exceptions/cpp/.libs/libexceptions.a
 
 
 # TODO: config.h.in is wrong because doesn't honor pkgdatadir
 # TODO: config.h.in is wrong because doesn't honor pkgdatadir
 # and can't use @datadir@ because doesn't expand default ${prefix}
 # and can't use @datadir@ because doesn't expand default ${prefix}

+ 1 - 0
src/bin/host/Makefile.am

@@ -3,3 +3,4 @@ AM_CPPFLAGS =  -I$(top_builddir)/src/lib -I$(top_builddir)/src/lib/dns/cpp -I$(t
 bin_PROGRAMS = host
 bin_PROGRAMS = host
 host_SOURCES = host.cc
 host_SOURCES = host.cc
 host_LDADD = $(top_builddir)/src/lib/dns/cpp/.libs/libdns.a
 host_LDADD = $(top_builddir)/src/lib/dns/cpp/.libs/libdns.a
+host_LDADD += $(top_builddir)/src/lib/exceptions/cpp/.libs/libexceptions.a

+ 3 - 1
src/bin/parkinglot/Makefile.am

@@ -1,4 +1,4 @@
-AM_CPPFLAGS = -I$(top_builddir)/src/lib -I$(top_builddir)/src/lib/dns/cpp -I$(top_builddir)/include/dns/cpp -I$(top_builddir)/include -I$(top_srcdir)/ext
+AM_CPPFLAGS = -I$(top_builddir)/include -I$(top_builddir)/src/lib -I$(top_builddir)/src/lib/dns/cpp -I$(top_builddir)/include/dns/cpp -I$(top_builddir)/include -I$(top_srcdir)/ext
 
 
 pkglibexecdir = $(libexecdir)/@PACKAGE@
 pkglibexecdir = $(libexecdir)/@PACKAGE@
 
 
@@ -12,6 +12,7 @@ b10_parkinglot_SOURCES += builtin.h builtin.cc
 b10_parkinglot_LDADD =  $(top_builddir)/src/lib/dns/cpp/.libs/libdns.a
 b10_parkinglot_LDADD =  $(top_builddir)/src/lib/dns/cpp/.libs/libdns.a
 b10_parkinglot_LDADD += $(top_builddir)/src/lib/config/cpp/libcfgclient.a
 b10_parkinglot_LDADD += $(top_builddir)/src/lib/config/cpp/libcfgclient.a
 b10_parkinglot_LDADD += $(top_builddir)/src/lib/cc/cpp/libcc.a
 b10_parkinglot_LDADD += $(top_builddir)/src/lib/cc/cpp/libcc.a
+b10_parkinglot_LDADD += $(top_builddir)/src/lib/exceptions/cpp/.libs/libexceptions.a
 
 
 b10_parkinglotdir = $(DESTDIR)$(pkgdatadir)
 b10_parkinglotdir = $(DESTDIR)$(pkgdatadir)
 b10_parkinglot_DATA = parkinglot.spec
 b10_parkinglot_DATA = parkinglot.spec
@@ -20,3 +21,4 @@ b10_parkinglot_DATA = parkinglot.spec
 bin_PROGRAMS = builtin_bench
 bin_PROGRAMS = builtin_bench
 builtin_bench_SOURCES = builtin_bench.cc builtin.h builtin.cc
 builtin_bench_SOURCES = builtin_bench.cc builtin.h builtin.cc
 builtin_bench_LDADD = $(top_builddir)/src/lib/dns/cpp/.libs/libdns.a
 builtin_bench_LDADD = $(top_builddir)/src/lib/dns/cpp/.libs/libdns.a
+builtin_bench_LDADD += $(top_builddir)/src/lib/exceptions/cpp/.libs/libexceptions.a

+ 1 - 1
src/lib/Makefile.am

@@ -1 +1 @@
-SUBDIRS = dns cc config auth
+SUBDIRS = exceptions dns cc config auth

+ 2 - 2
src/lib/auth/cpp/query.h

@@ -19,7 +19,7 @@
 
 
 #include <queue>
 #include <queue>
 
 
-#include <dns/exceptions.h>
+#include <exceptions/exceptions.h>
 #include <dns/name.h>
 #include <dns/name.h>
 #include <dns/message.h>
 #include <dns/message.h>
 #include <dns/rrset.h>
 #include <dns/rrset.h>
@@ -42,7 +42,7 @@ enum QueryStatus {
 class MalformedMessage : public Exception {
 class MalformedMessage : public Exception {
 public:
 public:
     MalformedMessage(const char* file, size_t line, const char* what) :
     MalformedMessage(const char* file, size_t line, const char* what) :
-        isc::dns::Exception(file, line, what) {}
+        isc::Exception(file, line, what) {}
 };
 };
 
 
 // An individual task to be carried out by the query logic
 // An individual task to be carried out by the query logic

+ 1 - 0
src/lib/cc/cpp/Makefile.am

@@ -11,6 +11,7 @@ run_unittests_CPPFLAGS = $(AM_CPPFLAGS) $(GTEST_INCLUDES)
 run_unittests_LDFLAGS = $(AM_LDFLAGS) $(GTEST_LDFLAGS)
 run_unittests_LDFLAGS = $(AM_LDFLAGS) $(GTEST_LDFLAGS)
 run_unittests_LDADD = libcc.a $(GTEST_LDADD)
 run_unittests_LDADD = libcc.a $(GTEST_LDADD)
 run_unittests_LDADD +=  $(top_builddir)/src/lib/dns/cpp/.libs/libdns.a
 run_unittests_LDADD +=  $(top_builddir)/src/lib/dns/cpp/.libs/libdns.a
+run_unittests_LDADD +=  $(top_builddir)/src/lib/exceptions/cpp/.libs/libexceptions.a
 endif
 endif
 
 
 noinst_PROGRAMS = $(TESTS)
 noinst_PROGRAMS = $(TESTS)

+ 3 - 3
src/lib/cc/cpp/data.h

@@ -22,7 +22,7 @@
 #include <map>
 #include <map>
 #include <boost/shared_ptr.hpp>
 #include <boost/shared_ptr.hpp>
 #include <stdexcept>
 #include <stdexcept>
-#include <dns/exceptions.h>
+#include <exceptions/exceptions.h>
 
 
 namespace isc { namespace data {
 namespace isc { namespace data {
 
 
@@ -36,10 +36,10 @@ typedef boost::shared_ptr<Element> ElementPtr;
 /// ListElement)
 /// ListElement)
 ///
 ///
 // todo: include types and called function in the exception
 // todo: include types and called function in the exception
-class TypeError : public isc::dns::Exception {
+class TypeError : public isc::Exception {
 public:
 public:
     TypeError(const char* file, size_t line, const char* what) :
     TypeError(const char* file, size_t line, const char* what) :
-        isc::dns::Exception(file, line, what) {}
+        isc::Exception(file, line, what) {}
 };
 };
 
 
 ///
 ///

+ 1 - 1
src/lib/config/cpp/Makefile.am

@@ -10,7 +10,7 @@ run_unittests_SOURCES = data_def_unittests.cc run_unittests.cc
 run_unittests_CPPFLAGS = $(AM_CPPFLAGS) $(GTEST_INCLUDES)
 run_unittests_CPPFLAGS = $(AM_CPPFLAGS) $(GTEST_INCLUDES)
 run_unittests_LDFLAGS = $(AM_LDFLAGS) $(GTEST_LDFLAGS)
 run_unittests_LDFLAGS = $(AM_LDFLAGS) $(GTEST_LDFLAGS)
 run_unittests_LDADD = libcfgclient.a $(GTEST_LDADD)
 run_unittests_LDADD = libcfgclient.a $(GTEST_LDADD)
-run_unittests_LDADD += $(top_builddir)/src/lib/dns/cpp/libdns.la
+run_unittests_LDADD += $(top_builddir)/src/lib/exceptions/cpp/libexceptions.la
 run_unittests_LDADD += $(top_builddir)/src/lib/cc/cpp/libcc.a
 run_unittests_LDADD += $(top_builddir)/src/lib/cc/cpp/libcc.a
 endif
 endif
 
 

+ 5 - 5
src/lib/dns/cpp/Makefile.am

@@ -1,4 +1,4 @@
-AM_CPPFLAGS = -I$(top_srcdir)/ext
+AM_CPPFLAGS = -I$(top_builddir)/include -I$(top_srcdir)/ext
 
 
 CLEANFILES = *.gcno *.gcda
 CLEANFILES = *.gcno *.gcda
 CLEANFILES += rrclass.h rrtype.h rrparamregistry.cc rdataclass.h rdataclass.cc
 CLEANFILES += rrclass.h rrtype.h rrparamregistry.cc rdataclass.h rdataclass.cc
@@ -16,7 +16,6 @@ libdns_la_SOURCES += rrset.h rrset.cc
 libdns_la_SOURCES += question.h question.cc
 libdns_la_SOURCES += question.h question.cc
 libdns_la_SOURCES += message.h message.cc
 libdns_la_SOURCES += message.h message.cc
 libdns_la_SOURCES += base64.h base64.cc
 libdns_la_SOURCES += base64.h base64.cc
-libdns_la_SOURCES += exceptions.h exceptions.cc
 
 
 rrclass.h: rrclass-placeholder.h
 rrclass.h: rrclass-placeholder.h
 rrtype.h: rrtype-placeholder.h
 rrtype.h: rrtype-placeholder.h
@@ -29,7 +28,7 @@ if HAVE_GTEST
 TESTS += run_unittests
 TESTS += run_unittests
 run_unittests_SOURCES = unittest_util.h unittest_util.cc
 run_unittests_SOURCES = unittest_util.h unittest_util.cc
 run_unittests_SOURCES += buffer_unittest.cc name_unittest.cc
 run_unittests_SOURCES += buffer_unittest.cc name_unittest.cc
-run_unittests_SOURCES += messagerenderer_unittest.cc exceptions_unittest.cc
+run_unittests_SOURCES += messagerenderer_unittest.cc
 run_unittests_SOURCES += rrclass_unittest.cc rrtype_unittest.cc
 run_unittests_SOURCES += rrclass_unittest.cc rrtype_unittest.cc
 run_unittests_SOURCES += rrttl_unittest.cc
 run_unittests_SOURCES += rrttl_unittest.cc
 run_unittests_SOURCES += rdata_unittest.cc
 run_unittests_SOURCES += rdata_unittest.cc
@@ -39,9 +38,10 @@ run_unittests_SOURCES += rrparamregistry_unittest.cc
 run_unittests_SOURCES += message_unittest.cc
 run_unittests_SOURCES += message_unittest.cc
 run_unittests_SOURCES += base64_unittest.cc
 run_unittests_SOURCES += base64_unittest.cc
 run_unittests_SOURCES += run_unittests.cc
 run_unittests_SOURCES += run_unittests.cc
-run_unittests_CPPFLAGS = $(GTEST_INCLUDES)
-run_unittests_LDFLAGS = $(GTEST_LDFLAGS)
+run_unittests_CPPFLAGS = $(AM_CPPFLAGS) $(GTEST_INCLUDES)
+run_unittests_LDFLAGS = $(AM_LDFLAGS) $(GTEST_LDFLAGS)
 run_unittests_LDADD = .libs/libdns.a $(GTEST_LDADD)
 run_unittests_LDADD = .libs/libdns.a $(GTEST_LDADD)
+run_unittests_LDADD +=  $(top_builddir)/src/lib/exceptions/cpp/.libs/libexceptions.a
 endif
 endif
 
 
 noinst_PROGRAMS = $(TESTS)
 noinst_PROGRAMS = $(TESTS)

+ 1 - 1
src/lib/dns/cpp/base64.cc

@@ -24,7 +24,7 @@
 #include <boost/archive/iterators/transform_width.hpp>
 #include <boost/archive/iterators/transform_width.hpp>
 
 
 #include "base64.h"
 #include "base64.h"
-#include "exceptions.h"
+#include <exceptions/exceptions.h>
 
 
 using namespace std;
 using namespace std;
 using namespace boost::archive::iterators;
 using namespace boost::archive::iterators;

+ 2 - 2
src/lib/dns/cpp/base64.h

@@ -20,7 +20,7 @@
 #include <string>
 #include <string>
 #include <vector>
 #include <vector>
 
 
-#include "exceptions.h"
+#include <exceptions/exceptions.h>
 
 
 //
 //
 // Note: this helper module isn't specific to the DNS protocol per se.
 // Note: this helper module isn't specific to the DNS protocol per se.
@@ -38,7 +38,7 @@ namespace dns {
 class BadBase64String : public Exception {
 class BadBase64String : public Exception {
 public:
 public:
     BadBase64String(const char* file, size_t line, const char* what) :
     BadBase64String(const char* file, size_t line, const char* what) :
-        isc::dns::Exception(file, line, what) {}
+        isc::Exception(file, line, what) {}
 };
 };
 
 
 std::string encodeBase64(const std::vector<char>& binary);
 std::string encodeBase64(const std::vector<char>& binary);

+ 2 - 2
src/lib/dns/cpp/buffer.h

@@ -23,7 +23,7 @@
 
 
 #include <stdint.h>
 #include <stdint.h>
 
 
-#include "exceptions.h"
+#include <exceptions/exceptions.h>
 
 
 namespace isc {
 namespace isc {
 namespace dns {
 namespace dns {
@@ -35,7 +35,7 @@ namespace dns {
 class InvalidBufferPosition : public Exception {
 class InvalidBufferPosition : public Exception {
 public:
 public:
     InvalidBufferPosition(const char* file, size_t line, const char* what) :
     InvalidBufferPosition(const char* file, size_t line, const char* what) :
-        isc::dns::Exception(file, line, what) {}
+        isc::Exception(file, line, what) {}
 };
 };
 
 
 ///\brief The \c InputBuffer class is a buffer abstraction for manipulating
 ///\brief The \c InputBuffer class is a buffer abstraction for manipulating

+ 3 - 3
src/lib/dns/cpp/message.h

@@ -22,7 +22,7 @@
 
 
 #include <boost/shared_ptr.hpp>
 #include <boost/shared_ptr.hpp>
 
 
-#include "exceptions.h"
+#include <exceptions/exceptions.h>
 #include "question.h"
 #include "question.h"
 #include "rrset.h"
 #include "rrset.h"
 
 
@@ -35,13 +35,13 @@ namespace dns {
 class MessageTooShort : public Exception {
 class MessageTooShort : public Exception {
 public:
 public:
     MessageTooShort(const char* file, size_t line, const char* what) :
     MessageTooShort(const char* file, size_t line, const char* what) :
-        isc::dns::Exception(file, line, what) {}
+        isc::Exception(file, line, what) {}
 };
 };
 
 
 class InvalidMessageSection : public Exception {
 class InvalidMessageSection : public Exception {
 public:
 public:
     InvalidMessageSection(const char* file, size_t line, const char* what) :
     InvalidMessageSection(const char* file, size_t line, const char* what) :
-        isc::dns::Exception(file, line, what) {}
+        isc::Exception(file, line, what) {}
 };
 };
 
 
 typedef uint8_t rcode_t; // we actually only need 4 bits of it
 typedef uint8_t rcode_t; // we actually only need 4 bits of it

+ 8 - 8
src/lib/dns/cpp/name.h

@@ -22,7 +22,7 @@
 #include <string>
 #include <string>
 #include <vector>
 #include <vector>
 
 
-#include "exceptions.h"
+#include <exceptions/exceptions.h>
 
 
 namespace isc {
 namespace isc {
 namespace dns {
 namespace dns {
@@ -37,7 +37,7 @@ class MessageRenderer;
 class EmptyLabel : public Exception {
 class EmptyLabel : public Exception {
 public:
 public:
     EmptyLabel(const char* file, size_t line, const char* what) :
     EmptyLabel(const char* file, size_t line, const char* what) :
-        isc::dns::Exception(file, line, what) {}
+        isc::Exception(file, line, what) {}
 };
 };
 
 
 ///
 ///
@@ -47,7 +47,7 @@ public:
 class TooLongName : public Exception {
 class TooLongName : public Exception {
 public:
 public:
     TooLongName(const char* file, size_t line, const char* what) :
     TooLongName(const char* file, size_t line, const char* what) :
-        isc::dns::Exception(file, line, what) {}
+        isc::Exception(file, line, what) {}
 };
 };
 
 
 ///
 ///
@@ -57,7 +57,7 @@ public:
 class TooLongLabel : public Exception {
 class TooLongLabel : public Exception {
 public:
 public:
     TooLongLabel(const char* file, size_t line, const char* what) :
     TooLongLabel(const char* file, size_t line, const char* what) :
-        isc::dns::Exception(file, line, what) {}
+        isc::Exception(file, line, what) {}
 };
 };
 
 
 ///
 ///
@@ -69,7 +69,7 @@ public:
 class BadLabelType : public Exception {
 class BadLabelType : public Exception {
 public:
 public:
     BadLabelType(const char* file, size_t line, const char* what) :
     BadLabelType(const char* file, size_t line, const char* what) :
-        isc::dns::Exception(file, line, what) {}
+        isc::Exception(file, line, what) {}
 };
 };
 
 
 ///
 ///
@@ -79,7 +79,7 @@ public:
 class BadEscape : public Exception {
 class BadEscape : public Exception {
 public:
 public:
     BadEscape(const char* file, size_t line, const char* what) :
     BadEscape(const char* file, size_t line, const char* what) :
-        isc::dns::Exception(file, line, what) {}
+        isc::Exception(file, line, what) {}
 };
 };
 
 
 ///
 ///
@@ -89,7 +89,7 @@ public:
 class BadPointer : public Exception {
 class BadPointer : public Exception {
 public:
 public:
     BadPointer(const char* file, size_t line, const char* what) :
     BadPointer(const char* file, size_t line, const char* what) :
-        isc::dns::Exception(file, line, what) {}
+        isc::Exception(file, line, what) {}
 };
 };
 
 
 ///
 ///
@@ -102,7 +102,7 @@ public:
 class IncompleteName : public Exception {
 class IncompleteName : public Exception {
 public:
 public:
     IncompleteName(const char* file, size_t line, const char* what) :
     IncompleteName(const char* file, size_t line, const char* what) :
-        isc::dns::Exception(file, line, what) {}
+        isc::Exception(file, line, what) {}
 };
 };
 
 
 ///
 ///

+ 3 - 3
src/lib/dns/cpp/rdata.h

@@ -41,7 +41,7 @@ namespace rdata {
 class InvalidRdataLength : public Exception {
 class InvalidRdataLength : public Exception {
 public:
 public:
     InvalidRdataLength(const char* file, size_t line, const char* what) :
     InvalidRdataLength(const char* file, size_t line, const char* what) :
-        isc::dns::Exception(file, line, what) {}
+        isc::Exception(file, line, what) {}
 };
 };
 
 
 ///
 ///
@@ -51,7 +51,7 @@ public:
 class InvalidRdataText : public Exception {
 class InvalidRdataText : public Exception {
 public:
 public:
     InvalidRdataText(const char* file, size_t line, const char* what) :
     InvalidRdataText(const char* file, size_t line, const char* what) :
-        isc::dns::Exception(file, line, what) {}
+        isc::Exception(file, line, what) {}
 };
 };
 
 
 ///
 ///
@@ -60,7 +60,7 @@ public:
 class CharStringTooLong : public Exception {
 class CharStringTooLong : public Exception {
 public:
 public:
     CharStringTooLong(const char* file, size_t line, const char* what) :
     CharStringTooLong(const char* file, size_t line, const char* what) :
-        isc::dns::Exception(file, line, what) {}
+        isc::Exception(file, line, what) {}
 };
 };
 
 
 class Rdata;
 class Rdata;

+ 1 - 1
src/lib/dns/cpp/rdata/ch_3/a_1.cc

@@ -17,7 +17,7 @@
 #include <string>
 #include <string>
 
 
 #include "buffer.h"
 #include "buffer.h"
-#include "exceptions.h"
+#include <exceptions/exceptions.h>
 #include "messagerenderer.h"
 #include "messagerenderer.h"
 #include "rdata.h"
 #include "rdata.h"
 #include "rdataclass.h"
 #include "rdataclass.h"

+ 1 - 1
src/lib/dns/cpp/rdata/generic/mx_15.cc

@@ -19,7 +19,7 @@
 #include <boost/lexical_cast.hpp>
 #include <boost/lexical_cast.hpp>
 
 
 #include "buffer.h"
 #include "buffer.h"
-#include "exceptions.h"
+#include <exceptions/exceptions.h>
 #include "name.h"
 #include "name.h"
 #include "messagerenderer.h"
 #include "messagerenderer.h"
 #include "rdata.h"
 #include "rdata.h"

+ 1 - 1
src/lib/dns/cpp/rdata/generic/soa_6.cc

@@ -19,7 +19,7 @@
 #include <boost/lexical_cast.hpp>
 #include <boost/lexical_cast.hpp>
 
 
 #include "buffer.h"
 #include "buffer.h"
-#include "exceptions.h"
+#include <exceptions/exceptions.h>
 #include "name.h"
 #include "name.h"
 #include "messagerenderer.h"
 #include "messagerenderer.h"
 #include "rdata.h"
 #include "rdata.h"

+ 1 - 1
src/lib/dns/cpp/rdata/hs_4/a_1.cc

@@ -17,7 +17,7 @@
 #include <string>
 #include <string>
 
 
 #include "buffer.h"
 #include "buffer.h"
-#include "exceptions.h"
+#include <exceptions/exceptions.h>
 #include "messagerenderer.h"
 #include "messagerenderer.h"
 #include "rdata.h"
 #include "rdata.h"
 #include "rdataclass.h"
 #include "rdataclass.h"

+ 1 - 1
src/lib/dns/cpp/rdata/in_1/a_1.cc

@@ -22,7 +22,7 @@
 #include <arpa/inet.h> // XXX: for inet_pton/ntop(), not exist in C++ standards
 #include <arpa/inet.h> // XXX: for inet_pton/ntop(), not exist in C++ standards
 
 
 #include "buffer.h"
 #include "buffer.h"
-#include "exceptions.h"
+#include <exceptions/exceptions.h>
 #include "messagerenderer.h"
 #include "messagerenderer.h"
 #include "rdata.h"
 #include "rdata.h"
 #include "rdataclass.h"
 #include "rdataclass.h"

+ 1 - 1
src/lib/dns/cpp/rdata/in_1/aaaa_28.cc

@@ -22,7 +22,7 @@
 #include <arpa/inet.h> // XXX: for inet_pton/ntop(), not exist in C++ standards
 #include <arpa/inet.h> // XXX: for inet_pton/ntop(), not exist in C++ standards
 
 
 #include "buffer.h"
 #include "buffer.h"
-#include "exceptions.h"
+#include <exceptions/exceptions.h>
 #include "messagerenderer.h"
 #include "messagerenderer.h"
 #include "rdata.h"
 #include "rdata.h"
 #include "rdataclass.h"
 #include "rdataclass.h"

+ 3 - 3
src/lib/dns/cpp/rrclass-placeholder.h

@@ -17,7 +17,7 @@
 #ifndef __RRCLASS_H
 #ifndef __RRCLASS_H
 #define __RRCLASS_H 1
 #define __RRCLASS_H 1
 
 
-#include "exceptions.h"
+#include <exceptions/exceptions.h>
 
 
 namespace isc {
 namespace isc {
 namespace dns {
 namespace dns {
@@ -34,7 +34,7 @@ class MessageRenderer;
 class InvalidRRClass : public Exception {
 class InvalidRRClass : public Exception {
 public:
 public:
     InvalidRRClass(const char* file, size_t line, const char* what) :
     InvalidRRClass(const char* file, size_t line, const char* what) :
-        isc::dns::Exception(file, line, what) {}
+        isc::Exception(file, line, what) {}
 };
 };
 
 
 ///
 ///
@@ -44,7 +44,7 @@ public:
 class IncompleteRRClass : public Exception {
 class IncompleteRRClass : public Exception {
 public:
 public:
     IncompleteRRClass(const char* file, size_t line, const char* what) :
     IncompleteRRClass(const char* file, size_t line, const char* what) :
-        isc::dns::Exception(file, line, what) {}
+        isc::Exception(file, line, what) {}
 };
 };
 
 
 ///
 ///

+ 1 - 1
src/lib/dns/cpp/rrclass.cc

@@ -19,7 +19,7 @@
 #include <stdint.h>
 #include <stdint.h>
 
 
 #include "buffer.h"
 #include "buffer.h"
-#include "exceptions.h"
+#include <exceptions/exceptions.h>
 #include "messagerenderer.h"
 #include "messagerenderer.h"
 #include "rrparamregistry.h"
 #include "rrparamregistry.h"
 #include "rrclass.h"
 #include "rrclass.h"

+ 1 - 1
src/lib/dns/cpp/rrparamregistry-placeholder.cc

@@ -27,7 +27,7 @@
 
 
 #include <boost/shared_ptr.hpp>
 #include <boost/shared_ptr.hpp>
 
 
-#include "exceptions.h"
+#include <exceptions/exceptions.h>
 #include "rrparamregistry.h"
 #include "rrparamregistry.h"
 #include "rrclass.h"
 #include "rrclass.h"
 #include "rrtype.h"
 #include "rrtype.h"

+ 4 - 4
src/lib/dns/cpp/rrparamregistry.h

@@ -23,7 +23,7 @@
 
 
 #include <boost/shared_ptr.hpp>
 #include <boost/shared_ptr.hpp>
 
 
-#include "exceptions.h"
+#include <exceptions/exceptions.h>
 #include "rdata.h"
 #include "rdata.h"
 
 
 namespace isc {
 namespace isc {
@@ -39,7 +39,7 @@ struct RRParamRegistryImpl;
 class RRTypeExists : public Exception {
 class RRTypeExists : public Exception {
 public:
 public:
     RRTypeExists(const char* file, size_t line, const char* what) :
     RRTypeExists(const char* file, size_t line, const char* what) :
-        isc::dns::Exception(file, line, what) {}
+        isc::Exception(file, line, what) {}
 };
 };
 
 
 ///
 ///
@@ -49,13 +49,13 @@ public:
 class RRClassExists : public Exception {
 class RRClassExists : public Exception {
 public:
 public:
     RRClassExists(const char* file, size_t line, const char* what) :
     RRClassExists(const char* file, size_t line, const char* what) :
-        isc::dns::Exception(file, line, what) {}
+        isc::Exception(file, line, what) {}
 };
 };
 
 
 class InvalidRdataText : public Exception {
 class InvalidRdataText : public Exception {
 public:
 public:
     InvalidRdataText(const char* file, size_t line, const char* what) :
     InvalidRdataText(const char* file, size_t line, const char* what) :
-        isc::dns::Exception(file, line, what) {}
+        isc::Exception(file, line, what) {}
 };
 };
 
 
 namespace rdata {
 namespace rdata {

+ 3 - 3
src/lib/dns/cpp/rrttl.h

@@ -19,7 +19,7 @@
 
 
 #include <stdint.h>
 #include <stdint.h>
 
 
-#include "exceptions.h"
+#include <exceptions/exceptions.h>
 
 
 namespace isc {
 namespace isc {
 namespace dns {
 namespace dns {
@@ -36,7 +36,7 @@ class MessageRenderer;
 class InvalidRRTTL : public Exception {
 class InvalidRRTTL : public Exception {
 public:
 public:
     InvalidRRTTL(const char* file, size_t line, const char* what) :
     InvalidRRTTL(const char* file, size_t line, const char* what) :
-        isc::dns::Exception(file, line, what) {}
+        isc::Exception(file, line, what) {}
 };
 };
 
 
 ///
 ///
@@ -46,7 +46,7 @@ public:
 class IncompleteRRTTL : public Exception {
 class IncompleteRRTTL : public Exception {
 public:
 public:
     IncompleteRRTTL(const char* file, size_t line, const char* what) :
     IncompleteRRTTL(const char* file, size_t line, const char* what) :
-        isc::dns::Exception(file, line, what) {}
+        isc::Exception(file, line, what) {}
 };
 };
 
 
 ///
 ///

+ 3 - 3
src/lib/dns/cpp/rrtype-placeholder.h

@@ -17,7 +17,7 @@
 #ifndef __RRTYPE_H
 #ifndef __RRTYPE_H
 #define __RRTYPE_H 1
 #define __RRTYPE_H 1
 
 
-#include "exceptions.h"
+#include <exceptions/exceptions.h>
 
 
 namespace isc {
 namespace isc {
 namespace dns {
 namespace dns {
@@ -34,7 +34,7 @@ class MessageRenderer;
 class InvalidRRType : public Exception {
 class InvalidRRType : public Exception {
 public:
 public:
     InvalidRRType(const char* file, size_t line, const char* what) :
     InvalidRRType(const char* file, size_t line, const char* what) :
-        isc::dns::Exception(file, line, what) {}
+        isc::Exception(file, line, what) {}
 };
 };
 
 
 ///
 ///
@@ -44,7 +44,7 @@ public:
 class IncompleteRRType : public Exception {
 class IncompleteRRType : public Exception {
 public:
 public:
     IncompleteRRType(const char* file, size_t line, const char* what) :
     IncompleteRRType(const char* file, size_t line, const char* what) :
-        isc::dns::Exception(file, line, what) {}
+        isc::Exception(file, line, what) {}
 };
 };
 
 
 ///
 ///

+ 1 - 1
src/lib/dns/cpp/rrtype.cc

@@ -19,7 +19,7 @@
 #include <stdint.h>
 #include <stdint.h>
 
 
 #include "buffer.h"
 #include "buffer.h"
-#include "exceptions.h"
+#include <exceptions/exceptions.h>
 #include "messagerenderer.h"
 #include "messagerenderer.h"
 #include "rrparamregistry.h"
 #include "rrparamregistry.h"
 #include "rrtype.h"
 #include "rrtype.h"

+ 1 - 0
src/lib/exceptions/Makefile.am

@@ -0,0 +1 @@
+SUBDIRS = cpp

+ 2 - 4
src/lib/dns/cpp/exceptions.cc

@@ -18,15 +18,14 @@
 
 
 #include "exceptions.h"
 #include "exceptions.h"
 
 
-using isc::dns::Exception;
+using isc::Exception;
 
 
 namespace isc {
 namespace isc {
-namespace dns {
 
 
 const char*
 const char*
 Exception::what() const throw()
 Exception::what() const throw()
 {
 {
-    const char* whatstr = "isc::dns::Exception";
+    const char* whatstr = "isc::Exception";
 
 
     // XXX: even though it's very unlikely that c_str() throws an exception,
     // XXX: even though it's very unlikely that c_str() throws an exception,
     // it's still not 100% guaranteed.  To meet the exception specification
     // it's still not 100% guaranteed.  To meet the exception specification
@@ -42,4 +41,3 @@ Exception::what() const throw()
 }
 }
 
 
 }
 }
-}

+ 2 - 4
src/lib/dns/cpp/exceptions.h

@@ -21,7 +21,6 @@
 #include <string>
 #include <string>
 
 
 namespace isc {
 namespace isc {
-namespace dns {
 
 
 ///
 ///
 /// This is a base class for exceptions thrown from the DNS library module.
 /// This is a base class for exceptions thrown from the DNS library module.
@@ -100,7 +99,7 @@ private:
 class OutOfRange : public Exception {
 class OutOfRange : public Exception {
 public:
 public:
     OutOfRange(const char* file, size_t line, const char* what) :
     OutOfRange(const char* file, size_t line, const char* what) :
-        isc::dns::Exception(file, line, what) {}
+        isc::Exception(file, line, what) {}
 };
 };
 
 
 ///
 ///
@@ -110,7 +109,7 @@ public:
 class Unexpected : public Exception {
 class Unexpected : public Exception {
 public:
 public:
     Unexpected(const char* file, size_t line, const char* what) :
     Unexpected(const char* file, size_t line, const char* what) :
-        isc::dns::Exception(file, line, what) {}
+        isc::Exception(file, line, what) {}
 };
 };
 
 
 ///
 ///
@@ -119,7 +118,6 @@ public:
 #define dns_throw(type, args...) throw type(__FILE__, __LINE__, args)
 #define dns_throw(type, args...) throw type(__FILE__, __LINE__, args)
 
 
 }
 }
-}
 #endif // __EXCEPTIONS_H
 #endif // __EXCEPTIONS_H
 
 
 // Local Variables: 
 // Local Variables: 

+ 1 - 1
src/lib/dns/cpp/exceptions_unittest.cc

@@ -21,7 +21,7 @@
 
 
 #include <gtest/gtest.h>
 #include <gtest/gtest.h>
 
 
-using isc::dns::Exception;
+using isc::Exception;
 
 
 namespace {
 namespace {
 
 

+ 24 - 0
src/lib/exceptions/cpp/run_unittests.cc

@@ -0,0 +1,24 @@
+// Copyright (C) 2009  Internet Systems Consortium, Inc. ("ISC")
+//
+// Permission to use, copy, modify, and/or distribute this software for any
+// purpose with or without fee is hereby granted, provided that the above
+// copyright notice and this permission notice appear in all copies.
+//
+// THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+// REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+// AND FITNESS.  IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+// INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+// LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+// OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+// PERFORMANCE OF THIS SOFTWARE.
+
+// $Id: run_unittests.cc 476 2010-01-19 00:29:28Z jinmei $
+
+#include <gtest/gtest.h>
+
+int
+main(int argc, char* argv[])
+{
+    ::testing::InitGoogleTest(&argc, argv);
+    return (RUN_ALL_TESTS());
+}