summaryrefslogtreecommitdiff
path: root/src/cmdline/cmdline_show.h
blob: ebc33f820019e48ba2b6c53eab179d29c01affda (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
// cmdline_show.h                                      -*-c++-*-
//
// Copyright (C) 2004, 2010 Daniel Burrows
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License as
// published by the Free Software Foundation; either version 2 of the
// License, or (at your option) any later version.
//
// This program 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; see the file COPYING.  If not, write to
// the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
// Boston, MA 02111-1307, USA.

#ifndef CMDLINE_SHOW_H
#define CMDLINE_SHOW_H

// System includes:
#include <apt-pkg/pkgcache.h>

#include <boost/shared_ptr.hpp>

#include <iosfwd>
#include <string>

/** \file cmdline_show.h
 */

namespace cwidget
{
  class fragment;
  class fragment_contents;
}

namespace aptitude
{
  namespace cmdline
  {
    class terminal_metrics;
  }
}

/** \brief Render the description of a single version as found in a
 *  particular index file.
 *
 *  \param ver  The version to render.
 *  \param vf   The index file in which to find information about ver.
 *  \param verbose  How much information to render (scale of 0 to 2 inclusive).
 */
cwidget::fragment *version_file_fragment(const pkgCache::VerIterator &ver,
					 const pkgCache::VerFileIterator &vf,
					 int verbose);

/** Run the "show" operation on a single argument, presented as a string. */
bool do_cmdline_show(std::string s, int verbose,
                     const boost::shared_ptr<aptitude::cmdline::terminal_metrics> &term_metrics);

/** The "show" user command. */
int cmdline_show(int argc, char *argv[], int verbose);

std::ostream &operator<<(std::ostream &out, const cwidget::fragment_contents &contents);

#endif // CMDLINE_SHOW_H