aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2010-08-05 11:20:28 +0100
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2010-08-05 11:20:28 +0100
commit7e6a6b75c37cde0050e004df37871f0697a0321b (patch)
tree6e614098ab5f3ae533dfa3349f931ca6137280e2
parent5e53f01cc8b8b570f8eba57a19f15f392f4dcfcc (diff)
downloadpaludis-7e6a6b75c37cde0050e004df37871f0697a0321b.tar.gz
paludis-7e6a6b75c37cde0050e004df37871f0697a0321b.tar.xz
More things out of dep_spec.hh
-rw-r--r--paludis/dep_spec-fwd.hh3
-rw-r--r--paludis/dep_spec.cc10
-rw-r--r--paludis/dep_spec.hh140
-rw-r--r--paludis/dep_spec_data-fwd.hh29
-rw-r--r--paludis/dep_spec_data.cc27
-rw-r--r--paludis/dep_spec_data.hh179
-rw-r--r--paludis/elike_conditional_dep_spec.cc1
-rw-r--r--paludis/files.m41
-rw-r--r--paludis/partially_made_package_dep_spec.cc1
-rw-r--r--paludis/range_rewriter.cc1
-rw-r--r--paludis/repositories/cran/package_dep_spec.cc1
-rw-r--r--python/dep_spec.cc1
12 files changed, 244 insertions, 150 deletions
diff --git a/paludis/dep_spec-fwd.hh b/paludis/dep_spec-fwd.hh
index 20bfd43..4bc9409 100644
--- a/paludis/dep_spec-fwd.hh
+++ b/paludis/dep_spec-fwd.hh
@@ -63,9 +63,6 @@ namespace paludis
*/
typedef LabelsDepSpec<DependenciesLabel> DependenciesLabelsDepSpec;
- class PackageDepSpecData;
- class ConditionalDepSpecData;
-
struct InstallableToRepository;
struct InstallableToPath;
diff --git a/paludis/dep_spec.cc b/paludis/dep_spec.cc
index 6cb775b..12616b7 100644
--- a/paludis/dep_spec.cc
+++ b/paludis/dep_spec.cc
@@ -37,6 +37,8 @@
#include <paludis/util/fs_entry.hh>
#include <paludis/metadata_key.hh>
#include <paludis/additional_package_dep_spec_requirement.hh>
+#include <paludis/dep_spec_data.hh>
+
#include <functional>
#include <algorithm>
#include <list>
@@ -220,10 +222,6 @@ ConditionalDepSpec::_as_string() const
return _imp->data->as_string();
}
-ConditionalDepSpecData::~ConditionalDepSpecData()
-{
-}
-
std::string
StringDepSpec::text() const
{
@@ -597,10 +595,6 @@ LabelsDepSpec<T_>::need_keys_added() const
{
}
-PackageDepSpecData::~PackageDepSpecData()
-{
-}
-
namespace paludis
{
template <>
diff --git a/paludis/dep_spec.hh b/paludis/dep_spec.hh
index ece18cb..f62c4cd 100644
--- a/paludis/dep_spec.hh
+++ b/paludis/dep_spec.hh
@@ -41,9 +41,9 @@
#include <paludis/environment-fwd.hh>
#include <paludis/additional_package_dep_spec_requirement-fwd.hh>
#include <paludis/partially_made_package_dep_spec-fwd.hh>
+#include <paludis/dep_spec_data-fwd.hh>
#include <memory>
-#include <functional>
/** \file
* Declarations for dependency spec classes.
@@ -214,44 +214,6 @@ namespace paludis
};
/**
- * Data for a ConditionalDepSpec.
- *
- * \since 0.26
- * \ingroup g_dep_spec
- */
- class PALUDIS_VISIBLE ConditionalDepSpecData :
- public MetadataKeyHolder
- {
- public:
- ///\name Basic operations
- ///\{
-
- virtual ~ConditionalDepSpecData();
-
- ///\}
-
- /**
- * Fetch ourself as a string.
- */
- virtual std::string as_string() const = 0;
-
- /**
- * Fetch the result for condition_met.
- */
- virtual bool condition_met() const PALUDIS_ATTRIBUTE((warn_unused_result)) = 0;
-
- /**
- * Fetch the result for condition_would_be_met_when.
- */
- virtual bool condition_would_be_met_when(const ChangedChoices &) const PALUDIS_ATTRIBUTE((warn_unused_result)) = 0;
-
- /**
- * Fetch the result for condition_meetable.
- */
- virtual bool condition_meetable() const PALUDIS_ATTRIBUTE((warn_unused_result)) = 0;
- };
-
- /**
* A StringDepSpec represents a dep spec with an associated piece of text.
*
* \ingroup g_dep_spec
@@ -454,106 +416,6 @@ namespace paludis
};
/**
- * Data for a PackageDepSpec.
- *
- * \since 0.26
- * \ingroup g_dep_spec
- */
- class PALUDIS_VISIBLE PackageDepSpecData
- {
- public:
- ///\name Basic operations
- ///\{
-
- virtual ~PackageDepSpecData();
-
- ///\}
-
- /**
- * Fetch ourself as a string.
- */
- virtual std::string as_string() const = 0;
-
- /**
- * Fetch the package name (may be a zero pointer).
- */
- virtual std::shared_ptr<const QualifiedPackageName> package_ptr() const = 0;
-
- /**
- * Fetch the package name part, if wildcarded, or a zero pointer otherwise.
- */
- virtual std::shared_ptr<const PackageNamePart> package_name_part_ptr() const = 0;
-
- /**
- * Fetch the category name part, if wildcarded, or a zero pointer otherwise.
- */
- virtual std::shared_ptr<const CategoryNamePart> category_name_part_ptr() const = 0;
-
- /**
- * Fetch the version requirements (may be a zero pointer).
- */
- virtual std::shared_ptr<const VersionRequirements> version_requirements_ptr() const = 0;
-
- /**
- * Fetch the version requirements mode.
- */
- virtual VersionRequirementsMode version_requirements_mode() const = 0;
-
- /**
- * Fetch the slot name (may be a zero pointer).
- */
- virtual std::shared_ptr<const SlotRequirement> slot_requirement_ptr() const = 0;
-
- /**
- * Fetch the from-repository requirement (may be a zero pointer).
- */
- virtual std::shared_ptr<const RepositoryName> in_repository_ptr() const = 0;
-
- /**
- * Fetch the installable-to-repository requirement (may be a zero pointer).
- *
- * \since 0.32
- */
- virtual std::shared_ptr<const InstallableToRepository> installable_to_repository_ptr() const = 0;
-
- /**
- * Fetch the from-repository requirement (may be a zero pointer).
- */
- virtual std::shared_ptr<const RepositoryName> from_repository_ptr() const = 0;
-
- /**
- * Fetch the installed-at-path requirement (may be a zero pointer).
- *
- * \since 0.32
- */
- virtual std::shared_ptr<const FSEntry> installed_at_path_ptr() const = 0;
-
- /**
- * Fetch the installable-to-path requirement (may be a zero pointer).
- *
- * \since 0.32
- */
- virtual std::shared_ptr<const InstallableToPath> installable_to_path_ptr() const = 0;
-
- /**
- * Fetch the additional requirements (may be a zero pointer).
- */
- virtual std::shared_ptr<const AdditionalPackageDepSpecRequirements> additional_requirements_ptr() const = 0;
-
- /**
- * Fetch the annotations (may be a zero pointer).
- */
- virtual std::shared_ptr<const MetadataSectionKey> annotations_key() const = 0;
-
- /**
- * Fetch options if we're being used to construct a new PartiallyMadePackageDepSpec.
- *
- * \since 0.38
- */
- virtual const PartiallyMadePackageDepSpecOptions options_for_partially_made_package_dep_spec() const = 0;
- };
-
- /**
* A PlainTextDepSpec represents a plain text entry.
*
* \ingroup g_dep_spec
diff --git a/paludis/dep_spec_data-fwd.hh b/paludis/dep_spec_data-fwd.hh
new file mode 100644
index 0000000..1bbf447
--- /dev/null
+++ b/paludis/dep_spec_data-fwd.hh
@@ -0,0 +1,29 @@
+/* vim: set sw=4 sts=4 et foldmethod=syntax : */
+
+/*
+ * Copyright (c) 2005, 2006, 2007, 2008, 2009, 2010 Ciaran McCreesh
+ *
+ * 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_DEP_SPEC_DATA_FWD_HH
+#define PALUDIS_GUARD_PALUDIS_DEP_SPEC_DATA_FWD_HH 1
+
+namespace paludis
+{
+ class PackageDepSpecData;
+ class ConditionalDepSpecData;
+}
+
+#endif
diff --git a/paludis/dep_spec_data.cc b/paludis/dep_spec_data.cc
new file mode 100644
index 0000000..6a7a2da
--- /dev/null
+++ b/paludis/dep_spec_data.cc
@@ -0,0 +1,27 @@
+/* vim: set sw=4 sts=4 et foldmethod=syntax : */
+
+/*
+ * Copyright (c) 2005, 2006, 2007, 2008, 2009, 2010 Ciaran McCreesh
+ *
+ * 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 <paludis/dep_spec_data.hh>
+
+using namespace paludis;
+
+ConditionalDepSpecData::~ConditionalDepSpecData() = default;
+
+PackageDepSpecData::~PackageDepSpecData() = default;
+
diff --git a/paludis/dep_spec_data.hh b/paludis/dep_spec_data.hh
new file mode 100644
index 0000000..a4a81fd
--- /dev/null
+++ b/paludis/dep_spec_data.hh
@@ -0,0 +1,179 @@
+/* vim: set sw=4 sts=4 et foldmethod=syntax : */
+
+/*
+ * Copyright (c) 2005, 2006, 2007, 2008, 2009, 2010 Ciaran McCreesh
+ *
+ * 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_DEP_SPEC_DATA_HH
+#define PALUDIS_GUARD_PALUDIS_DEP_SPEC_DATA_HH 1
+
+#include <paludis/dep_spec_data-fwd.hh>
+#include <paludis/util/attributes.hh>
+#include <paludis/util/fs_entry-fwd.hh>
+#include <paludis/changed_choices-fwd.hh>
+#include <paludis/name-fwd.hh>
+#include <paludis/version_operator-fwd.hh>
+#include <paludis/version_requirements-fwd.hh>
+#include <paludis/slot_requirement-fwd.hh>
+#include <paludis/additional_package_dep_spec_requirement-fwd.hh>
+#include <paludis/dep_spec-fwd.hh>
+#include <paludis/partially_made_package_dep_spec-fwd.hh>
+#include <paludis/metadata_key_holder.hh>
+#include <string>
+#include <memory>
+
+namespace paludis
+{
+ /**
+ * Data for a ConditionalDepSpec.
+ *
+ * \since 0.26
+ * \ingroup g_dep_spec
+ */
+ class PALUDIS_VISIBLE ConditionalDepSpecData :
+ public MetadataKeyHolder
+ {
+ public:
+ ///\name Basic operations
+ ///\{
+
+ virtual ~ConditionalDepSpecData();
+
+ ///\}
+
+ /**
+ * Fetch ourself as a string.
+ */
+ virtual std::string as_string() const = 0;
+
+ /**
+ * Fetch the result for condition_met.
+ */
+ virtual bool condition_met() const PALUDIS_ATTRIBUTE((warn_unused_result)) = 0;
+
+ /**
+ * Fetch the result for condition_would_be_met_when.
+ */
+ virtual bool condition_would_be_met_when(const ChangedChoices &) const PALUDIS_ATTRIBUTE((warn_unused_result)) = 0;
+
+ /**
+ * Fetch the result for condition_meetable.
+ */
+ virtual bool condition_meetable() const PALUDIS_ATTRIBUTE((warn_unused_result)) = 0;
+ };
+
+ /**
+ * Data for a PackageDepSpec.
+ *
+ * \since 0.26
+ * \ingroup g_dep_spec
+ */
+ class PALUDIS_VISIBLE PackageDepSpecData
+ {
+ public:
+ ///\name Basic operations
+ ///\{
+
+ virtual ~PackageDepSpecData();
+
+ ///\}
+
+ /**
+ * Fetch ourself as a string.
+ */
+ virtual std::string as_string() const = 0;
+
+ /**
+ * Fetch the package name (may be a zero pointer).
+ */
+ virtual std::shared_ptr<const QualifiedPackageName> package_ptr() const = 0;
+
+ /**
+ * Fetch the package name part, if wildcarded, or a zero pointer otherwise.
+ */
+ virtual std::shared_ptr<const PackageNamePart> package_name_part_ptr() const = 0;
+
+ /**
+ * Fetch the category name part, if wildcarded, or a zero pointer otherwise.
+ */
+ virtual std::shared_ptr<const CategoryNamePart> category_name_part_ptr() const = 0;
+
+ /**
+ * Fetch the version requirements (may be a zero pointer).
+ */
+ virtual std::shared_ptr<const VersionRequirements> version_requirements_ptr() const = 0;
+
+ /**
+ * Fetch the version requirements mode.
+ */
+ virtual VersionRequirementsMode version_requirements_mode() const = 0;
+
+ /**
+ * Fetch the slot name (may be a zero pointer).
+ */
+ virtual std::shared_ptr<const SlotRequirement> slot_requirement_ptr() const = 0;
+
+ /**
+ * Fetch the from-repository requirement (may be a zero pointer).
+ */
+ virtual std::shared_ptr<const RepositoryName> in_repository_ptr() const = 0;
+
+ /**
+ * Fetch the installable-to-repository requirement (may be a zero pointer).
+ *
+ * \since 0.32
+ */
+ virtual std::shared_ptr<const InstallableToRepository> installable_to_repository_ptr() const = 0;
+
+ /**
+ * Fetch the from-repository requirement (may be a zero pointer).
+ */
+ virtual std::shared_ptr<const RepositoryName> from_repository_ptr() const = 0;
+
+ /**
+ * Fetch the installed-at-path requirement (may be a zero pointer).
+ *
+ * \since 0.32
+ */
+ virtual std::shared_ptr<const FSEntry> installed_at_path_ptr() const = 0;
+
+ /**
+ * Fetch the installable-to-path requirement (may be a zero pointer).
+ *
+ * \since 0.32
+ */
+ virtual std::shared_ptr<const InstallableToPath> installable_to_path_ptr() const = 0;
+
+ /**
+ * Fetch the additional requirements (may be a zero pointer).
+ */
+ virtual std::shared_ptr<const AdditionalPackageDepSpecRequirements> additional_requirements_ptr() const = 0;
+
+ /**
+ * Fetch the annotations (may be a zero pointer).
+ */
+ virtual std::shared_ptr<const MetadataSectionKey> annotations_key() const = 0;
+
+ /**
+ * Fetch options if we're being used to construct a new PartiallyMadePackageDepSpec.
+ *
+ * \since 0.38
+ */
+ virtual const PartiallyMadePackageDepSpecOptions options_for_partially_made_package_dep_spec() const = 0;
+ };
+}
+
+#endif
diff --git a/paludis/elike_conditional_dep_spec.cc b/paludis/elike_conditional_dep_spec.cc
index 0898e82..18ba90a 100644
--- a/paludis/elike_conditional_dep_spec.cc
+++ b/paludis/elike_conditional_dep_spec.cc
@@ -33,6 +33,7 @@
#include <paludis/package_id.hh>
#include <paludis/repository.hh>
#include <paludis/choice.hh>
+#include <paludis/dep_spec_data.hh>
#include <ostream>
#include <string>
diff --git a/paludis/files.m4 b/paludis/files.m4
index b803fea..5f01e02 100644
--- a/paludis/files.m4
+++ b/paludis/files.m4
@@ -28,6 +28,7 @@ add(`dep_list', `hh', `cc', `fwd', `test')
add(`dep_list_exceptions', `hh', `cc')
add(`dep_list_options', `hh', `cc', `se')
add(`dep_spec', `hh', `cc', `test', `fwd')
+add(`dep_spec_data', `hh', `cc', `fwd')
add(`dep_spec_flattener', `hh', `cc')
add(`dep_tag', `hh', `cc', `fwd')
add(`distribution', `hh', `cc', `impl', `fwd')
diff --git a/paludis/partially_made_package_dep_spec.cc b/paludis/partially_made_package_dep_spec.cc
index 4d32c18..fe015d3 100644
--- a/paludis/partially_made_package_dep_spec.cc
+++ b/paludis/partially_made_package_dep_spec.cc
@@ -27,6 +27,7 @@
#include <paludis/util/sequence-impl.hh>
#include <paludis/version_requirements.hh>
#include <paludis/additional_package_dep_spec_requirement.hh>
+#include <paludis/dep_spec_data.hh>
#include <iterator>
#include <algorithm>
#include <ostream>
diff --git a/paludis/range_rewriter.cc b/paludis/range_rewriter.cc
index f5e7b8a..4f99074 100644
--- a/paludis/range_rewriter.cc
+++ b/paludis/range_rewriter.cc
@@ -30,6 +30,7 @@
#include <paludis/util/options.hh>
#include <paludis/util/make_null_shared_ptr.hh>
#include <paludis/dep_spec.hh>
+#include <paludis/dep_spec_data.hh>
#include <list>
#include <sstream>
#include <algorithm>
diff --git a/paludis/repositories/cran/package_dep_spec.cc b/paludis/repositories/cran/package_dep_spec.cc
index 89ddbdc..8928b5e 100644
--- a/paludis/repositories/cran/package_dep_spec.cc
+++ b/paludis/repositories/cran/package_dep_spec.cc
@@ -27,6 +27,7 @@
#include <paludis/util/options.hh>
#include <paludis/util/make_null_shared_ptr.hh>
#include <paludis/dep_spec.hh>
+#include <paludis/dep_spec_data.hh>
#include <paludis/version_operator.hh>
#include <paludis/version_spec.hh>
#include <paludis/version_requirements.hh>
diff --git a/python/dep_spec.cc b/python/dep_spec.cc
index 19bc0f8..91c1bd4 100644
--- a/python/dep_spec.cc
+++ b/python/dep_spec.cc
@@ -29,6 +29,7 @@
#include <paludis/user_dep_spec.hh>
#include <paludis/version_requirements.hh>
#include <paludis/partially_made_package_dep_spec.hh>
+#include <paludis/dep_spec_data.hh>
#include <paludis/util/save.hh>
#include <paludis/util/stringify.hh>