aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2006-01-26 06:53:06 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2006-01-26 06:53:06 +0000
commit28c2c32e3f87d578dc6ce474df6611fa8acc039c (patch)
treebdcd29f247444fb9053f50dfbc7425aef74164fc
parent12338888a100ed2f325a1c8fe541c22340445074 (diff)
downloadpaludis-28c2c32e3f87d578dc6ce474df6611fa8acc039c.tar.gz
paludis-28c2c32e3f87d578dc6ce474df6611fa8acc039c.tar.xz
Add an add_version overloaded for strings for convenience when writing test cases.
-rw-r--r--paludis/fake_repository.hh11
1 files changed, 11 insertions, 0 deletions
diff --git a/paludis/fake_repository.hh b/paludis/fake_repository.hh
index 4f0fe66..0c7faa9 100644
--- a/paludis/fake_repository.hh
+++ b/paludis/fake_repository.hh
@@ -100,6 +100,17 @@ namespace paludis
VersionMetadata::Pointer add_version(
const CategoryNamePart &, const PackageNamePart &, const VersionSpec &);
+ /**
+ * Add a version, and a package and category if necessary, and set some
+ * default values for its metadata, and return said metadata (convenience
+ * overload taking strings).
+ */
+ VersionMetadata::Pointer add_version(
+ const std::string & c, const std::string & p, const std::string & v)
+ {
+ return add_version(CategoryNamePart(c), PackageNamePart(p), VersionSpec(v));
+ }
+
typedef CountedPtr<FakeRepository, count_policy::InternalCountTag> Pointer;
typedef CountedPtr<const FakeRepository, count_policy::InternalCountTag> ConstPointer;
};