source: trunk/lib/NodePrinter.h @ 1321

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

updating includes

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 2.7 KB
Line 
1#ifndef _theplu_svndigest_node_printer_
2#define _theplu_svndigest_node_printer_
3
4// $Id: NodePrinter.h 1321 2010-11-28 23:41:31Z peter $
5
6/*
7  Copyright (C) 2005, 2006, 2007, 2008 Jari Häkkinen, Peter Johansson
8  Copyright (C) 2009 Peter Johansson
9  Copyright (C) 2010 Jari Häkkinen, Peter Johansson
10
11  This file is part of svndigest, http://dev.thep.lu.se/svndigest
12
13  svndigest is free software; you can redistribute it and/or modify it
14  under the terms of the GNU General Public License as published by
15  the Free Software Foundation; either version 3 of the License, or
16  (at your option) any later version.
17
18  svndigest is distributed in the hope that it will be useful, but
19  WITHOUT ANY WARRANTY; without even the implied warranty of
20  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
21  General Public License for more details.
22
23  You should have received a copy of the GNU General Public License
24  along with svndigest. If not, see <http://www.gnu.org/licenses/>.
25*/
26
27#include "LineTypeParser.h"
28#include "StatsCollection.h"
29#include "SVNinfo.h"
30#include "SVNlog.h"
31#include "TinyStats.h"
32
33#include <map>
34#include <ostream>
35#include <stdexcept>
36#include <string>
37
38namespace theplu{
39namespace svndigest{
40
41  class Node;
42
43  ///
44  /// Base class for FilePrinter and DirectoryPrinter
45  ///
46  class NodePrinter
47  {
48  public:
49
50    ///
51    /// @brief Constructor
52    ///
53    NodePrinter(void);
54
55    ///
56    /// @brief Destructor
57    ///
58    virtual ~NodePrinter(void);
59
60    /**
61       Note that returned string always end with '/' with the
62       exception when an empty string is returned.
63
64       @return output dir for example 'lib/' for this file
65     */
66    std::string output_dir(void) const;
67
68    /**
69       @return output path for example 'lib/NodePrinter.h.html' for this file
70     */
71    virtual std::string output_path(void) const=0;
72
73    ///
74    /// Function printing HTML in current working directory
75    ///
76    void print(const bool verbose=false) const;
77
78    void print_author_summary(std::ostream&, 
79                              const Stats& stats, 
80                              const std::string& line_type, 
81                              const SVNlog&) const; 
82
83  protected:
84    ///
85    /// print path in html format (with anchors) to @a os
86    ///
87    void path_anchor(std::ostream& os) const; 
88
89  private:
90    ///
91    /// @brief Copy Constructor, not implemented
92    ///
93    NodePrinter(const NodePrinter&);
94
95    virtual const Node& node(void) const=0;
96
97    virtual void print_core(bool verbose=false) const=0;
98
99    ///
100    /// print page for specific user (or all) and specific line_style
101    /// (or total).
102    ///
103    virtual void print_core(const std::string& stats_type,
104                            const std::string& user, 
105                            const std::string& line_type,
106                            const SVNlog&) const=0; 
107
108  };
109
110
111
112
113}} // end of namespace svndigest and namespace theplu
114
115#endif
Note: See TracBrowser for help on using the repository browser.