aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2006-01-21 19:20:02 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2006-01-21 19:20:02 +0000
commitab4ad3f5c900baab0d66cdcd4ba72a2b1d5c18b9 (patch)
tree115bda04d544c71322a902b2b26ed26c3579a283
parentb373502b50935e9b068b0dc344bf81273de216dd (diff)
downloadpaludis-ab4ad3f5c900baab0d66cdcd4ba72a2b1d5c18b9.tar.gz
paludis-ab4ad3f5c900baab0d66cdcd4ba72a2b1d5c18b9.tar.xz
internal_error might as well be part of exception, since we're on a file tidyup anyway...
-rw-r--r--paludis/default_environment.cc1
-rw-r--r--paludis/dep_list.cc1
-rw-r--r--paludis/dep_parser.cc1
-rw-r--r--paludis/dir_iterator.cc1
-rw-r--r--paludis/environment.cc1
-rw-r--r--paludis/exception.cc10
-rw-r--r--paludis/exception.hh55
-rw-r--r--paludis/fake_repository.cc1
-rw-r--r--paludis/files.m41
-rw-r--r--paludis/fs_entry.cc1
-rw-r--r--paludis/internal_error.cc33
-rw-r--r--paludis/internal_error.hh63
-rw-r--r--paludis/key_value_config_file.cc1
-rw-r--r--paludis/package_database.cc1
-rw-r--r--paludis/package_dep_atom.cc1
-rw-r--r--paludis/portage_repository.cc1
-rw-r--r--paludis/version_operator.cc1
17 files changed, 62 insertions, 112 deletions
diff --git a/paludis/default_environment.cc b/paludis/default_environment.cc
index 625b4d5..89b3112 100644
--- a/paludis/default_environment.cc
+++ b/paludis/default_environment.cc
@@ -23,7 +23,6 @@
#include "portage_repository.hh"
#include "default_config.hh"
#include "stringify.hh"
-#include "internal_error.hh"
#include <list>
#include <vector>
diff --git a/paludis/dep_list.cc b/paludis/dep_list.cc
index b6846da..c701849 100644
--- a/paludis/dep_list.cc
+++ b/paludis/dep_list.cc
@@ -24,7 +24,6 @@
#include "all_masked_error.hh"
#include "no_resolvable_option_error.hh"
#include "circular_dependency_error.hh"
-#include "internal_error.hh"
#include "all_dep_atom.hh"
#include "any_dep_atom.hh"
#include "block_dep_atom.hh"
diff --git a/paludis/dep_parser.cc b/paludis/dep_parser.cc
index f2b2d20..b946aa3 100644
--- a/paludis/dep_parser.cc
+++ b/paludis/dep_parser.cc
@@ -18,7 +18,6 @@
*/
#include "exception.hh"
-#include "internal_error.hh"
#include "stringify.hh"
#include "dep_string_parse_error.hh"
#include "dep_string_nesting_error.hh"
diff --git a/paludis/dir_iterator.cc b/paludis/dir_iterator.cc
index c7a1dda..6dcde27 100644
--- a/paludis/dir_iterator.cc
+++ b/paludis/dir_iterator.cc
@@ -19,7 +19,6 @@
#include "dir_iterator.hh"
#include "dir_open_error.hh"
-#include "internal_error.hh"
#include "stringify.hh"
#include <sys/types.h>
#include <dirent.h>
diff --git a/paludis/environment.cc b/paludis/environment.cc
index 0c7fe79..c58f61b 100644
--- a/paludis/environment.cc
+++ b/paludis/environment.cc
@@ -19,7 +19,6 @@
#include "package_database.hh"
#include "environment.hh"
-#include "internal_error.hh"
using namespace paludis;
diff --git a/paludis/exception.cc b/paludis/exception.cc
index 346df8f..af56576 100644
--- a/paludis/exception.cc
+++ b/paludis/exception.cc
@@ -36,3 +36,13 @@ Exception::message() const throw ()
return _message;
}
+InternalError::InternalError(const std::string & where, const std::string & message) throw () :
+ Exception("Eek! Internal error at " + where + ": " + message)
+{
+}
+
+InternalError::InternalError(const std::string & where) throw () :
+ Exception("Eek! Internal error at " + where)
+{
+}
+
diff --git a/paludis/exception.hh b/paludis/exception.hh
index b6b9003..f3dbb09 100644
--- a/paludis/exception.hh
+++ b/paludis/exception.hh
@@ -21,19 +21,25 @@
#define PALUDIS_GUARD_PALUDIS_EXCEPTION_HH 1
#include <paludis/attributes.hh>
+#include <paludis/stringify.hh>
#include <string>
#include <exception>
#include <libebt/libebt.hh>
/** \file
- * Declaration for the Exception base class.
+ * Declaration for the Exception base class, the InternalError exception
+ * class and related utilities.
+ *
+ * \ingroup Exception
*/
namespace paludis
{
/**
* Context tag for libebt.
+ *
+ * \ingroup Exception
*/
struct PaludisBacktraceTag
{
@@ -41,14 +47,19 @@ namespace paludis
/**
* Backtrace context class.
+ *
+ * \ingroup Exception
*/
typedef libebt::BacktraceContext<PaludisBacktraceTag> Context;
/**
* Base exception class.
+ *
+ * \ingroup Exception
*/
- class Exception : public std::exception,
- public libebt::Backtraceable<PaludisBacktraceTag>
+ class Exception :
+ public std::exception,
+ public libebt::Backtraceable<PaludisBacktraceTag>
{
private:
const std::string _message;
@@ -70,6 +81,44 @@ namespace paludis
*/
const std::string & message() const throw () PALUDIS_ATTRIBUTE((nothrow));
};
+
+ /**
+ * An InternalError is an Exception that is thrown if something that is
+ * never supposed to happen happens.
+ *
+ * \ingroup Exception
+ */
+ class InternalError : public Exception
+ {
+ public:
+ /**
+ * Constructor.
+ *
+ * \param function Should be set to the PALUDIS_HERE macro.
+ *
+ * \param message A short message.
+ */
+ InternalError(const std::string & where, const std::string & message) throw ();
+
+ /**
+ * Constructor, with no message (deprecated).
+ *
+ * \param function Should be set to the PALUDIS_HERE macro.
+ *
+ * \deprecated Use paludis::InternalError::InternalError(const char * const,
+ * const std::string &) instead.
+ */
+ InternalError(const std::string & where) throw () PALUDIS_ATTRIBUTE((deprecated));
+ };
}
+/** \def PALUDIS_HERE
+ * Expands to the current function name, file and line, for use with
+ * paludis::InternalError.
+ *
+ * \ingroup Exception
+ */
+#define PALUDIS_HERE (paludis::stringify(__PRETTY_FUNCTION__) + " at " + \
+ paludis::stringify(__FILE__) + ":" + paludis::stringify(__LINE__))
+
#endif
diff --git a/paludis/fake_repository.cc b/paludis/fake_repository.cc
index 784e0e2..53149b4 100644
--- a/paludis/fake_repository.cc
+++ b/paludis/fake_repository.cc
@@ -20,7 +20,6 @@
#include "fake_repository.hh"
#include "package_name_part_collection.hh"
#include "version_spec_collection.hh"
-#include "internal_error.hh"
#include "version_metadata.hh"
#include "stringify.hh"
#include <map>
diff --git a/paludis/files.m4 b/paludis/files.m4
index 5a114b1..c527046 100644
--- a/paludis/files.m4
+++ b/paludis/files.m4
@@ -59,7 +59,6 @@ add(`fs_error', `hh', `cc')
add(`getenv', `hh', `cc', `test')
add(`indirect_iterator', `hh', `cc', `test')
add(`instantiation_policy', `hh', `cc', `test')
-add(`internal_error', `hh', `cc')
add(`is_const', `hh', `cc', `test')
add(`is_file_with_extension', `hh', `cc', `test', `testscript')
add(`iterator_utilities', `hh', `cc')
diff --git a/paludis/fs_entry.cc b/paludis/fs_entry.cc
index 3cad06a..4fbf84a 100644
--- a/paludis/fs_entry.cc
+++ b/paludis/fs_entry.cc
@@ -20,7 +20,6 @@
#include "fs_entry.hh"
#include "fs_error.hh"
#include "exception.hh"
-#include "internal_error.hh"
#include "stringify.hh"
#include <sys/stat.h>
diff --git a/paludis/internal_error.cc b/paludis/internal_error.cc
deleted file mode 100644
index 0bb6d5f..0000000
--- a/paludis/internal_error.cc
+++ /dev/null
@@ -1,33 +0,0 @@
-/* vim: set sw=4 sts=4 et foldmethod=syntax : */
-
-/*
- * Copyright (c) 2005, 2006 Ciaran McCreesh <ciaranm@gentoo.org>
- *
- * This file is part of the Paludis package manager. Paludis is free software;
- * you can redistribute it and/or modify it under the terms of the GNU General
- * Public License version 2, as published by the Free Software Foundation.
- *
- * Paludis is distributed in the hope that it will be useful, but WITHOUT ANY
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
- * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
- * details.
- *
- * You should have received a copy of the GNU General Public License along with
- * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
- * Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-#include "internal_error.hh"
-
-using namespace paludis;
-
-InternalError::InternalError(const std::string & where, const std::string & message) throw () :
- Exception("Eek! Internal error at " + where + ": " + message)
-{
-}
-
-InternalError::InternalError(const std::string & where) throw () :
- Exception("Eek! Internal error at " + where)
-{
-}
-
diff --git a/paludis/internal_error.hh b/paludis/internal_error.hh
deleted file mode 100644
index 26153af..0000000
--- a/paludis/internal_error.hh
+++ /dev/null
@@ -1,63 +0,0 @@
-/* vim: set sw=4 sts=4 et foldmethod=syntax : */
-
-/*
- * Copyright (c) 2005, 2006 Ciaran McCreesh <ciaranm@gentoo.org>
- *
- * This file is part of the Paludis package manager. Paludis is free software;
- * you can redistribute it and/or modify it under the terms of the GNU General
- * Public License version 2, as published by the Free Software Foundation.
- *
- * Paludis is distributed in the hope that it will be useful, but WITHOUT ANY
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
- * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
- * details.
- *
- * You should have received a copy of the GNU General Public License along with
- * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
- * Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-#ifndef PALUDIS_GUARD_PALUDIS_INTERNAL_ERROR_HH
-#define PALUDIS_GUARD_PALUDIS_INTERNAL_ERROR_HH 1
-
-#include <paludis/exception.hh>
-#include <paludis/stringify.hh>
-
-/** \file
- * Declaration for the InternalError exception class.
- */
-
-namespace paludis
-{
- /**
- * An InternalError is an Exception that is thrown if something that is
- * never supposed to happen happens.
- */
- class InternalError : public Exception
- {
- public:
- /**
- * Constructor.
- *
- * \param function Should be set to the PALUDIS_HERE macro.
- *
- * \param message A short message.
- */
- InternalError(const std::string & where, const std::string & message) throw ();
-
- /**
- * Constructor, with no message (deprecated).
- *
- * \param function Should be set to the PALUDIS_HERE macro.
- *
- * \deprecated Use paludis::InternalError::InternalError(const char * const,
- * const std::string &) instead.
- */
- InternalError(const std::string & where) throw () PALUDIS_ATTRIBUTE((deprecated));
- };
-}
-
-#define PALUDIS_HERE (paludis::stringify(__PRETTY_FUNCTION__) + " at " + \
- paludis::stringify(__FILE__) + ":" + paludis::stringify(__LINE__))
-
-#endif
diff --git a/paludis/key_value_config_file.cc b/paludis/key_value_config_file.cc
index 47bd0a3..468728b 100644
--- a/paludis/key_value_config_file.cc
+++ b/paludis/key_value_config_file.cc
@@ -20,7 +20,6 @@
#include "key_value_config_file.hh"
#include "key_value_config_file_error.hh"
-#include "internal_error.hh"
using namespace paludis;
diff --git a/paludis/package_database.cc b/paludis/package_database.cc
index 3e0d96f..a40c74a 100644
--- a/paludis/package_database.cc
+++ b/paludis/package_database.cc
@@ -21,7 +21,6 @@
#include "no_such_package_error.hh"
#include "no_such_repository_error.hh"
#include "no_such_version_error.hh"
-#include "internal_error.hh"
#include "duplicate_repository_error.hh"
#include "ambiguous_package_name_error.hh"
#include "package_dep_atom.hh"
diff --git a/paludis/package_dep_atom.cc b/paludis/package_dep_atom.cc
index 319fadd..7516c5b 100644
--- a/paludis/package_dep_atom.cc
+++ b/paludis/package_dep_atom.cc
@@ -19,7 +19,6 @@
#include "exception.hh"
#include "stringify.hh"
-#include "internal_error.hh"
#include "all_dep_atom.hh"
#include "any_dep_atom.hh"
#include "use_dep_atom.hh"
diff --git a/paludis/portage_repository.cc b/paludis/portage_repository.cc
index 304cc39..c4e80e7 100644
--- a/paludis/portage_repository.cc
+++ b/paludis/portage_repository.cc
@@ -20,7 +20,6 @@
#include "portage_repository.hh"
#include "dir_iterator.hh"
#include "stringify.hh"
-#include "internal_error.hh"
#include "fs_entry.hh"
#include "strip.hh"
#include "is_file_with_extension.hh"
diff --git a/paludis/version_operator.cc b/paludis/version_operator.cc
index 12212e0..84245d8 100644
--- a/paludis/version_operator.cc
+++ b/paludis/version_operator.cc
@@ -18,7 +18,6 @@
*/
#include "version_operator.hh"
-#include "internal_error.hh"
#include "stringify.hh"
using namespace paludis;