aboutsummaryrefslogtreecommitdiff
path: root/paludis/contents.hh
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2007-11-18 08:41:19 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2007-11-18 08:41:19 +0000
commit1ac2d4a08a6d1f2686dfebd853f6b8f69f0e3999 (patch)
tree96eaa595a270994e6e1f4b1141edd98020e346d8 /paludis/contents.hh
parent281f2f4c33dd7edf4709220fbf7f7d7e96516310 (diff)
downloadpaludis-1ac2d4a08a6d1f2686dfebd853f6b8f69f0e3999.tar.gz
paludis-1ac2d4a08a6d1f2686dfebd853f6b8f69f0e3999.tar.xz
Make stringify(ContentsEntry) work for subclassed entries even if we don't know the subclass at compile time.
Diffstat (limited to 'paludis/contents.hh')
-rw-r--r--paludis/contents.hh10
1 files changed, 10 insertions, 0 deletions
diff --git a/paludis/contents.hh b/paludis/contents.hh
index 1213546..aa2b040 100644
--- a/paludis/contents.hh
+++ b/paludis/contents.hh
@@ -71,6 +71,8 @@ namespace paludis
private InstantiationPolicy<ContentsEntry, instantiation_method::NonCopyableTag>,
public virtual ConstAcceptInterface<ContentsVisitorTypes>
{
+ friend std::ostream & operator<< (std::ostream &, const ContentsEntry &);
+
private:
std::string _name;
@@ -80,6 +82,11 @@ namespace paludis
ContentsEntry(const std::string & our_name);
+ /**
+ * Used to implement the ostream operator<<.
+ */
+ virtual const std::string as_string() const PALUDIS_ATTRIBUTE((warn_unused_result));
+
///\}
public:
@@ -202,6 +209,9 @@ namespace paludis
private:
std::string _target;
+ protected:
+ virtual const std::string as_string() const PALUDIS_ATTRIBUTE((warn_unused_result));
+
public:
///\name Basic operations
///\{