aboutsummaryrefslogtreecommitdiff
path: root/src/output
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2007-10-02 23:56:53 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2007-10-02 23:56:53 +0000
commitaaaaed580a954078e9b6f8b6aaf6b5337f8979ee (patch)
treee9f52649f48ec97c8aa8f05d0bf823511e0e7817 /src/output
parent69fa594051d412e9e7de0041085974a3188612c2 (diff)
downloadpaludis-aaaaed580a954078e9b6f8b6aaf6b5337f8979ee.tar.gz
paludis-aaaaed580a954078e9b6f8b6aaf6b5337f8979ee.tar.xz
Split up dep spec heirarchies some more. Fixes: ticket:381
Diffstat (limited to 'src/output')
-rw-r--r--src/output/colour_formatter.cc18
-rw-r--r--src/output/colour_formatter.hh14
-rw-r--r--src/output/console_query_task.cc33
-rw-r--r--src/output/mask_displayer.cc8
4 files changed, 63 insertions, 10 deletions
diff --git a/src/output/colour_formatter.cc b/src/output/colour_formatter.cc
index 0f516f643..41f9552b2 100644
--- a/src/output/colour_formatter.cc
+++ b/src/output/colour_formatter.cc
@@ -295,13 +295,19 @@ ColourFormatter::format(const PlainTextDepSpec & f, const format::Plain &) const
}
std::string
-ColourFormatter::format(const PlainTextDepSpec & f, const format::Accepted &) const
+ColourFormatter::format(const LicenseDepSpec & f, const format::Plain &) const
+{
+ return stringify(f);
+}
+
+std::string
+ColourFormatter::format(const LicenseDepSpec & f, const format::Accepted &) const
{
return colour(cl_flag_on, f);
}
std::string
-ColourFormatter::format(const PlainTextDepSpec & f, const format::Unaccepted &) const
+ColourFormatter::format(const LicenseDepSpec & f, const format::Unaccepted &) const
{
return colour(cl_flag_off, f);
}
@@ -343,7 +349,13 @@ ColourFormatter::format(const LabelsDepSpec<DependencyLabelVisitorTypes> & f, co
}
std::string
-ColourFormatter::format(const URIDepSpec & f, const format::Plain &) const
+ColourFormatter::format(const FetchableURIDepSpec & f, const format::Plain &) const
+{
+ return stringify(f);
+}
+
+std::string
+ColourFormatter::format(const SimpleURIDepSpec & f, const format::Plain &) const
{
return stringify(f);
}
diff --git a/src/output/colour_formatter.hh b/src/output/colour_formatter.hh
index 3e62e8b85..f1a9d5910 100644
--- a/src/output/colour_formatter.hh
+++ b/src/output/colour_formatter.hh
@@ -35,7 +35,9 @@ class ColourFormatter :
public paludis::CanFormat<paludis::LabelsDepSpec<paludis::DependencyLabelVisitorTypes> >,
public paludis::CanFormat<paludis::LabelsDepSpec<paludis::URILabelVisitorTypes> >,
public paludis::CanFormat<paludis::PlainTextDepSpec>,
- public paludis::CanFormat<paludis::URIDepSpec>,
+ public paludis::CanFormat<paludis::SimpleURIDepSpec>,
+ public paludis::CanFormat<paludis::FetchableURIDepSpec>,
+ public paludis::CanFormat<paludis::LicenseDepSpec>,
public paludis::CanFormat<paludis::tr1::shared_ptr<const paludis::PackageID> >,
public paludis::CanFormat<std::string>,
public paludis::CanSpace,
@@ -75,8 +77,10 @@ class ColourFormatter :
std::string format(const paludis::PackageDepSpec &, const paludis::format::Installable &) const;
std::string format(const paludis::PlainTextDepSpec &, const paludis::format::Plain &) const;
- std::string format(const paludis::PlainTextDepSpec &, const paludis::format::Accepted &) const;
- std::string format(const paludis::PlainTextDepSpec &, const paludis::format::Unaccepted &) const;
+
+ std::string format(const paludis::LicenseDepSpec &, const paludis::format::Plain &) const;
+ std::string format(const paludis::LicenseDepSpec &, const paludis::format::Accepted &) const;
+ std::string format(const paludis::LicenseDepSpec &, const paludis::format::Unaccepted &) const;
std::string format(const paludis::KeywordName &, const paludis::format::Plain &) const;
std::string format(const paludis::KeywordName &, const paludis::format::Accepted &) const;
@@ -88,7 +92,9 @@ class ColourFormatter :
std::string format(const paludis::LabelsDepSpec<paludis::DependencyLabelVisitorTypes> &, const paludis::format::Plain &) const;
- std::string format(const paludis::URIDepSpec &, const paludis::format::Plain &) const;
+ std::string format(const paludis::FetchableURIDepSpec &, const paludis::format::Plain &) const;
+
+ std::string format(const paludis::SimpleURIDepSpec &, const paludis::format::Plain &) const;
std::string format(const paludis::BlockDepSpec &, const paludis::format::Plain &) const;
diff --git a/src/output/console_query_task.cc b/src/output/console_query_task.cc
index 169484abd..e8fdba803 100644
--- a/src/output/console_query_task.cc
+++ b/src/output/console_query_task.cc
@@ -281,7 +281,26 @@ namespace
}
}
- void visit(const MetadataSpecTreeKey<URISpecTree> & k)
+ void visit(const MetadataSpecTreeKey<FetchableURISpecTree> & k)
+ {
+ if (k.type() == type)
+ {
+ ColourFormatter formatter;
+ if (task->want_raw())
+ {
+ task->output_left_column(k.raw_name() + ":");
+ task->output_right_column(k.pretty_print_flat(formatter));
+ }
+ else
+ {
+ task->output_left_column(k.human_name() + ":");
+ task->output_stream() << k.pretty_print_flat(formatter);
+ task->output_right_column("");
+ }
+ }
+ }
+
+ void visit(const MetadataSpecTreeKey<SimpleURISpecTree> & k)
{
if (k.type() == type)
{
@@ -570,7 +589,12 @@ namespace
empty = false;
}
- void visit_leaf(const URIDepSpec &)
+ void visit_leaf(const SimpleURIDepSpec &)
+ {
+ empty = false;
+ }
+
+ void visit_leaf(const FetchableURIDepSpec &)
{
empty = false;
}
@@ -580,6 +604,11 @@ namespace
empty = false;
}
+ void visit_leaf(const LicenseDepSpec &)
+ {
+ empty = false;
+ }
+
void visit_leaf(const LabelsDepSpec<URILabelVisitorTypes> &)
{
}
diff --git a/src/output/mask_displayer.cc b/src/output/mask_displayer.cc
index 5a7f0bd7d..ebb122ecc 100644
--- a/src/output/mask_displayer.cc
+++ b/src/output/mask_displayer.cc
@@ -119,7 +119,13 @@ namespace
s << k.pretty_print_flat(formatter);
}
- void visit(const MetadataSpecTreeKey<URISpecTree> & k)
+ void visit(const MetadataSpecTreeKey<FetchableURISpecTree> & k)
+ {
+ ColourFormatter formatter;
+ s << k.pretty_print_flat(formatter);
+ }
+
+ void visit(const MetadataSpecTreeKey<SimpleURISpecTree> & k)
{
ColourFormatter formatter;
s << k.pretty_print_flat(formatter);