aboutsummaryrefslogtreecommitdiff
path: root/paludis/mask.cc
diff options
context:
space:
mode:
Diffstat (limited to 'paludis/mask.cc')
-rw-r--r--paludis/mask.cc45
1 files changed, 44 insertions, 1 deletions
diff --git a/paludis/mask.cc b/paludis/mask.cc
index 08ac24308..0f3bafd31 100644
--- a/paludis/mask.cc
+++ b/paludis/mask.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2007, 2008, 2009, 2010 Ciaran McCreesh
+ * Copyright (c) 2007, 2008, 2009, 2010, 2011 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
@@ -31,3 +31,46 @@ Mask::~Mask()
{
}
+const std::string
+UserMask::token() const
+{
+ return "user";
+}
+
+namespace
+{
+ struct TokenGetter
+ {
+ std::string visit(const UserMask & m) const
+ {
+ return m.token();
+ }
+
+ std::string visit(const RepositoryMask & m) const
+ {
+ return m.token();
+ }
+
+ std::string visit(const UnacceptedMask &) const
+ {
+ return "";
+ }
+
+ std::string visit(const UnsupportedMask &) const
+ {
+ return "";
+ }
+
+ std::string visit(const AssociationMask &) const
+ {
+ return "";
+ }
+ };
+}
+
+const std::string
+paludis::get_mask_token(const Mask & m)
+{
+ return m.accept_returning<std::string>(TokenGetter{});
+}
+