source: trunk/lib/File.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: 1.9 KB
Line 
1#ifndef _theplu_svndigest_file_
2#define _theplu_svndigest_file_
3
4// $Id: File.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 "Node.h"
27
28#include <string>
29
30namespace theplu{
31namespace svndigest{
32
33  class NodeVisitor;
34
35  class File : public Node
36  {
37  public:
38    ///
39    /// @brief Default Constructor
40    ///
41    File(const unsigned int level, const std::string& path, 
42         const std::string& output=""); 
43
44    /**
45       For example 'File.h.html'
46
47       @return href to this file
48    */
49    std::string href(void) const;
50
51    /**
52       \brief Get the revision number of the latest commit.
53    */
54    svn_revnum_t last_changed_rev(void) const;
55
56    /**
57       @return The explicit string "file", nothing else.
58    */
59    std::string node_type(void) const;
60
61    ///
62    /// @brief Parsing out information from svn repository
63    ///
64    /// @return Stats object of the file
65    ///
66    const StatsCollection& parse(bool verbose, bool ignore);
67
68    /**
69       Let the visitor perform its mission via visitor(*this)
70     */
71    void traverse(NodeVisitor& visitor);
72
73  private:
74    /**
75       do nothing
76    */
77    void log_core(SVNlog&) const;
78
79    ///
80    /// @brief Copy Constructor, not implemented
81    ///
82    File(const File&);
83
84  };
85
86}} // end of namespace svndigest and namespace theplu
87
88#endif
89
90
Note: See TracBrowser for help on using the repository browser.