source: trunk/lib/FilePrinter.h @ 1290

Last change on this file since 1290 was 1290, checked in by Peter Johansson, 11 years ago

closes #457. Lifting out plotting functions in Stats into a new class
StatsPlotter?. In same manner lifting out print functions from
Node/Directory/File? into a new hierarchy
NodePrinter/DirectoryPrinter/FilePrinter?. To accomplish these splits
without to much recoding some friendships are introduced. These new
classes are only needed for svndigest (not svncopyright) and are
therefore placed in a library named libsvndigest together with Graph
class and first_page functions. Remaining functionality, shared
between svncopyright and svndigest, are located in libsvndigest_core
and linked into both binaries.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 2.0 KB
Line 
1#ifndef _theplu_svndigest_file_printer_
2#define _theplu_svndigest_file_printer_
3
4// $Id: FilePrinter.h 1290 2010-11-12 04:01:35Z peter $
5
6/*
7  Copyright (C) 2005, 2006, 2007, 2008 Jari Häkkinen, Peter Johansson
8  Copyright (C) 2009, 2010 Peter Johansson
9
10  This file is part of svndigest, http://dev.thep.lu.se/svndigest
11
12  svndigest is free software; you can redistribute it and/or modify it
13  under the terms of the GNU General Public License as published by
14  the Free Software Foundation; either version 3 of the License, or
15  (at your option) any later version.
16
17  svndigest is distributed in the hope that it will be useful, but
18  WITHOUT ANY WARRANTY; without even the implied warranty of
19  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20  General Public License for more details.
21
22  You should have received a copy of the GNU General Public License
23  along with svndigest. If not, see <http://www.gnu.org/licenses/>.
24*/
25
26#include "NodePrinter.h"
27
28#include <string>
29
30namespace theplu{
31namespace svndigest{
32
33  class File;
34
35  class FilePrinter : public NodePrinter
36  {
37  public:
38    ///
39    /// @brief Default Constructor
40    ///
41    explicit FilePrinter(const File& file);
42
43    /**
44       @return output path for example 'lib/FilePrinter.h.html' for this file
45     */
46    std::string output_path(void) const;
47
48  private:
49    std::string blame_output_file_name(void) const;
50
51    /**
52       do nothing
53    */
54    void log_core(SVNlog&) const;
55
56    ///
57    /// @brief Copy Constructor, not implemented
58    ///
59    FilePrinter(const FilePrinter&);
60
61    ///
62    /// @brief Parsing svn blame output
63    ///
64    /// @return true if parsing is succesful
65    ///
66    bool blame(void) const;
67
68    /**
69       @brief Print blame output
70    */
71    void print_blame(std::ofstream& os) const;
72
73    void print_core(bool verbose=false) const;
74
75    ///
76    /// print page for specific user (or all) and specific line_style
77    /// (or total).
78    ///
79    void print_core(const std::string& stats_type, const std::string& user, 
80                    const std::string& line_type, const SVNlog&) const; 
81
82    const Node& node(void) const;
83
84    const File& file_;
85
86  };
87
88}} // end of namespace svndigest and namespace theplu
89
90#endif
91
92
Note: See TracBrowser for help on using the repository browser.