aboutsummaryrefslogtreecommitdiff
path: root/paludis/repositories
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2010-06-09 21:14:17 +0100
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2010-06-09 21:14:17 +0100
commit5dbb7636dd880314d5b03379ebfd960b469ee6e9 (patch)
tree6a9a062efbf6aa03dcbdc92b6abf156108904ea2 /paludis/repositories
parentc9137efc3ef08b5c52f775dd853c1c675e80cc64 (diff)
downloadpaludis-5dbb7636dd880314d5b03379ebfd960b469ee6e9.tar.gz
paludis-5dbb7636dd880314d5b03379ebfd960b469ee6e9.tar.xz
Replace Validated with WrappedValue
Slightly cleaner code, and will allow us to pass in additional validation options.
Diffstat (limited to 'paludis/repositories')
-rw-r--r--paludis/repositories/e/e_choice_value.hh3
-rw-r--r--paludis/repositories/e/e_choices_key.cc4
-rw-r--r--paludis/repositories/e/e_repository_sets.cc6
-rw-r--r--paludis/repositories/e/iuse.cc4
-rw-r--r--paludis/repositories/e/metadata_xml.cc3
-rw-r--r--paludis/repositories/e/myoption.cc3
-rw-r--r--paludis/repositories/e/myoption.hh3
-rw-r--r--paludis/repositories/e/use_desc.cc6
-rw-r--r--paludis/repositories/e/xml_things.cc1
-rw-r--r--paludis/repositories/fake/fake_package_id.cc4
-rw-r--r--paludis/repositories/unavailable/unavailable_repository_dependencies_key.cc1
-rw-r--r--paludis/repositories/unpackaged/installed_id.cc2
-rw-r--r--paludis/repositories/unpackaged/unpackaged_id.cc2
-rw-r--r--paludis/repositories/unpackaged/unpackaged_key.cc1
-rw-r--r--paludis/repositories/unwritten/unwritten_id.cc2
-rw-r--r--paludis/repositories/virtuals/installed_virtuals_repository.cc8
-rw-r--r--paludis/repositories/virtuals/virtuals_repository.cc10
17 files changed, 29 insertions, 34 deletions
diff --git a/paludis/repositories/e/e_choice_value.hh b/paludis/repositories/e/e_choice_value.hh
index 7ecd06f54..20b0afec2 100644
--- a/paludis/repositories/e/e_choice_value.hh
+++ b/paludis/repositories/e/e_choice_value.hh
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2008, 2009 Ciaran McCreesh
+ * Copyright (c) 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
@@ -21,7 +21,6 @@
#define PALUDIS_GUARD_PALUDIS_REPOSITORIES_E_E_CHOICE_VALUE_HH 1
#include <paludis/util/attributes.hh>
-#include <paludis/util/validated.hh>
#include <paludis/choice.hh>
#include <paludis/name.hh>
#include <tr1/functional>
diff --git a/paludis/repositories/e/e_choices_key.cc b/paludis/repositories/e/e_choices_key.cc
index 1135ce3c3..54dc236ac 100644
--- a/paludis/repositories/e/e_choices_key.cc
+++ b/paludis/repositories/e/e_choices_key.cc
@@ -119,7 +119,7 @@ namespace
std::string lower_s;
std::transform(s.begin(), s.end(), std::back_inserter(lower_s), &::tolower);
lower_s.append(delim);
- return (0 == flag.data().compare(0, lower_s.length(), lower_s, 0, lower_s.length()));
+ return (0 == flag.value().compare(0, lower_s.length(), lower_s, 0, lower_s.length()));
}
};
@@ -540,7 +540,7 @@ EChoicesKey::populate_iuse() const
for (std::map<ChoiceNameWithPrefix, ChoiceOptions>::const_iterator i(i_values.begin()), i_end(i_values.end()) ;
i != i_end ; ++i)
if (IsExpand(i->first, delim)(*u))
- values.insert(UnprefixedChoiceName(i->first.data().substr(u->length() + delim.length())));
+ values.insert(UnprefixedChoiceName(i->first.value().substr(u->length() + delim.length())));
for (std::set<UnprefixedChoiceName>::const_iterator v(values.begin()), v_end(values.end()) ;
v != v_end ; ++v)
diff --git a/paludis/repositories/e/e_repository_sets.cc b/paludis/repositories/e/e_repository_sets.cc
index d3d29438b..e87a6d38c 100644
--- a/paludis/repositories/e/e_repository_sets.cc
+++ b/paludis/repositories/e/e_repository_sets.cc
@@ -102,11 +102,11 @@ ERepositorySets::package_set(const SetName & ss) const
{
using namespace std::tr1::placeholders;
- if ("system" == ss.data())
+ if ("system" == ss.value())
throw InternalError(PALUDIS_HERE, "system set should've been handled by ERepository");
- else if ("security" == ss.data())
+ else if ("security" == ss.value())
return security_set(false);
- else if ("insecurity" == ss.data())
+ else if ("insecurity" == ss.value())
return security_set(true);
std::pair<SetName, SetFileSetOperatorMode> s(find_base_set_name_and_suffix_mode(ss));
diff --git a/paludis/repositories/e/iuse.cc b/paludis/repositories/e/iuse.cc
index 7e6f5b1c9..7f3c3214a 100644
--- a/paludis/repositories/e/iuse.cc
+++ b/paludis/repositories/e/iuse.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2008 Ciaran McCreesh
+ * Copyright (c) 2008, 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
@@ -22,8 +22,8 @@
#include <paludis/util/stringify.hh>
#include <paludis/util/exception.hh>
#include <paludis/util/tribool.hh>
-#include <paludis/util/validated.hh>
#include <paludis/choice.hh>
+#include <paludis/name.hh>
#include <istream>
#include <ostream>
diff --git a/paludis/repositories/e/metadata_xml.cc b/paludis/repositories/e/metadata_xml.cc
index fd6005621..09d3a89c0 100644
--- a/paludis/repositories/e/metadata_xml.cc
+++ b/paludis/repositories/e/metadata_xml.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2008 Ciaran McCreesh
+ * Copyright (c) 2008, 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
@@ -22,7 +22,6 @@
#include <paludis/util/private_implementation_pattern-impl.hh>
#include <paludis/util/instantiation_policy-impl.hh>
#include <paludis/util/map-impl.hh>
-#include <paludis/util/validated.hh>
#include <paludis/util/mutex.hh>
#include <paludis/util/fs_entry.hh>
#include <paludis/util/hashes.hh>
diff --git a/paludis/repositories/e/myoption.cc b/paludis/repositories/e/myoption.cc
index 4044cada5..e288ae164 100644
--- a/paludis/repositories/e/myoption.cc
+++ b/paludis/repositories/e/myoption.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2008 Ciaran McCreesh
+ * Copyright (c) 2008, 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
@@ -18,7 +18,6 @@
*/
#include <paludis/repositories/e/myoption.hh>
-#include <paludis/util/validated.hh>
#include <paludis/choice.hh>
using namespace paludis;
diff --git a/paludis/repositories/e/myoption.hh b/paludis/repositories/e/myoption.hh
index ea0e1e4e3..871bfc5fd 100644
--- a/paludis/repositories/e/myoption.hh
+++ b/paludis/repositories/e/myoption.hh
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2008 Ciaran McCreesh
+ * Copyright (c) 2008, 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
@@ -23,6 +23,7 @@
#include <paludis/util/attributes.hh>
#include <paludis/choice-fwd.hh>
#include <utility>
+#include <string>
namespace paludis
{
diff --git a/paludis/repositories/e/use_desc.cc b/paludis/repositories/e/use_desc.cc
index 2a3b31d14..39bb94df0 100644
--- a/paludis/repositories/e/use_desc.cc
+++ b/paludis/repositories/e/use_desc.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2006, 2007, 2008 Ciaran McCreesh
+ * Copyright (c) 2006, 2007, 2008, 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
@@ -97,12 +97,12 @@ UseDesc::describe(
std::tr1::unordered_map<QualifiedPackageName, UseDescs, Hash<QualifiedPackageName> >::const_iterator i(_imp->local_descs.find(id));
if (i != _imp->local_descs.end())
{
- UseDescs::const_iterator j(i->second.find(make_pair(prefix, flag)));
+ UseDescs::const_iterator j(i->second.find(std::make_pair(prefix, flag)));
if (j != i->second.end())
return j->second;
}
- UseDescs::const_iterator j(_imp->global_descs.find(make_pair(prefix, flag)));
+ UseDescs::const_iterator j(_imp->global_descs.find(std::make_pair(prefix, flag)));
if (j != _imp->global_descs.end())
return j->second;
diff --git a/paludis/repositories/e/xml_things.cc b/paludis/repositories/e/xml_things.cc
index 5c36c15f5..1800e4421 100644
--- a/paludis/repositories/e/xml_things.cc
+++ b/paludis/repositories/e/xml_things.cc
@@ -24,7 +24,6 @@
#include <paludis/util/sequence.hh>
#include <paludis/util/map.hh>
#include <paludis/util/tokeniser.hh>
-#include <paludis/util/validated.hh>
#include <paludis/choice.hh>
#include <set>
diff --git a/paludis/repositories/fake/fake_package_id.cc b/paludis/repositories/fake/fake_package_id.cc
index 1b2b47f8e..b60e52f08 100644
--- a/paludis/repositories/fake/fake_package_id.cc
+++ b/paludis/repositories/fake/fake_package_id.cc
@@ -523,7 +523,7 @@ namespace
virtual const ChoiceNameWithPrefix name_with_prefix() const
{
- return ChoiceNameWithPrefix((choice->prefix().data().empty() ? "" : stringify(choice->prefix()) + "*") + stringify(value_name));
+ return ChoiceNameWithPrefix((choice->prefix().value().empty() ? "" : stringify(choice->prefix()) + "*") + stringify(value_name));
}
virtual bool enabled() const
@@ -994,7 +994,7 @@ FakePackageID::set_slot(const SlotName & s)
bool
FakePackageID::arbitrary_less_than_comparison(const PackageID & other) const
{
- return slot_key()->value().data() < (other.slot_key() ? stringify(other.slot_key()->value()) : "");
+ return slot_key()->value().value() < (other.slot_key() ? stringify(other.slot_key()->value()) : "");
}
void
diff --git a/paludis/repositories/unavailable/unavailable_repository_dependencies_key.cc b/paludis/repositories/unavailable/unavailable_repository_dependencies_key.cc
index 07a18db2c..a9232b3c3 100644
--- a/paludis/repositories/unavailable/unavailable_repository_dependencies_key.cc
+++ b/paludis/repositories/unavailable/unavailable_repository_dependencies_key.cc
@@ -20,7 +20,6 @@
#include <paludis/repositories/unavailable/unavailable_repository_dependencies_key.hh>
#include <paludis/util/private_implementation_pattern-impl.hh>
#include <paludis/util/fs_entry.hh>
-#include <paludis/util/validated.hh>
#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/set.hh>
#include <paludis/util/make_named_values.hh>
diff --git a/paludis/repositories/unpackaged/installed_id.cc b/paludis/repositories/unpackaged/installed_id.cc
index 94862c083..cca03d299 100644
--- a/paludis/repositories/unpackaged/installed_id.cc
+++ b/paludis/repositories/unpackaged/installed_id.cc
@@ -832,7 +832,7 @@ InstalledUnpackagedID::breaks_portage() const
bool
InstalledUnpackagedID::arbitrary_less_than_comparison(const PackageID & other) const
{
- return slot_key()->value().data() < (other.slot_key() ? stringify(other.slot_key()->value()) : "");
+ return slot_key()->value().value() < (other.slot_key() ? stringify(other.slot_key()->value()) : "");
}
std::size_t
diff --git a/paludis/repositories/unpackaged/unpackaged_id.cc b/paludis/repositories/unpackaged/unpackaged_id.cc
index 7a90b4a03..042a38d53 100644
--- a/paludis/repositories/unpackaged/unpackaged_id.cc
+++ b/paludis/repositories/unpackaged/unpackaged_id.cc
@@ -469,7 +469,7 @@ UnpackagedID::breaks_portage() const
bool
UnpackagedID::arbitrary_less_than_comparison(const PackageID & other) const
{
- return slot_key()->value().data() < (other.slot_key() ? stringify(other.slot_key()->value()) : "");
+ return slot_key()->value().value() < (other.slot_key() ? stringify(other.slot_key()->value()) : "");
}
std::size_t
diff --git a/paludis/repositories/unpackaged/unpackaged_key.cc b/paludis/repositories/unpackaged/unpackaged_key.cc
index 563d0975d..de888f469 100644
--- a/paludis/repositories/unpackaged/unpackaged_key.cc
+++ b/paludis/repositories/unpackaged/unpackaged_key.cc
@@ -22,7 +22,6 @@
#include <paludis/util/private_implementation_pattern-impl.hh>
#include <paludis/util/fs_entry.hh>
#include <paludis/util/mutex.hh>
-#include <paludis/util/validated.hh>
#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/set.hh>
#include <paludis/util/make_named_values.hh>
diff --git a/paludis/repositories/unwritten/unwritten_id.cc b/paludis/repositories/unwritten/unwritten_id.cc
index d21bb7334..e947e44ec 100644
--- a/paludis/repositories/unwritten/unwritten_id.cc
+++ b/paludis/repositories/unwritten/unwritten_id.cc
@@ -184,7 +184,7 @@ UnwrittenID::breaks_portage() const
bool
UnwrittenID::arbitrary_less_than_comparison(const PackageID & other) const
{
- return slot_key()->value().data() < (other.slot_key() ? stringify(other.slot_key()->value()) : "");
+ return slot_key()->value().value() < (other.slot_key() ? stringify(other.slot_key()->value()) : "");
}
std::size_t
diff --git a/paludis/repositories/virtuals/installed_virtuals_repository.cc b/paludis/repositories/virtuals/installed_virtuals_repository.cc
index 33cea8864..7fc615f8c 100644
--- a/paludis/repositories/virtuals/installed_virtuals_repository.cc
+++ b/paludis/repositories/virtuals/installed_virtuals_repository.cc
@@ -168,7 +168,7 @@ InstalledVirtualsRepository::need_ids() const
std::tr1::shared_ptr<const PackageIDSequence>
InstalledVirtualsRepository::package_ids(const QualifiedPackageName & q) const
{
- if (q.category().data() != "virtual")
+ if (q.category().value() != "virtual")
return std::tr1::shared_ptr<PackageIDSequence>(new PackageIDSequence);
need_ids();
@@ -183,7 +183,7 @@ InstalledVirtualsRepository::package_ids(const QualifiedPackageName & q) const
std::tr1::shared_ptr<const QualifiedPackageNameSet>
InstalledVirtualsRepository::package_names(const CategoryNamePart & c) const
{
- if (c.data() != "virtual")
+ if (c.value() != "virtual")
return std::tr1::shared_ptr<QualifiedPackageNameSet>(new QualifiedPackageNameSet);
need_ids();
@@ -206,7 +206,7 @@ InstalledVirtualsRepository::category_names() const
bool
InstalledVirtualsRepository::has_package_named(const QualifiedPackageName & q) const
{
- if (q.category().data() != "virtual")
+ if (q.category().value() != "virtual")
return false;
need_ids();
@@ -217,7 +217,7 @@ InstalledVirtualsRepository::has_package_named(const QualifiedPackageName & q) c
bool
InstalledVirtualsRepository::has_category_named(const CategoryNamePart & c) const
{
- return (c.data() == "virtual");
+ return (c.value() == "virtual");
}
void
diff --git a/paludis/repositories/virtuals/virtuals_repository.cc b/paludis/repositories/virtuals/virtuals_repository.cc
index c26a33878..cb0ce8578 100644
--- a/paludis/repositories/virtuals/virtuals_repository.cc
+++ b/paludis/repositories/virtuals/virtuals_repository.cc
@@ -252,7 +252,7 @@ VirtualsRepository::need_ids() const
std::tr1::shared_ptr<const PackageIDSequence>
VirtualsRepository::package_ids(const QualifiedPackageName & q) const
{
- if (q.category().data() != "virtual")
+ if (q.category().value() != "virtual")
return std::tr1::shared_ptr<PackageIDSequence>(new PackageIDSequence);
need_ids();
@@ -267,7 +267,7 @@ VirtualsRepository::package_ids(const QualifiedPackageName & q) const
std::tr1::shared_ptr<const QualifiedPackageNameSet>
VirtualsRepository::package_names(const CategoryNamePart & c) const
{
- if (c.data() != "virtual")
+ if (c.value() != "virtual")
return std::tr1::shared_ptr<QualifiedPackageNameSet>(new QualifiedPackageNameSet);
need_ids();
@@ -290,7 +290,7 @@ VirtualsRepository::category_names() const
bool
VirtualsRepository::has_package_named(const QualifiedPackageName & q) const
{
- if (q.category().data() != "virtual")
+ if (q.category().value() != "virtual")
return false;
need_names();
@@ -308,7 +308,7 @@ VirtualsRepository::has_package_named(const QualifiedPackageName & q) const
bool
VirtualsRepository::has_category_named(const CategoryNamePart & c) const
{
- return (c.data() == "virtual");
+ return (c.value() == "virtual");
}
void
@@ -333,7 +333,7 @@ const std::tr1::shared_ptr<const PackageID>
VirtualsRepository::make_virtual_package_id(
const QualifiedPackageName & virtual_name, const std::tr1::shared_ptr<const PackageID> & provider) const
{
- if (virtual_name.category().data() != "virtual")
+ if (virtual_name.category().value() != "virtual")
throw InternalError(PALUDIS_HERE, "tried to make a virtual package id using '" + stringify(virtual_name) + "', '"
+ stringify(*provider) + "'");