aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2007-02-05 12:19:35 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2007-02-05 12:19:35 +0000
commit791b90eb11433ffe03c1b7c72b270413e38025a0 (patch)
tree3894b326be2b2d2d5729d6c30b47fce5d6b96dd5
parenta6a37407d524adc4f51dea443e4ac6e13411c4e7 (diff)
downloadpaludis-791b90eb11433ffe03c1b7c72b270413e38025a0.tar.gz
paludis-791b90eb11433ffe03c1b7c72b270413e38025a0.tar.xz
Move query display code into its own console task. Use it for inquisitio too.
-rw-r--r--src/clients/inquisitio/Makefile.am1
-rw-r--r--src/clients/inquisitio/do_search.cc7
-rw-r--r--src/clients/inquisitio/query_task.cc29
-rw-r--r--src/clients/inquisitio/query_task.hh45
-rw-r--r--src/clients/paludis/query.cc301
-rw-r--r--src/output/Makefile.am2
-rw-r--r--src/output/console_install_task.cc123
-rw-r--r--src/output/console_install_task.hh37
-rw-r--r--src/output/console_query_task.cc398
-rw-r--r--src/output/console_query_task.hh64
-rw-r--r--src/output/console_task.cc187
-rw-r--r--src/output/console_task.hh83
12 files changed, 838 insertions, 439 deletions
diff --git a/src/clients/inquisitio/Makefile.am b/src/clients/inquisitio/Makefile.am
index 8242ab9..4a90b06 100644
--- a/src/clients/inquisitio/Makefile.am
+++ b/src/clients/inquisitio/Makefile.am
@@ -40,6 +40,7 @@ inquisitio_SOURCES = \
description_extractor.hh description_extractor.cc \
name_extractor.hh name_extractor.cc \
do_search.hh do_search.cc \
+ query_task.hh query_task.cc \
inquisitio.cc
inquisitio_LDADD = \
diff --git a/src/clients/inquisitio/do_search.cc b/src/clients/inquisitio/do_search.cc
index be99e6a..184063d 100644
--- a/src/clients/inquisitio/do_search.cc
+++ b/src/clients/inquisitio/do_search.cc
@@ -21,6 +21,7 @@
#include "command_line.hh"
#include "matcher.hh"
#include "extractor.hh"
+#include "query_task.hh"
#include <paludis/environment.hh>
#include <list>
@@ -46,7 +47,7 @@ do_search(const Environment & env)
extractors.push_back(ExtractorMaker::get_instance()->find_maker(*p)(env));
if (extractors.empty())
- extractors.push_back(ExtractorMaker::get_instance()->find_maker("description")(env));
+ extractors.push_back(ExtractorMaker::get_instance()->find_maker("text")(env));
MatcherOptions opts(false);
@@ -119,8 +120,8 @@ do_search(const Environment & env)
if (! match)
continue;
- std::cout << display_entry.name << std::endl;
-
+ InquisitioQueryTask query(&env);
+ query.show(PackageDepAtom(display_entry.name), &display_entry);
}
return 0;
diff --git a/src/clients/inquisitio/query_task.cc b/src/clients/inquisitio/query_task.cc
new file mode 100644
index 0000000..c0af578
--- /dev/null
+++ b/src/clients/inquisitio/query_task.cc
@@ -0,0 +1,29 @@
+/* vim: set sw=4 sts=4 et foldmethod=syntax : */
+
+/*
+ * Copyright (c) 2007 Ciaran McCreesh <ciaranm@ciaranm.org>
+ *
+ * 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
+ * Public License version 2, as published by the Free Software Foundation.
+ *
+ * Paludis is distributed in the hope that it will be useful, but WITHOUT ANY
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+ * details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+ * Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#include "query_task.hh"
+
+using namespace inquisitio;
+using namespace paludis;
+
+InquisitioQueryTask::InquisitioQueryTask(const Environment * const env) :
+ ConsoleQueryTask(env)
+{
+}
+
diff --git a/src/clients/inquisitio/query_task.hh b/src/clients/inquisitio/query_task.hh
new file mode 100644
index 0000000..61894b0
--- /dev/null
+++ b/src/clients/inquisitio/query_task.hh
@@ -0,0 +1,45 @@
+/* vim: set sw=4 sts=4 et foldmethod=syntax : */
+
+/*
+ * Copyright (c) 2007 Ciaran McCreesh <ciaranm@ciaranm.org>
+ *
+ * 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
+ * Public License version 2, as published by the Free Software Foundation.
+ *
+ * Paludis is distributed in the hope that it will be useful, but WITHOUT ANY
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+ * details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+ * Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifndef PALUDIS_GUARD_SRC_CLIENTS_INQUISITIO_QUERY_TASK_HH
+#define PALUDIS_GUARD_SRC_CLIENTS_INQUISITIO_QUERY_TASK_HH 1
+
+#include <src/output/console_query_task.hh>
+
+namespace inquisitio
+{
+ class InquisitioQueryTask :
+ public paludis::ConsoleQueryTask
+ {
+ public:
+ InquisitioQueryTask(const paludis::Environment * const);
+
+ virtual bool want_deps() const
+ {
+ return false;
+ }
+
+ virtual bool want_raw() const
+ {
+ return false;
+ }
+ };
+}
+
+#endif
diff --git a/src/clients/paludis/query.cc b/src/clients/paludis/query.cc
index 6000ee1..0ab183f 100644
--- a/src/clients/paludis/query.cc
+++ b/src/clients/paludis/query.cc
@@ -21,6 +21,7 @@
#include "query.hh"
#include <src/output/licence.hh>
#include <src/output/use_flag_pretty_printer.hh>
+#include <src/output/console_query_task.hh>
#include <functional>
#include <iomanip>
#include <iostream>
@@ -38,295 +39,37 @@ using std::cout;
using std::cerr;
using std::endl;
-void do_one_package_query(
- const Environment * const env,
- const std::string & q,
- MaskReasons & mask_reasons_to_explain,
- std::tr1::shared_ptr<PackageDepAtom> atom)
+namespace
{
- /* prefer the best installed version, then the best visible version, then
- * the best version */
- std::tr1::shared_ptr<const PackageDatabaseEntryCollection>
- entries(env->package_database()->query(*atom, is_any, qo_order_by_version)),
- preferred_entries(env->package_database()->query(*atom, is_installed_only, qo_order_by_version));
- if (entries->empty())
- throw NoSuchPackageError(q);
- if (preferred_entries->empty())
- preferred_entries = entries;
-
- PackageDatabaseEntry display_entry(*preferred_entries->last());
- for (PackageDatabaseEntryCollection::Iterator i(preferred_entries->begin()),
- i_end(preferred_entries->end()) ; i != i_end ; ++i)
- if (! env->mask_reasons(*i).any())
- display_entry = *i;
-
- /* match! display it. */
- cout << "* " << colour(cl_package_name, entries->begin()->name);
- if (atom->version_requirements_ptr())
- for (VersionRequirements::Iterator r(atom->version_requirements_ptr()->begin()),
- r_end(atom->version_requirements_ptr()->end()) ; r != r_end ; ++r)
- cout << " (" << r->version_operator << r->version_spec << ")";
- if (atom->slot_ptr())
- cout << " (:" << *atom->slot_ptr() << ")";
- if (atom->repository_ptr())
- cout << " (::" << *atom->repository_ptr() << ")";
- cout << endl;
-
- /* find all repository names. */
- RepositoryNameCollection::Concrete repo_names;
- PackageDatabaseEntryCollection::Iterator e(entries->begin()), e_end(entries->end());
- for ( ; e != e_end ; ++e)
- repo_names.append(e->repository);
-
- /* display versions, by repository. */
- RepositoryNameCollection::Iterator r(repo_names.begin()), r_end(repo_names.end());
- for ( ; r != r_end ; ++r)
+ class QueryTask :
+ public ConsoleQueryTask
{
- cout << " " << std::setw(22) << std::left <<
- (stringify(*r) + ":") << std::setw(0) << " ";
-
- std::string old_slot;
- for (e = entries->begin() ; e != e_end ; ++e)
- {
- Context context("When displaying entry '" + stringify(*e) + "':'");
-
- if (e->repository == *r)
+ public:
+ QueryTask(const Environment * const e) :
+ ConsoleQueryTask(e)
{
- std::tr1::shared_ptr<const VersionMetadata> metadata(env->package_database()->fetch_repository(
- e->repository)->version_metadata(e->name,
- e->version));
-
- /* show the slot, if we're about to move onto a new slot */
- std::string slot_name(stringify(metadata->slot));
- if (old_slot.empty())
- old_slot = slot_name;
- else if (old_slot != slot_name)
- cout << colour(cl_slot, "{:" + old_slot + "} ");
- old_slot = slot_name;
-
- const MaskReasons masks(env->mask_reasons(*e));
-
- if (masks.none())
- cout << colour(cl_visible, e->version);
- else
- {
- std::string reasons;
- for (MaskReason m(MaskReason(0)) ; m < last_mr ;
- m = MaskReason(static_cast<int>(m) + 1))
- {
- if (! masks.test(m))
- continue;
-
- switch (m)
- {
- case mr_keyword:
- reasons.append("K");
- break;
- case mr_user_mask:
- reasons.append("U");
- break;
- case mr_profile_mask:
- reasons.append("P");
- break;
- case mr_repository_mask:
- reasons.append("R");
- break;
- case mr_eapi:
- reasons.append("E");
- break;
- case mr_license:
- reasons.append("L");
- break;
- case mr_by_association:
- reasons.append("A");
- break;
- case last_mr:
- break;
- }
- }
- mask_reasons_to_explain |= masks;
- cout << colour(cl_masked, "(" + stringify(e->version) + ")" + reasons);
- }
-
- if (*e == display_entry)
- cout << "*";
- cout << " ";
}
- }
-
- /* still need to show the slot for the last item */
- cout << colour(cl_slot, "{:" + old_slot + "} ");
- cout << endl;
- }
-
- /* display metadata */
- std::tr1::shared_ptr<const VersionMetadata> metadata(env->package_database()->fetch_repository(
- display_entry.repository)->version_metadata(
- display_entry.name, display_entry.version));
-
- if (CommandLine::get_instance()->a_show_metadata.specified())
- {
- cout << " " << std::setw(22) << std::left << "DESCRIPTION:" << std::setw(0) <<
- " " << metadata->description << endl;
- cout << " " << std::setw(22) << std::left << "HOMEPAGE:" << std::setw(0) <<
- " " << metadata->homepage << endl;
-
- if (metadata->license_interface)
- cout << " " << std::setw(22) << std::left << "LICENSE:" << std::setw(0) <<
- " " << metadata->license_interface->license_string << endl;
-
- if (metadata->deps_interface)
- {
- cout << " " << std::setw(22) << std::left << "DEPEND:" << std::setw(0) <<
- " " << metadata->deps_interface->build_depend_string << endl;
- cout << " " << std::setw(22) << std::left << "RDEPEND:" << std::setw(0) <<
- " " << metadata->deps_interface->run_depend_string << endl;
- cout << " " << std::setw(22) << std::left << "PDEPEND:" << std::setw(0) <<
- " " << metadata->deps_interface->post_depend_string << endl;
- cout << " " << std::setw(22) << std::left << "SDEPEND:" << std::setw(0) <<
- " " << metadata->deps_interface->suggested_depend_string << endl;
- }
-
- if (metadata->cran_interface)
- {
- cout << " " << std::setw(22) << std::left << "KEYWORDS:" << std::setw(0) <<
- " " << metadata->cran_interface->keywords << endl;
- cout << " " << std::setw(22) << std::left << "PACKAGE:" << std::setw(0) <<
- " " << metadata->cran_interface->package << endl;
- cout << " " << std::setw(22) << std::left << "VERSION:" << std::setw(0) <<
- " " << metadata->cran_interface->version << endl;
- cout << " " << std::setw(22) << std::left << "IS_BUNDLE:" << std::setw(0) <<
- " " << std::boolalpha << metadata->cran_interface->is_bundle << endl;
- cout << " " << std::setw(22) << std::left << "IS_BUNDLE_MEMBER:" << std::setw(0) <<
- " " << std::boolalpha << metadata->cran_interface->is_bundle_member << endl;
- }
-
- if (metadata->ebuild_interface)
- {
- cout << " " << std::setw(22) << std::left << "IUSE:" << std::setw(0) <<
- " " << metadata->ebuild_interface->iuse << endl;
- cout << " " << std::setw(22) << std::left << "KEYWORDS:" << std::setw(0) <<
- " " << metadata->ebuild_interface->keywords << endl;
- cout << " " << std::setw(22) << std::left << "PROVIDE:" << std::setw(0) <<
- " " << metadata->ebuild_interface->provide_string << endl;
- cout << " " << std::setw(22) << std::left << "RESTRICT:" << std::setw(0) <<
- " " << metadata->ebuild_interface->restrict_string << endl;
- cout << " " << std::setw(22) << std::left << "SRC_URI:" << std::setw(0) <<
- " " << metadata->ebuild_interface->src_uri << endl;
- }
-
- if (metadata->origins_interface && metadata->origins_interface->source)
- cout << " " << std::setw(22) << std::left << "SOURCE_ORIGIN:" << std::setw(0)
- << " " << *metadata->origins_interface->source << endl;
- if (metadata->origins_interface && metadata->origins_interface->binary)
- cout << " " << std::setw(22) << std::left << "BINARY_ORIGIN::" << std::setw(0)
- << " " << *metadata->origins_interface->binary << endl;
-
- if (0 != env->package_database()->fetch_repository(display_entry.repository)->installed_interface)
- {
- time_t t(env->package_database()->fetch_repository(display_entry.repository
- )->installed_interface->installed_time(display_entry.name, display_entry.version));
- if (0 != t)
- cout << " " << std::setw(22) << std::left << "INSTALLED_TIME:" << std::setw(0)
- << " " << t << endl;
- }
- }
- else
- {
- if (! metadata->homepage.empty())
- cout << " " << std::setw(22) << std::left << "Homepage:" << std::setw(0) <<
- " " << metadata->homepage << endl;
-
- if (! metadata->description.empty())
- cout << " " << std::setw(22) << std::left << "Description:" << std::setw(0) <<
- " " << metadata->description << endl;
-
- if (metadata->license_interface && ! metadata->license_interface->license_string.empty())
- {
- cout << " " << std::setw(22) << std::left << "License:" << std::setw(0) << " ";
- LicenceDisplayer d(cout, env, &display_entry);
- metadata->license_interface->license()->accept(&d);
- cout << endl;
- }
-
- if (CommandLine::get_instance()->a_show_deps.specified() && metadata->deps_interface)
- {
- if (! metadata->deps_interface->build_depend_string.empty())
- {
- DepAtomPrettyPrinter p_depend(12);
- metadata->deps_interface->build_depend()->accept(&p_depend);
- cout << " " << std::setw(22) << std::left << "Build dependencies:" << std::setw(0)
- << endl << p_depend;
- }
-
- if (! metadata->deps_interface->run_depend_string.empty())
- {
- DepAtomPrettyPrinter p_depend(12);
- metadata->deps_interface->run_depend()->accept(&p_depend);
- cout << " " << std::setw(22) << std::left << "Runtime dependencies:" << std::setw(0)
- << endl << p_depend;
- }
-
- if (! metadata->deps_interface->post_depend_string.empty())
- {
- DepAtomPrettyPrinter p_depend(12);
- metadata->deps_interface->post_depend()->accept(&p_depend);
- cout << " " << std::setw(22) << std::left << "Post dependencies:" << std::setw(0)
- << endl << p_depend;
- }
-
- if (! metadata->deps_interface->suggested_depend_string.empty())
+ bool want_deps() const
{
- DepAtomPrettyPrinter s_depend(12);
- metadata->deps_interface->suggested_depend()->accept(&s_depend);
- cout << " " << std::setw(22) << std::left << "Suggested dependencies:" << std::setw(0)
- << endl << s_depend;
+ return CommandLine::get_instance()->a_show_deps.specified() || want_raw();
}
- }
-
- if (metadata->origins_interface && metadata->origins_interface->source)
- cout << " " << std::setw(22) << std::left << "Source origin:" << std::setw(0)
- << " " << colour(cl_package_name, *metadata->origins_interface->source) << endl;
- if (metadata->origins_interface && metadata->origins_interface->binary)
- cout << " " << std::setw(22) << std::left << "Binary origin:" << std::setw(0)
- << " " << colour(cl_package_name, *metadata->origins_interface->binary) << endl;
-
- if (0 != env->package_database()->fetch_repository(display_entry.repository)->installed_interface)
- {
- time_t t(env->package_database()->fetch_repository(display_entry.repository
- )->installed_interface->installed_time(display_entry.name, display_entry.version));
- if (0 != t)
- {
- char buf[255];
- if (strftime(buf, 254, "%c", localtime(&t)))
- cout << " " << std::setw(22) << std::left << "Installed time:" << std::setw(0)
- << " " << buf << endl;
- }
- }
- if (metadata->ebuild_interface)
- {
- if (! metadata->ebuild_interface->provide_string.empty())
- cout << " " << std::setw(22) << std::left << "Provides:" << std::setw(0) <<
- " " << metadata->ebuild_interface->provide_string << endl;
-
- if (! metadata->ebuild_interface->iuse.empty())
+ bool want_raw() const
{
- cout << " " << std::setw(22) << std::left << "Use flags:" << std::setw(0) << " ";
- UseFlagPrettyPrinter printer(DefaultEnvironment::get_instance());
- printer.print_package_flags(display_entry);
- cout << endl;
+ return CommandLine::get_instance()->a_show_metadata.specified();
}
- }
-
- if (metadata->virtual_interface)
- cout << " " << std::setw(22) << std::left << "Virtual for:" << std::setw(0) <<
- " " << metadata->virtual_interface->virtual_for << endl;
- }
-
+ };
+}
- /* blank line */
+void do_one_package_query(
+ const Environment * const env,
+ MaskReasons & mask_reasons_to_explain,
+ std::tr1::shared_ptr<PackageDepAtom> atom)
+{
+ QueryTask query(env);
+ query.show(*atom);
+ mask_reasons_to_explain |= query.mask_reasons_to_explain();
cout << endl;
}
@@ -371,7 +114,7 @@ void do_one_query(
atom.reset(new PackageDepAtom(q));
if (atom)
- do_one_package_query(env, q, mask_reasons_to_explain, atom);
+ do_one_package_query(env, mask_reasons_to_explain, atom);
else
do_one_set_query(env, q, mask_reasons_to_explain, set);
}
diff --git a/src/output/Makefile.am b/src/output/Makefile.am
index 53c2567..8b5259b 100644
--- a/src/output/Makefile.am
+++ b/src/output/Makefile.am
@@ -7,7 +7,9 @@ BUILT_SOURCES = console_install_task-sr.hh console_install_task-sr.cc
noinst_LIBRARIES = liboutput.a
liboutput_a_SOURCES = \
colour.cc colour.hh \
+ console_task.cc console_task.hh \
console_install_task.cc console_install_task.hh \
+ console_query_task.cc console_query_task.hh \
use_flag_pretty_printer.cc use_flag_pretty_printer.hh \
licence.cc licence.hh
diff --git a/src/output/console_install_task.cc b/src/output/console_install_task.cc
index 9d301e3..96dc929 100644
--- a/src/output/console_install_task.cc
+++ b/src/output/console_install_task.cc
@@ -985,129 +985,6 @@ ConsoleInstallTask::display_merge_list_entry_end(const DepListEntry &, const Dis
output_endl();
}
-void
-ConsoleInstallTask::output_activity_start_message(const std::string & s) const
-{
- output_stream() << s << "..." << std::flush;
-}
-
-void
-ConsoleInstallTask::output_activity_end_message() const
-{
- output_stream() << std::endl;
-}
-
-void
-ConsoleInstallTask::output_heading(const std::string & s) const
-{
- output_stream() << std::endl << colour(cl_heading, s) << std::endl << std::endl;
-}
-
-void
-ConsoleInstallTask::output_xterm_title(const std::string & s) const
-{
- output_xterm_stream() << xterm_title(s);
-}
-
-void
-ConsoleInstallTask::output_starred_item(const std::string & s, const unsigned indent) const
-{
- if (0 != indent)
- output_stream() << std::string(2 * indent, ' ') << "* " << s << std::endl;
- else
- output_stream() << "* " << s << std::endl;
-}
-
-void
-ConsoleInstallTask::output_starred_item_no_endl(const std::string & s) const
-{
- output_stream() << "* " << s;
-}
-
-void
-ConsoleInstallTask::output_unstarred_item(const std::string & s) const
-{
- output_stream() << s << std::endl;
-}
-
-void
-ConsoleInstallTask::output_no_endl(const std::string & s) const
-{
- output_stream() << s;
-}
-
-void
-ConsoleInstallTask::output_endl() const
-{
- output_stream() << std::endl;
-}
-
-std::ostream &
-ConsoleInstallTask::output_stream() const
-{
- return std::cout;
-}
-
-std::ostream &
-ConsoleInstallTask::output_xterm_stream() const
-{
- return std::cerr;
-}
-
-std::string
-ConsoleInstallTask::render_as_package_name(const std::string & s) const
-{
- return colour(cl_package_name, s);
-}
-
-std::string
-ConsoleInstallTask::render_as_set_name(const std::string & s) const
-{
- return colour(cl_package_name, s);
-}
-
-std::string
-ConsoleInstallTask::render_as_tag(const std::string & s) const
-{
- return colour(cl_tag, s);
-}
-
-std::string
-ConsoleInstallTask::render_as_unimportant(const std::string & s) const
-{
- return colour(cl_unimportant, s);
-}
-
-std::string
-ConsoleInstallTask::render_as_slot_name(const std::string & s) const
-{
- return colour(cl_slot, s);
-}
-
-std::string
-ConsoleInstallTask::render_as_update_mode(const std::string & s) const
-{
- return colour(cl_updatemode, s);
-}
-
-std::string
-ConsoleInstallTask::render_as_error(const std::string & s) const
-{
- return colour(cl_error, s);
-}
-
-std::string
-ConsoleInstallTask::render_as_masked(const std::string & s) const
-{
- return colour(cl_masked, s);
-}
-
-std::string
-ConsoleInstallTask::render_plural(int c, const std::string & s, const std::string & p) const
-{
- return 1 == c ? s : p;
-}
-
std::tr1::shared_ptr<DepTagSummaryDisplayer>
ConsoleInstallTask::make_dep_tag_summary_displayer()
{
diff --git a/src/output/console_install_task.hh b/src/output/console_install_task.hh
index 7b7cd37..16ad01e 100644
--- a/src/output/console_install_task.hh
+++ b/src/output/console_install_task.hh
@@ -23,6 +23,7 @@
#include <paludis/tasks/install_task.hh>
#include <paludis/package_database_entry.hh>
#include <src/output/use_flag_pretty_printer.hh>
+#include <src/output/console_task.hh>
#include <iosfwd>
namespace paludis
@@ -84,7 +85,8 @@ namespace paludis
};
class PALUDIS_VISIBLE ConsoleInstallTask :
- public InstallTask
+ public InstallTask,
+ public ConsoleTask
{
public:
enum Count
@@ -161,39 +163,6 @@ namespace paludis
virtual void on_update_world_post();
virtual void on_preserve_world();
- ///\name Output routines
- ///\{
-
- virtual std::ostream & output_stream() const;
- virtual std::ostream & output_xterm_stream() const;
-
- virtual void output_activity_start_message(const std::string &) const;
- virtual void output_activity_end_message() const;
- virtual void output_heading(const std::string &) const;
- virtual void output_xterm_title(const std::string &) const;
- virtual void output_starred_item(const std::string &, const unsigned indent = 0) const;
- virtual void output_starred_item_no_endl(const std::string &) const;
- virtual void output_unstarred_item(const std::string &) const;
- virtual void output_no_endl(const std::string &) const;
- virtual void output_endl() const;
-
- ///\}
-
- ///\name Render routines
- ///\{
-
- virtual std::string render_as_package_name(const std::string &) const;
- virtual std::string render_as_set_name(const std::string &) const;
- virtual std::string render_as_tag(const std::string &) const;
- virtual std::string render_as_unimportant(const std::string &) const;
- virtual std::string render_as_error(const std::string &) const;
- virtual std::string render_as_masked(const std::string &) const;
- virtual std::string render_as_slot_name(const std::string &) const;
- virtual std::string render_as_update_mode(const std::string &) const;
- virtual std::string render_plural(int count, const std::string &, const std::string &) const;
-
- ///\}
-
///\name More granular display routines
///\{
diff --git a/src/output/console_query_task.cc b/src/output/console_query_task.cc
new file mode 100644
index 0000000..f18127b
--- /dev/null
+++ b/src/output/console_query_task.cc
@@ -0,0 +1,398 @@
+/* vim: set sw=4 sts=4 et foldmethod=syntax : */
+
+/*
+ * Copyright (c) 2007 Ciaran McCreesh <ciaranm@ciaranm.org>
+ *
+ * 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
+ * Public License version 2, as published by the Free Software Foundation.
+ *
+ * Paludis is distributed in the hope that it will be useful, but WITHOUT ANY
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+ * details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+ * Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#include "console_query_task.hh"
+#include "licence.hh"
+#include "use_flag_pretty_printer.hh"
+#include <paludis/util/collection_concrete.hh>
+#include <paludis/util/tokeniser.hh>
+#include <list>
+
+using namespace paludis;
+
+namespace paludis
+{
+ template<>
+ struct Implementation<ConsoleQueryTask>
+ {
+ const Environment * const env;
+ mutable MaskReasons mask_reasons_to_explain;
+
+ Implementation(const Environment * const e) :
+ env(e)
+ {
+ }
+ };
+}
+
+ConsoleQueryTask::ConsoleQueryTask(const Environment * const e) :
+ PrivateImplementationPattern<ConsoleQueryTask>(new Implementation<ConsoleQueryTask>(e))
+{
+}
+
+ConsoleQueryTask::~ConsoleQueryTask()
+{
+}
+
+void
+ConsoleQueryTask::show(const PackageDepAtom & a, const PackageDatabaseEntry * display_entry) const
+{
+ /* prefer the best installed version, then the best visible version, then
+ * the best version */
+ std::tr1::shared_ptr<const PackageDatabaseEntryCollection>
+ entries(_imp->env->package_database()->query(a, is_any, qo_order_by_version)),
+ preferred_entries(_imp->env->package_database()->query(a, is_installed_only, qo_order_by_version));
+ if (entries->empty())
+ throw NoSuchPackageError(stringify(a));
+ if (preferred_entries->empty())
+ preferred_entries = entries;
+
+ if (! display_entry)
+ {
+ display_entry = &*preferred_entries->last();
+ for (PackageDatabaseEntryCollection::Iterator i(preferred_entries->begin()),
+ i_end(preferred_entries->end()) ; i != i_end ; ++i)
+ if (! _imp->env->mask_reasons(*i).any())
+ display_entry = &*i;
+ }
+
+ display_header(a, *display_entry);
+ display_versions_by_repository(a, entries, *display_entry);
+ display_metadata(a, *display_entry);
+ output_endl();
+}
+
+void
+ConsoleQueryTask::display_header(const PackageDepAtom & a, const PackageDatabaseEntry & e) const
+{
+ if (a.version_requirements_ptr() || a.slot_ptr() || a.use_requirements_ptr() ||
+ a.repository_ptr())
+ output_starred_item(render_as_package_name(stringify(a)));
+ else
+ output_starred_item(render_as_package_name(stringify(e.name)));
+}
+
+void
+ConsoleQueryTask::display_versions_by_repository(const PackageDepAtom &,
+ std::tr1::shared_ptr<const PackageDatabaseEntryCollection> entries,
+ const PackageDatabaseEntry & display_entry) const
+{
+ /* find all repository names. */
+ RepositoryNameCollection::Concrete repo_names;
+ PackageDatabaseEntryCollection::Iterator e(entries->begin()), e_end(entries->end());
+ for ( ; e != e_end ; ++e)
+ repo_names.append(e->repository);
+
+ /* display versions, by repository. */
+ RepositoryNameCollection::Iterator r(repo_names.begin()), r_end(repo_names.end());
+ for ( ; r != r_end ; ++r)
+ {
+ output_left_column(stringify(*r) + ":");
+
+ std::string old_slot, right_column;
+ for (e = entries->begin() ; e != e_end ; ++e)
+ {
+ Context context("When displaying entry '" + stringify(*e) + "':'");
+
+ if (e->repository == *r)
+ {
+ std::tr1::shared_ptr<const VersionMetadata> metadata(
+ _imp->env->package_database()->fetch_repository(e->repository)->version_metadata(e->name,
+ e->version));
+
+ /* show the slot, if we're about to move onto a new slot */
+ std::string slot_name(stringify(metadata->slot));
+ if (old_slot.empty())
+ old_slot = slot_name;
+ else if (old_slot != slot_name)
+ right_column.append(render_as_slot_name("{:" + old_slot + "} "));
+ old_slot = slot_name;
+
+ const MaskReasons masks(_imp->env->mask_reasons(*e));
+
+ if (masks.none())
+ right_column.append(render_as_visible(stringify(e->version)));
+ else
+ {
+ std::string reasons;
+ for (MaskReason m(MaskReason(0)) ; m < last_mr ;
+ m = MaskReason(static_cast<int>(m) + 1))
+ {
+ if (! masks.test(m))
+ continue;
+
+ switch (m)
+ {
+ case mr_keyword:
+ reasons.append("K");
+ break;
+ case mr_user_mask:
+ reasons.append("U");
+ break;
+ case mr_profile_mask:
+ reasons.append("P");
+ break;
+ case mr_repository_mask:
+ reasons.append("R");
+ break;
+ case mr_eapi:
+ reasons.append("E");
+ break;
+ case mr_license:
+ reasons.append("L");
+ break;
+ case mr_by_association:
+ reasons.append("A");
+ break;
+ case last_mr:
+ break;
+ }
+ }
+ _imp->mask_reasons_to_explain |= masks;
+ right_column.append(render_as_masked("(" + stringify(e->version) + ")" + reasons));
+ }
+
+ if (*e == display_entry)
+ right_column.append("*");
+ right_column.append(" ");
+ }
+ }
+
+ /* still need to show the slot for the last item */
+ right_column.append(render_as_slot_name("{:" + old_slot + "} "));
+
+ output_right_column(right_column);
+ }
+}
+
+void
+ConsoleQueryTask::display_metadata(const PackageDepAtom &, const PackageDatabaseEntry & e) const
+{
+ std::tr1::shared_ptr<const VersionMetadata> metadata(_imp->env->package_database()->fetch_repository(e.repository)->
+ version_metadata(e.name, e.version));
+
+ display_metadata_key("Homepage", "HOMEPAGE", metadata->homepage);
+ display_metadata_key("Description", "DESCRIPTION", metadata->description);
+
+ if (metadata->license_interface)
+ display_metadata_license("License", "LICENSE", metadata->license_interface->license(), e);
+
+ if (want_deps() && metadata->deps_interface)
+ {
+ display_metadata_dep("Build dependencies", "DEPEND", metadata->deps_interface->build_depend(), want_raw());
+ display_metadata_dep("Runtime dependencies", "RDEPEND", metadata->deps_interface->run_depend(), want_raw());
+ display_metadata_dep("Post dependencies", "PDEPEND", metadata->deps_interface->post_depend(), want_raw());
+ display_metadata_dep("Suggested dependencies", "SDEPEND", metadata->deps_interface->suggested_depend(), want_raw());
+ }
+
+ if (metadata->origins_interface)
+ {
+ if (metadata->origins_interface->source)
+ display_metadata_pde("Source origin", "SOURCE_ORIGIN", *metadata->origins_interface->source);
+ if (metadata->origins_interface->binary)
+ display_metadata_pde("Binary origin", "BINARY_ORIGIN", *metadata->origins_interface->binary);
+ }
+
+ if (0 != _imp->env->package_database()->fetch_repository(e.repository)->installed_interface)
+ display_metadata_time("Installed time", "INSTALLED_TIME", _imp->env->package_database()->fetch_repository(
+ e.repository)->installed_interface->installed_time(e.name, e.version));
+
+ if (metadata->ebuild_interface)
+ {
+ display_metadata_dep("Provides", "PROVIDE", metadata->ebuild_interface->provide(), true);
+ display_metadata_iuse("Use flags", "IUSE", metadata->ebuild_interface->iuse, e);
+ if (want_raw())
+ {
+ display_metadata_key("Keywords", "KEYWORDS", metadata->ebuild_interface->keywords);
+ display_metadata_key("SRC_URI", "SRC_URI", metadata->ebuild_interface->src_uri);
+ display_metadata_key("Restrict", "RESTRICT", metadata->ebuild_interface->restrict_string);
+ }
+ }
+
+ if (metadata->virtual_interface)
+ display_metadata_pde("Virtual for", "VIRTUAL_FOR", metadata->virtual_interface->virtual_for);
+}
+
+namespace
+{
+ std::string normalise(const std::string & s)
+ {
+ std::list<std::string> w;
+ WhitespaceTokeniser::get_instance()->tokenise(s, std::back_inserter(w));
+ return join(w.begin(), w.end(), " ");
+ }
+}
+
+void
+ConsoleQueryTask::display_metadata_key(const std::string & k, const std::string & kk, const std::string & v) const
+{
+ if (v.empty())
+ return;
+
+ output_left_column((want_raw() ? kk : k) + ":");
+ output_right_column(normalise(v));
+}
+
+void
+ConsoleQueryTask::display_metadata_license(const std::string & k, const std::string & kk, std::tr1::shared_ptr<const DepAtom> l,
+ const PackageDatabaseEntry & display_entry) const
+{
+ output_left_column((want_raw() ? kk : k) + ":");
+
+ if (want_raw())
+ {
+ DepAtomPrettyPrinter p(0, false);
+ l->accept(&p);
+ output_right_column(stringify(p));
+ }
+ else
+ {
+ LicenceDisplayer d(output_stream(), _imp->env, &display_entry);
+ l->accept(&d);
+ output_right_column("");
+ }
+}
+
+namespace
+{
+ struct IsEmpty :
+ DepAtomVisitorTypes::ConstVisitor,
+ DepAtomVisitorTypes::ConstVisitor::VisitChildren<IsEmpty, AllDepAtom>,
+ DepAtomVisitorTypes::ConstVisitor::VisitChildren<IsEmpty, AnyDepAtom>,
+ DepAtomVisitorTypes::ConstVisitor::VisitChildren<IsEmpty, UseDepAtom>
+ {
+ using DepAtomVisitorTypes::ConstVisitor::VisitChildren<IsEmpty, AnyDepAtom>::visit;
+ using DepAtomVisitorTypes::ConstVisitor::VisitChildren<IsEmpty, AllDepAtom>::visit;
+ using DepAtomVisitorTypes::ConstVisitor::VisitChildren<IsEmpty, UseDepAtom>::visit;
+
+ bool empty;
+
+ IsEmpty() :
+ empty(true)
+ {
+ }
+
+ void visit(const PackageDepAtom *)
+ {
+ empty = false;
+ }
+
+ void visit(const BlockDepAtom *)
+ {
+ empty = false;
+ }
+
+ void visit(const PlainTextDepAtom *)
+ {
+ empty = false;
+ }
+ };
+
+ bool is_empty(std::tr1::shared_ptr<const DepAtom> d)
+ {
+ IsEmpty e;
+ d->accept(&e);
+ return e.empty;
+ }
+}
+
+void
+ConsoleQueryTask::display_metadata_dep(const std::string & k, const std::string & kk,
+ std::tr1::shared_ptr<const DepAtom> d, const bool one_line) const
+{
+ if (is_empty(d))
+ return;
+
+ output_left_column((want_raw() ? kk : k) + ":");
+
+ if (one_line)
+ {
+ DepAtomPrettyPrinter p(0, false);
+ d->accept(&p);
+ output_stream() << p << std::endl;
+ }
+ else
+ {
+ output_right_column("");
+ DepAtomPrettyPrinter p(left_column_width() + 5);
+ d->accept(&p);
+ output_stream() << p;
+ }
+}
+
+void
+ConsoleQueryTask::display_metadata_pde(const std::string & k, const std::string & kk,
+ const PackageDatabaseEntry & v) const
+{
+ output_left_column((want_raw() ? kk : k) + ":");
+ if (want_raw())
+ output_right_column(stringify(v));
+ else
+ output_right_column(render_as_package_name(stringify(v.name)) + "-"
+ + stringify(v.version) + "::" + stringify(v.repository));
+}
+
+void
+ConsoleQueryTask::display_metadata_time(const std::string & k, const std::string & kk,
+ time_t t) const
+{
+ if (0 == t)
+ return;
+
+ if (want_raw())
+ {
+ output_left_column(kk + ":");
+ output_right_column(stringify(t));
+ }
+ else
+ {
+ char buf[255];
+ if (strftime(buf, 254, "%c", gmtime(&t)))
+ {
+ output_left_column(k + ":");
+ output_right_column(stringify(buf));
+ }
+ }
+}
+
+void
+ConsoleQueryTask::display_metadata_iuse(const std::string & k, const std::string & kk,
+ const std::string & v, const PackageDatabaseEntry & e) const
+{
+ if (v.empty())
+ return;
+
+ output_left_column((want_raw() ? kk : k) + ":");
+
+ if (want_raw())
+ output_right_column(normalise(v));
+ else
+ {
+ UseFlagPrettyPrinter printer(_imp->env);
+ printer.print_package_flags(e);
+ output_right_column("");
+ }
+}
+
+const MaskReasons
+ConsoleQueryTask::mask_reasons_to_explain() const
+{
+ return _imp->mask_reasons_to_explain;
+}
+
diff --git a/src/output/console_query_task.hh b/src/output/console_query_task.hh
new file mode 100644
index 0000000..ef152f9
--- /dev/null
+++ b/src/output/console_query_task.hh
@@ -0,0 +1,64 @@
+/* vim: set sw=4 sts=4 et foldmethod=syntax : */
+
+/*
+ * Copyright (c) 2007 Ciaran McCreesh <ciaranm@ciaranm.org>
+ *
+ * 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
+ * Public License version 2, as published by the Free Software Foundation.
+ *
+ * Paludis is distributed in the hope that it will be useful, but WITHOUT ANY
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+ * details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+ * Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifndef PALUDIS_GUARD_SRC_OUTPUT_CONSOLE_QUERY_TASK_HH
+#define PALUDIS_GUARD_SRC_OUTPUT_CONSOLE_QUERY_TASK_HH 1
+
+#include <paludis/environment.hh>
+#include <paludis/dep_atom.hh>
+#include <src/output/console_task.hh>
+
+namespace paludis
+{
+ class ConsoleQueryTask :
+ private PrivateImplementationPattern<ConsoleQueryTask>,
+ public ConsoleTask
+ {
+ protected:
+ ConsoleQueryTask(const Environment * const env);
+
+ public:
+ virtual ~ConsoleQueryTask();
+
+ virtual void show(const PackageDepAtom &, const PackageDatabaseEntry * = 0) const;
+
+ virtual void display_header(const PackageDepAtom &, const PackageDatabaseEntry &) const;
+ virtual void display_versions_by_repository(const PackageDepAtom &,
+ std::tr1::shared_ptr<const PackageDatabaseEntryCollection>, const PackageDatabaseEntry &) const;
+ virtual void display_metadata(const PackageDepAtom &, const PackageDatabaseEntry &) const;
+
+ virtual void display_metadata_key(const std::string &, const std::string &,
+ const std::string &) const;
+ virtual void display_metadata_license(const std::string &, const std::string &,
+ std::tr1::shared_ptr<const DepAtom>, const PackageDatabaseEntry &) const;
+ virtual void display_metadata_dep(const std::string &, const std::string &,
+ std::tr1::shared_ptr<const DepAtom>, const bool one_line) const;
+ virtual void display_metadata_pde(const std::string &, const std::string &, const PackageDatabaseEntry &) const;
+ virtual void display_metadata_time(const std::string &, const std::string &, time_t) const;
+ virtual void display_metadata_iuse(const std::string &, const std::string &, const std::string &,
+ const PackageDatabaseEntry &) const;
+
+ virtual bool want_deps() const = 0;
+ virtual bool want_raw() const = 0;
+
+ const MaskReasons mask_reasons_to_explain() const;
+ };
+}
+
+#endif
diff --git a/src/output/console_task.cc b/src/output/console_task.cc
new file mode 100644
index 0000000..60f9e91
--- /dev/null
+++ b/src/output/console_task.cc
@@ -0,0 +1,187 @@
+/* vim: set sw=4 sts=4 et foldmethod=syntax : */
+
+/*
+ * Copyright (c) 2006, 2007 Ciaran McCreesh <ciaranm@ciaranm.org>
+ *
+ * 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
+ * Public License version 2, as published by the Free Software Foundation.
+ *
+ * Paludis is distributed in the hope that it will be useful, but WITHOUT ANY
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+ * details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+ * Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#include "console_task.hh"
+#include "colour.hh"
+#include <iostream>
+#include <iomanip>
+
+using namespace paludis;
+
+ConsoleTask::ConsoleTask()
+{
+}
+
+ConsoleTask::~ConsoleTask()
+{
+}
+
+void
+ConsoleTask::output_activity_start_message(const std::string & s) const
+{
+ output_stream() << s << "..." << std::flush;
+}
+
+void
+ConsoleTask::output_activity_end_message() const
+{
+ output_stream() << std::endl;
+}
+
+void
+ConsoleTask::output_heading(const std::string & s) const
+{
+ output_stream() << std::endl << colour(cl_heading, s) << std::endl << std::endl;
+}
+
+void
+ConsoleTask::output_xterm_title(const std::string & s) const
+{
+ output_xterm_stream() << xterm_title(s);
+}
+
+void
+ConsoleTask::output_starred_item(const std::string & s, const unsigned indent) const
+{
+ if (0 != indent)
+ output_stream() << std::string(2 * indent, ' ') << "* " << s << std::endl;
+ else
+ output_stream() << "* " << s << std::endl;
+}
+
+void
+ConsoleTask::output_starred_item_no_endl(const std::string & s) const
+{
+ output_stream() << "* " << s;
+}
+
+void
+ConsoleTask::output_unstarred_item(const std::string & s) const
+{
+ output_stream() << s << std::endl;
+}
+
+void
+ConsoleTask::output_no_endl(const std::string & s) const
+{
+ output_stream() << s;
+}
+
+void
+ConsoleTask::output_endl() const
+{
+ output_stream() << std::endl;
+}
+
+std::ostream &
+ConsoleTask::output_stream() const
+{
+ return std::cout;
+}
+
+std::ostream &
+ConsoleTask::output_xterm_stream() const
+{
+ return std::cerr;
+}
+
+std::string
+ConsoleTask::render_as_package_name(const std::string & s) const
+{
+ return colour(cl_package_name, s);
+}
+
+std::string
+ConsoleTask::render_as_repository_name(const std::string & s) const
+{
+ return colour(cl_repository_name, s);
+}
+
+std::string
+ConsoleTask::render_as_set_name(const std::string & s) const
+{
+ return colour(cl_package_name, s);
+}
+
+std::string
+ConsoleTask::render_as_tag(const std::string & s) const
+{
+ return colour(cl_tag, s);
+}
+
+std::string
+ConsoleTask::render_as_unimportant(const std::string & s) const
+{
+ return colour(cl_unimportant, s);
+}
+
+std::string
+ConsoleTask::render_as_slot_name(const std::string & s) const
+{
+ return colour(cl_slot, s);
+}
+
+std::string
+ConsoleTask::render_as_update_mode(const std::string & s) const
+{
+ return colour(cl_updatemode, s);
+}
+
+std::string
+ConsoleTask::render_as_error(const std::string & s) const
+{
+ return colour(cl_error, s);
+}
+
+std::string
+ConsoleTask::render_as_masked(const std::string & s) const
+{
+ return colour(cl_masked, s);
+}
+
+std::string
+ConsoleTask::render_as_visible(const std::string & s) const
+{
+ return colour(cl_visible, s);
+}
+
+std::string
+ConsoleTask::render_plural(int c, const std::string & s, const std::string & p) const
+{
+ return 1 == c ? s : p;
+}
+
+void
+ConsoleTask::output_left_column(const std::string & s) const
+{
+ output_stream() << " " << std::setw(left_column_width()) << std::left << s << " ";
+}
+
+void
+ConsoleTask::output_right_column(const std::string & s) const
+{
+ output_stream() << s << std::endl;
+}
+
+int
+ConsoleTask::left_column_width() const
+{
+ return 18;
+}
+
diff --git a/src/output/console_task.hh b/src/output/console_task.hh
new file mode 100644
index 0000000..8b13cd8
--- /dev/null
+++ b/src/output/console_task.hh
@@ -0,0 +1,83 @@
+/* vim: set sw=4 sts=4 et foldmethod=syntax : */
+
+/*
+ * Copyright (c) 2006, 2007 Ciaran McCreesh <ciaranm@ciaranm.org>
+ *
+ * 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
+ * Public License version 2, as published by the Free Software Foundation.
+ *
+ * Paludis is distributed in the hope that it will be useful, but WITHOUT ANY
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+ * details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+ * Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifndef PALUDIS_GUARD_SRC_OUTPUT_CONSOLE_TASK_HH
+#define PALUDIS_GUARD_SRC_OUTPUT_CONSOLE_TASK_HH 1
+
+#include <iosfwd>
+#include <string>
+
+namespace paludis
+{
+ class ConsoleTask
+ {
+ protected:
+ ConsoleTask();
+
+ public:
+ virtual ~ConsoleTask();
+
+ ///\name Settings
+ ///\{
+
+ virtual int left_column_width() const;
+
+ ///\}
+
+ ///\name Output routines
+ ///\{
+
+ virtual std::ostream & output_stream() const;
+ virtual std::ostream & output_xterm_stream() const;
+
+ virtual void output_activity_start_message(const std::string &) const;
+ virtual void output_activity_end_message() const;
+ virtual void output_heading(const std::string &) const;
+ virtual void output_xterm_title(const std::string &) const;
+ virtual void output_starred_item(const std::string &, const unsigned indent = 0) const;
+ virtual void output_starred_item_no_endl(const std::string &) const;
+ virtual void output_unstarred_item(const std::string &) const;
+ virtual void output_no_endl(const std::string &) const;
+ virtual void output_endl() const;
+
+ virtual void output_left_column(const std::string &) const;
+ virtual void output_right_column(const std::string &) const;
+
+ ///\}
+
+ ///\name Render routines
+ ///\{
+
+ virtual std::string render_as_package_name(const std::string &) const;
+ virtual std::string render_as_repository_name(const std::string &) const;
+ virtual std::string render_as_set_name(const std::string &) const;
+ virtual std::string render_as_tag(const std::string &) const;
+ virtual std::string render_as_unimportant(const std::string &) const;
+ virtual std::string render_as_error(const std::string &) const;
+ virtual std::string render_as_masked(const std::string &) const;
+ virtual std::string render_as_visible(const std::string &) const;
+ virtual std::string render_as_slot_name(const std::string &) const;
+ virtual std::string render_as_update_mode(const std::string &) const;
+ virtual std::string render_plural(int count, const std::string &, const std::string &) const;
+
+ ///\}
+ };
+}
+
+#endif