aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2006-01-27 08:28:04 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2006-01-27 08:28:04 +0000
commit047d1917c262224eb6ea8f66010ba5e672db8658 (patch)
tree3b79115ca755e2c9061cd3fb286084cfb0d41211
parente83a6debcdc44f59e79def90f9190709e9fd9a5a (diff)
downloadpaludis-047d1917c262224eb6ea8f66010ba5e672db8658.tar.gz
paludis-047d1917c262224eb6ea8f66010ba5e672db8658.tar.xz
name_error, configuration_error -> exception
-rw-r--r--paludis/category_name_part.hh2
-rw-r--r--paludis/config_file.hh2
-rw-r--r--paludis/configuration_error.cc36
-rw-r--r--paludis/configuration_error.hh51
-rw-r--r--paludis/default_config.hh3
-rw-r--r--paludis/exception.cc10
-rw-r--r--paludis/exception.hh36
-rw-r--r--paludis/files.m42
-rw-r--r--paludis/key_value_config_file_TEST.cc2
-rw-r--r--paludis/keyword_name.hh5
-rw-r--r--paludis/name_error.cc28
-rw-r--r--paludis/name_error.hh54
-rw-r--r--paludis/package_name_part.hh2
-rw-r--r--paludis/qualified_package_name.hh2
-rw-r--r--paludis/qualified_package_name_TEST.cc2
-rw-r--r--paludis/repository_name.hh5
-rw-r--r--paludis/slot_name.hh2
-rw-r--r--paludis/use_flag_name.hh2
-rw-r--r--paludis/version_spec.hh2
19 files changed, 62 insertions, 186 deletions
diff --git a/paludis/category_name_part.hh b/paludis/category_name_part.hh
index d311955..f4be7ce 100644
--- a/paludis/category_name_part.hh
+++ b/paludis/category_name_part.hh
@@ -21,7 +21,7 @@
#define PALUDIS_GUARD_PALUDIS_CATEGORY_NAME_PART_HH 1
#include <paludis/validated.hh>
-#include <paludis/name_error.hh>
+#include <paludis/exception.hh>
#include <paludis/private_implementation_pattern.hh>
#include <paludis/sorted_collection.hh>
#include <string>
diff --git a/paludis/config_file.hh b/paludis/config_file.hh
index 85f0aa6..98ce373 100644
--- a/paludis/config_file.hh
+++ b/paludis/config_file.hh
@@ -22,7 +22,7 @@
#define PALUDIS_GUARD_PALUDIS_CONFIG_FILE_HH 1
#include <paludis/instantiation_policy.hh>
-#include <paludis/configuration_error.hh>
+#include <paludis/exception.hh>
#include <istream>
#include <list>
#include <string>
diff --git a/paludis/configuration_error.cc b/paludis/configuration_error.cc
deleted file mode 100644
index 1d8c15a..0000000
--- a/paludis/configuration_error.cc
+++ /dev/null
@@ -1,36 +0,0 @@
-/* vim: set sw=4 sts=4 et foldmethod=syntax : */
-
-/*
- * Copyright (c) 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 as published by the Free Software Foundation; either version
- * 2 of the License, or (at your option) any later version.
- *
- * 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 "configuration_error.hh"
-
-using namespace paludis;
-
-/** \file
- * Implementation of ConfigurationError.
- *
- * \ingroup ConfigFile
- * \ingroup Exception
- */
-
-ConfigurationError::ConfigurationError(const std::string & msg) throw () :
- Exception(msg)
-{
-}
-
diff --git a/paludis/configuration_error.hh b/paludis/configuration_error.hh
deleted file mode 100644
index 4f55af7..0000000
--- a/paludis/configuration_error.hh
+++ /dev/null
@@ -1,51 +0,0 @@
-/* vim: set sw=4 sts=4 et foldmethod=syntax : */
-
-/*
- * Copyright (c) 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 as published by the Free Software Foundation; either version
- * 2 of the License, or (at your option) any later version.
- *
- * 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_CONFIGURATION_ERROR_HH
-#define PALUDIS_GUARD_PALUDIS_CONFIGURATION_ERROR_HH 1
-
-#include <paludis/exception.hh>
-
-/** \file
- * Declarations for the ConfigurationError class.
- *
- * \ingroup Exception
- * \ingroup ConfigFile
- */
-
-namespace paludis
-{
- /**
- * A ConfigurationError is thrown when an invalid configuration occurs.
- *
- * \ingroup Exception
- * \ingroup ConfigFile
- */
- class ConfigurationError : public Exception
- {
- protected:
- /**
- * Constructor.
- */
- ConfigurationError(const std::string & msg) throw ();
- };
-}
-
-#endif
diff --git a/paludis/default_config.hh b/paludis/default_config.hh
index ce25fce..f513f7d 100644
--- a/paludis/default_config.hh
+++ b/paludis/default_config.hh
@@ -21,7 +21,7 @@
#ifndef PALUDIS_GUARD_PALUDIS_DEFAULT_CONFIG_HH
#define PALUDIS_GUARD_PALUDIS_DEFAULT_CONFIG_HH 1
-#include <paludis/configuration_error.hh>
+#include <paludis/exception.hh>
#include <paludis/fs_entry.hh>
#include <paludis/indirect_iterator.hh>
#include <paludis/instantiation_policy.hh>
@@ -31,6 +31,7 @@
#include <paludis/smart_record.hh>
#include <paludis/use_flag_name.hh>
#include <paludis/use_flag_state.hh>
+
#include <map>
#include <vector>
diff --git a/paludis/exception.cc b/paludis/exception.cc
index af56576..9104969 100644
--- a/paludis/exception.cc
+++ b/paludis/exception.cc
@@ -46,3 +46,13 @@ InternalError::InternalError(const std::string & where) throw () :
{
}
+NameError::NameError(const std::string & name, const std::string & role) throw () :
+ Exception("Name '" + name + "' is not a valid " + role)
+{
+}
+
+ConfigurationError::ConfigurationError(const std::string & msg) throw () :
+ Exception(msg)
+{
+}
+
diff --git a/paludis/exception.hh b/paludis/exception.hh
index 7292496..da6f1cb 100644
--- a/paludis/exception.hh
+++ b/paludis/exception.hh
@@ -29,7 +29,7 @@
/** \file
* Declaration for the Exception base class, the InternalError exception
- * class and related utilities.
+ * class, the NameError class and related utilities.
*
* \ingroup Exception
*/
@@ -110,6 +110,40 @@ namespace paludis
*/
InternalError(const std::string & where) throw () PALUDIS_ATTRIBUTE((deprecated));
};
+
+ /**
+ * A NameError is an Exception that is thrown when some kind of invalid
+ * name is encountered.
+ *
+ * \ingroup Exception
+ * \ingroup Database
+ */
+ class NameError : public Exception
+ {
+ protected:
+ /**
+ * Constructor.
+ *
+ * \param name The invalid name encountered.
+ * \param role The role for the name, for example "package name".
+ */
+ NameError(const std::string & name, const std::string & role) throw ();
+ };
+
+ /**
+ * A ConfigurationError is thrown when an invalid configuration occurs.
+ *
+ * \ingroup Exception
+ * \ingroup ConfigFile
+ */
+ class ConfigurationError : public Exception
+ {
+ protected:
+ /**
+ * Constructor.
+ */
+ ConfigurationError(const std::string & msg) throw ();
+ };
}
/** \def PALUDIS_HERE
diff --git a/paludis/files.m4 b/paludis/files.m4
index 8f706bb..cc33947 100644
--- a/paludis/files.m4
+++ b/paludis/files.m4
@@ -19,7 +19,6 @@ add(`comparison_policy', `hh', `cc', `test')
add(`composite_dep_atom', `hh', `cc')
add(`composite_pattern', `hh', `cc')
add(`config_file', `hh', `cc', `test', `testscript')
-add(`configuration_error', `hh', `cc')
add(`container_entry', `hh', `cc', `test')
add(`counted_ptr', `hh', `cc', `test')
add(`create_insert_iterator', `hh', `cc', `test')
@@ -50,7 +49,6 @@ add(`keyword_name', `hh', `cc')
add(`line_config_file', `hh', `cc', `test')
add(`mask_reasons', `hh', `cc')
add(`match_package', `hh', `cc')
-add(`name_error', `hh', `cc')
add(`package_database', `hh', `cc', `test')
add(`package_dep_atom', `hh', `cc')
add(`package_name_part', `hh', `cc', `test')
diff --git a/paludis/key_value_config_file_TEST.cc b/paludis/key_value_config_file_TEST.cc
index 419d913..2cab299 100644
--- a/paludis/key_value_config_file_TEST.cc
+++ b/paludis/key_value_config_file_TEST.cc
@@ -20,7 +20,7 @@
#include "stringify.hh"
#include "key_value_config_file.hh"
-#include "configuration_error.hh"
+#include "exception.hh"
#include <test/test_framework.hh>
#include <test/test_runner.hh>
#include <vector>
diff --git a/paludis/keyword_name.hh b/paludis/keyword_name.hh
index 0cf8ba2..2c7919d 100644
--- a/paludis/keyword_name.hh
+++ b/paludis/keyword_name.hh
@@ -20,9 +20,10 @@
#ifndef PALUDIS_GUARD_PALUDIS_KEYWORD_NAME_HH
#define PALUDIS_GUARD_PALUDIS_KEYWORD_NAME_HH 1
-#include <paludis/validated.hh>
+#include <paludis/exception.hh>
#include <paludis/instantiation_policy.hh>
-#include <paludis/name_error.hh>
+#include <paludis/validated.hh>
+
#include <string>
/** \file
diff --git a/paludis/name_error.cc b/paludis/name_error.cc
deleted file mode 100644
index ff9ffe8..0000000
--- a/paludis/name_error.cc
+++ /dev/null
@@ -1,28 +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 "name_error.hh"
-
-using namespace paludis;
-
-NameError::NameError(const std::string & name, const std::string & role) throw () :
- Exception("Name '" + name + "' is not a valid " + role)
-{
-}
-
diff --git a/paludis/name_error.hh b/paludis/name_error.hh
deleted file mode 100644
index 19c75fe..0000000
--- a/paludis/name_error.hh
+++ /dev/null
@@ -1,54 +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_NAME_ERROR_HH
-#define PALUDIS_GUARD_PALUDIS_NAME_ERROR_HH 1
-
-#include <paludis/exception.hh>
-
-/** \file
- * Declaration for the NameError exception class.
- *
- * \ingroup Database
- * \ingroup Exception
- */
-
-namespace paludis
-{
- /**
- * A NameError is an Exception that is thrown when some kind of invalid
- * name is encountered.
- *
- * \ingroup Database
- * \ingroup Exception
- */
- class NameError : public Exception
- {
- protected:
- /**
- * Constructor.
- *
- * \param name The invalid name encountered.
- * \param role The role for the name, for example "package name".
- */
- NameError(const std::string & name, const std::string & role) throw ();
- };
-}
-
-#endif
diff --git a/paludis/package_name_part.hh b/paludis/package_name_part.hh
index e6fa04a..5002e1d 100644
--- a/paludis/package_name_part.hh
+++ b/paludis/package_name_part.hh
@@ -21,7 +21,7 @@
#define PALUDIS_GUARD_PALUDIS_PACKAGE_NAME_PART_HH 1
#include <paludis/validated.hh>
-#include <paludis/name_error.hh>
+#include <paludis/exception.hh>
#include <paludis/private_implementation_pattern.hh>
#include <paludis/sorted_collection.hh>
#include <string>
diff --git a/paludis/qualified_package_name.hh b/paludis/qualified_package_name.hh
index 9528f77..9faef6e 100644
--- a/paludis/qualified_package_name.hh
+++ b/paludis/qualified_package_name.hh
@@ -24,7 +24,7 @@
#include <paludis/category_name_part.hh>
#include <paludis/smart_record.hh>
#include <paludis/sorted_collection.hh>
-#include <paludis/name_error.hh>
+#include <paludis/exception.hh>
#include <ostream>
namespace paludis
diff --git a/paludis/qualified_package_name_TEST.cc b/paludis/qualified_package_name_TEST.cc
index 50e5011..e77ed25 100644
--- a/paludis/qualified_package_name_TEST.cc
+++ b/paludis/qualified_package_name_TEST.cc
@@ -18,7 +18,7 @@
*/
#include "qualified_package_name.hh"
-#include "name_error.hh"
+#include "exception.hh"
#include <test/test_runner.hh>
#include <test/test_framework.hh>
diff --git a/paludis/repository_name.hh b/paludis/repository_name.hh
index 316a3b0..f698bf2 100644
--- a/paludis/repository_name.hh
+++ b/paludis/repository_name.hh
@@ -20,10 +20,11 @@
#ifndef PALUDIS_GUARD_PALUDIS_REPOSITORY_NAME_HH
#define PALUDIS_GUARD_PALUDIS_REPOSITORY_NAME_HH 1
-#include <paludis/validated.hh>
+#include <paludis/exception.hh>
#include <paludis/private_implementation_pattern.hh>
-#include <paludis/name_error.hh>
#include <paludis/sequential_collection.hh>
+#include <paludis/validated.hh>
+
#include <string>
/** \file
diff --git a/paludis/slot_name.hh b/paludis/slot_name.hh
index ad63b85..b323964 100644
--- a/paludis/slot_name.hh
+++ b/paludis/slot_name.hh
@@ -21,7 +21,7 @@
#define PALUDIS_GUARD_PALUDIS_SLOT_NAME_HH 1
#include <paludis/validated.hh>
-#include <paludis/name_error.hh>
+#include <paludis/exception.hh>
#include <paludis/instantiation_policy.hh>
#include <string>
diff --git a/paludis/use_flag_name.hh b/paludis/use_flag_name.hh
index 8cb53a3..6862261 100644
--- a/paludis/use_flag_name.hh
+++ b/paludis/use_flag_name.hh
@@ -21,7 +21,7 @@
#define PALUDIS_GUARD_PALUDIS_USE_FLAG_NAME_HH 1
#include <paludis/validated.hh>
-#include <paludis/name_error.hh>
+#include <paludis/exception.hh>
#include <paludis/instantiation_policy.hh>
#include <string>
diff --git a/paludis/version_spec.hh b/paludis/version_spec.hh
index c56dd8a..50ff83e 100644
--- a/paludis/version_spec.hh
+++ b/paludis/version_spec.hh
@@ -23,7 +23,7 @@
#include <paludis/private_implementation_pattern.hh>
#include <paludis/comparison_policy.hh>
#include <paludis/sorted_collection.hh>
-#include <paludis/name_error.hh>
+#include <paludis/exception.hh>
#include <string>
#include <ostream>