aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2006-01-22 09:21:23 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2006-01-22 09:21:23 +0000
commit9257ae6f20703e24aa68ecc8a24650b140d9b0c3 (patch)
tree64cb5fa4d5eb2e1143050b52d16ef1d515347398
parentbe5e1cc9efe01c9648ada47f2aaa5dcbd9ca8434 (diff)
downloadpaludis-9257ae6f20703e24aa68ecc8a24650b140d9b0c3.tar.gz
paludis-9257ae6f20703e24aa68ecc8a24650b140d9b0c3.tar.xz
We don't really need sixty zillion files for version_spec either.
-rw-r--r--paludis/bad_version_spec_error.cc28
-rw-r--r--paludis/bad_version_spec_error.hh50
-rw-r--r--paludis/fake_repository.cc1
-rw-r--r--paludis/files.m42
-rw-r--r--paludis/repository.hh2
-rw-r--r--paludis/version_spec.cc6
-rw-r--r--paludis/version_spec.hh22
-rw-r--r--paludis/version_spec_TEST.cc1
-rw-r--r--paludis/version_spec_collection.cc31
-rw-r--r--paludis/version_spec_collection.hh46
10 files changed, 28 insertions, 161 deletions
diff --git a/paludis/bad_version_spec_error.cc b/paludis/bad_version_spec_error.cc
deleted file mode 100644
index e283554..0000000
--- a/paludis/bad_version_spec_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 "bad_version_spec_error.hh"
-
-using namespace paludis;
-
-BadVersionSpecError::BadVersionSpecError(const std::string & name) throw () :
- NameError(name, "version spec")
-{
-}
-
diff --git a/paludis/bad_version_spec_error.hh b/paludis/bad_version_spec_error.hh
deleted file mode 100644
index b9b1059..0000000
--- a/paludis/bad_version_spec_error.hh
+++ /dev/null
@@ -1,50 +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_BAD_VERSION_SPEC_ERROR_HH
-#define PALUDIS_GUARD_PALUDIS_BAD_VERSION_SPEC_ERROR_HH 1
-
-#include <paludis/name_error.hh>
-
-/** \file
- * Declarations for the VersionSpec class.
- *
- * \ingroup Exception
- * \ingroup Database
- */
-
-namespace paludis
-{
- /**
- * Thrown if a VersionSpec is created from an invalid version string.
- *
- * \ingroup Exception
- * \ingroup Database
- */
- class BadVersionSpecError : public NameError
- {
- public:
- /**
- * Constructor.
- */
- BadVersionSpecError(const std::string & name) throw ();
- };
-}
-
-#endif
diff --git a/paludis/fake_repository.cc b/paludis/fake_repository.cc
index 53149b4..63f6b23 100644
--- a/paludis/fake_repository.cc
+++ b/paludis/fake_repository.cc
@@ -19,7 +19,6 @@
#include "fake_repository.hh"
#include "package_name_part_collection.hh"
-#include "version_spec_collection.hh"
#include "version_metadata.hh"
#include "stringify.hh"
#include <map>
diff --git a/paludis/files.m4 b/paludis/files.m4
index e466d31..19aa72f 100644
--- a/paludis/files.m4
+++ b/paludis/files.m4
@@ -12,7 +12,6 @@ add(`about', `hh', `test')
add(`all_dep_atom', `hh', `cc')
add(`any_dep_atom', `hh', `cc')
add(`attributes', `hh', `cc')
-add(`bad_version_spec_error', `hh', `cc')
add(`block_dep_atom', `hh', `cc')
add(`category_name_part', `hh', `cc')
add(`category_name_part_collection', `hh', `cc')
@@ -91,7 +90,6 @@ add(`validated', `hh', `cc', `test')
add(`version_metadata', `hh', `cc')
add(`version_operator', `hh', `cc', `test')
add(`version_spec', `hh', `cc', `test')
-add(`version_spec_collection', `hh', `cc')
add(`virtual_constructor', `hh', `cc', `test')
add(`visitor', `hh', `cc', `test')
diff --git a/paludis/repository.hh b/paludis/repository.hh
index 9de635d..62191aa 100644
--- a/paludis/repository.hh
+++ b/paludis/repository.hh
@@ -26,9 +26,9 @@
#include <paludis/package_name_part.hh>
#include <paludis/category_name_part_collection.hh>
#include <paludis/qualified_package_name_collection.hh>
-#include <paludis/version_spec_collection.hh>
#include <paludis/counted_ptr.hh>
#include <paludis/version_metadata.hh>
+#include <paludis/version_spec.hh>
#include <paludis/use_flag_state.hh>
#include <map>
#include <string>
diff --git a/paludis/version_spec.cc b/paludis/version_spec.cc
index eece4f8..e4140ed 100644
--- a/paludis/version_spec.cc
+++ b/paludis/version_spec.cc
@@ -18,12 +18,16 @@
*/
#include "version_spec.hh"
-#include "bad_version_spec_error.hh"
#include "exception.hh"
#include <algorithm>
using namespace paludis;
+BadVersionSpecError::BadVersionSpecError(const std::string & name) throw () :
+ NameError(name, "version spec")
+{
+}
+
enum SuffixPart
{
alpha,
diff --git a/paludis/version_spec.hh b/paludis/version_spec.hh
index ac4aadc..0a41714 100644
--- a/paludis/version_spec.hh
+++ b/paludis/version_spec.hh
@@ -22,12 +22,29 @@
#include <paludis/private_implementation_pattern.hh>
#include <paludis/comparison_policy.hh>
+#include <paludis/sorted_collection.hh>
+#include <paludis/name_error.hh>
#include <string>
#include <ostream>
namespace paludis
{
/**
+ * Thrown if a VersionSpec is created from an invalid version string.
+ *
+ * \ingroup Exception
+ * \ingroup Database
+ */
+ class BadVersionSpecError : public NameError
+ {
+ public:
+ /**
+ * Constructor.
+ */
+ BadVersionSpecError(const std::string & name) throw ();
+ };
+
+ /**
* A VersionSpec represents a version number (for example, 1.2.3b-r1).
*/
class VersionSpec : private PrivateImplementationPattern<VersionSpec>,
@@ -84,6 +101,11 @@ namespace paludis
* Output a VersionSpec to a stream.
*/
std::ostream & operator<< (std::ostream &, const VersionSpec &);
+
+ /**
+ * Holds a collection of VersionSpec instances.
+ */
+ typedef SortedCollection<VersionSpec> VersionSpecCollection;
}
#endif
diff --git a/paludis/version_spec_TEST.cc b/paludis/version_spec_TEST.cc
index e9e7e74..bcee052 100644
--- a/paludis/version_spec_TEST.cc
+++ b/paludis/version_spec_TEST.cc
@@ -20,7 +20,6 @@
#include "version_spec.hh"
#include <test/test_framework.hh>
#include <test/test_runner.hh>
-#include "bad_version_spec_error.hh"
using namespace test;
using namespace paludis;
diff --git a/paludis/version_spec_collection.cc b/paludis/version_spec_collection.cc
deleted file mode 100644
index 4b81e32..0000000
--- a/paludis/version_spec_collection.cc
+++ /dev/null
@@ -1,31 +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 "version_spec_collection.hh"
-
-using namespace paludis;
-
-VersionSpecCollection::VersionSpecCollection()
-{
-}
-
-VersionSpecCollection::~VersionSpecCollection()
-{
-}
-
diff --git a/paludis/version_spec_collection.hh b/paludis/version_spec_collection.hh
deleted file mode 100644
index 27bd085..0000000
--- a/paludis/version_spec_collection.hh
+++ /dev/null
@@ -1,46 +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_VERSION_SPEC_COLLECTION_HH
-#define PALUDIS_GUARD_PALUDIS_VERSION_SPEC_COLLECTION_HH 1
-
-#include <paludis/version_spec.hh>
-#include <paludis/sorted_collection.hh>
-
-namespace paludis
-{
- /**
- * Holds a collection of VersionSpec instances.
- */
- class VersionSpecCollection : public SortedCollection<VersionSpec>
- {
- public:
- /**
- * Constructor.
- */
- VersionSpecCollection();
-
- /**
- * Destructor.
- */
- virtual ~VersionSpecCollection();
- };
-}
-
-#endif