aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2011-04-14 23:53:37 +0100
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2011-04-14 23:53:37 +0100
commitb15056b07805a7d5cdd7f818c81330ac2418e1e5 (patch)
tree0a9243601f32e01b4500305802ce6ef8b908fd6b
parentc01c7bc64cda93624500c5e3c7c7b701dbcae089 (diff)
downloadpaludis-b15056b07805a7d5cdd7f818c81330ac2418e1e5.tar.gz
paludis-b15056b07805a7d5cdd7f818c81330ac2418e1e5.tar.xz
Store PackageDepSpec text
-rw-r--r--paludis/dep_spec.cc48
-rw-r--r--paludis/dep_spec.hh1
2 files changed, 23 insertions, 26 deletions
diff --git a/paludis/dep_spec.cc b/paludis/dep_spec.cc
index 4a4c026..e7c1f29 100644
--- a/paludis/dep_spec.cc
+++ b/paludis/dep_spec.cc
@@ -280,7 +280,7 @@ paludis::operator<< (std::ostream & s, const SimpleURIDepSpec & p)
std::ostream &
paludis::operator<< (std::ostream & s, const PackageDepSpec & a)
{
- s << a._as_string();
+ s << a.text();
return s;
}
@@ -574,6 +574,8 @@ namespace paludis
struct Imp<PackageDepSpec>
{
const std::shared_ptr<const PackageDepSpecData> data;
+ std::string text;
+
std::shared_ptr<VersionRequirementSequence> all_versions;
std::shared_ptr<KeyRequirementSequence> all_keys;
std::shared_ptr<ChoiceRequirementSequence> all_choices;
@@ -611,23 +613,6 @@ PackageDepSpec::PackageDepSpec(const std::shared_ptr<const PackageDepSpecData> &
Cloneable<DepSpec>(),
_imp(d)
{
-}
-
-PackageDepSpec::~PackageDepSpec()
-{
-}
-
-PackageDepSpec::PackageDepSpec(const PackageDepSpec & d) :
- Cloneable<DepSpec>(d),
- CloneUsingThis<DepSpec, PackageDepSpec>(d),
- _imp(d._imp->data)
-{
- set_annotations(d.maybe_annotations());
-}
-
-const std::string
-PackageDepSpec::text() const
-{
std::ostringstream s;
if (all_version_requirements())
@@ -808,7 +793,26 @@ PackageDepSpec::text() const
for (auto u(all_key_requirements()->begin()), u_end(all_key_requirements()->end()) ; u != u_end ; ++u)
s << (*u)->as_raw_string();
- return s.str();
+ _imp->text = s.str();
+}
+
+PackageDepSpec::~PackageDepSpec()
+{
+}
+
+PackageDepSpec::PackageDepSpec(const PackageDepSpec & d) :
+ Cloneable<DepSpec>(d),
+ CloneUsingThis<DepSpec, PackageDepSpec>(d),
+ _imp(d._imp->data)
+{
+ set_annotations(d.maybe_annotations());
+ _imp->text = d._imp->text;
+}
+
+const std::string
+PackageDepSpec::text() const
+{
+ return _imp->text;
}
const std::shared_ptr<const NameRequirement>
@@ -965,12 +969,6 @@ PackageDepSpec::requirements() const
return _imp->data->requirements();
}
-std::string
-PackageDepSpec::_as_string() const
-{
- return text();
-}
-
const std::shared_ptr<const PackageDepSpecData>
PackageDepSpec::data() const
{
diff --git a/paludis/dep_spec.hh b/paludis/dep_spec.hh
index 289dfb2..88de186 100644
--- a/paludis/dep_spec.hh
+++ b/paludis/dep_spec.hh
@@ -268,7 +268,6 @@ namespace paludis
private:
const PackageDepSpec & operator= (const PackageDepSpec &);
- std::string _as_string() const;
Pimp<PackageDepSpec> _imp;