diff options
author | 2010-12-30 22:48:34 +0000 | |
---|---|---|
committer | 2011-01-01 03:57:53 +0000 | |
commit | 3dd53676acf85d7b3d9758f2def081d20c00b3b9 (patch) | |
tree | 7214265998b38ce234a4198a4c2b9533aeea5f4d /paludis/repositories/accounts | |
parent | cdaf7c2138035625d99ee5be127f427943b66e09 (diff) | |
download | paludis-3dd53676acf85d7b3d9758f2def081d20c00b3b9.tar.gz paludis-3dd53676acf85d7b3d9758f2def081d20c00b3b9.tar.xz |
Better pretty printing mechanism
Diffstat (limited to 'paludis/repositories/accounts')
-rw-r--r-- | paludis/repositories/accounts/accounts_dep_key.cc | 20 | ||||
-rw-r--r-- | paludis/repositories/accounts/accounts_dep_key.hh | 6 |
2 files changed, 25 insertions, 1 deletions
diff --git a/paludis/repositories/accounts/accounts_dep_key.cc b/paludis/repositories/accounts/accounts_dep_key.cc index d208bee2b..d7d3aec1d 100644 --- a/paludis/repositories/accounts/accounts_dep_key.cc +++ b/paludis/repositories/accounts/accounts_dep_key.cc @@ -32,6 +32,7 @@ #include <paludis/util/pimp-impl.hh> #include <paludis/partially_made_package_dep_spec.hh> #include <paludis/always_enabled_dependency_label.hh> +#include <paludis/pretty_printer.hh> #include <sstream> #include <list> @@ -155,3 +156,22 @@ AccountsDepKey::pretty_print_flat(const DependencySpecTree::ItemFormatter & f) c return s.str(); } +const std::string +AccountsDepKey::pretty_print_value( + const PrettyPrinter & pretty_printer, + const PrettyPrintOptions &) const +{ + std::stringstream s; + + for (std::list<std::shared_ptr<PackageDepSpec> >::const_iterator i(_imp->specs->begin()), + i_end(_imp->specs->end()) ; i != i_end ; ++i) + { + if (! s.str().empty()) + s << ", "; + + s << pretty_printer.prettify(**i); + } + + return s.str(); +} + diff --git a/paludis/repositories/accounts/accounts_dep_key.hh b/paludis/repositories/accounts/accounts_dep_key.hh index b31cdc2c8..d269c00fb 100644 --- a/paludis/repositories/accounts/accounts_dep_key.hh +++ b/paludis/repositories/accounts/accounts_dep_key.hh @@ -1,7 +1,7 @@ /* vim: set sw=4 sts=4 et foldmethod=syntax : */ /* - * Copyright (c) 2009 Ciaran McCreesh + * Copyright (c) 2009, 2010 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 @@ -49,6 +49,10 @@ namespace paludis PALUDIS_ATTRIBUTE((warn_unused_result)); virtual const std::shared_ptr<const DependenciesLabelSequence> initial_labels() const PALUDIS_ATTRIBUTE((warn_unused_result)); + + virtual const std::string pretty_print_value( + const PrettyPrinter &, + const PrettyPrintOptions &) const PALUDIS_ATTRIBUTE((warn_unused_result)); }; } } |