source: trunk/lib/File.h @ 207

Last change on this file since 207 was 207, checked in by Peter Johansson, 16 years ago

refs #41 and #44. Splitted print function in File and Directory to 2 functions. One public and one private. The private print a page for a specific author (or all) and specific code (or total), and the public calls this private function. Also added total number of commits #refs 87. NOTE the change of file structure forced all local paths to be relative from target/projectname rather than target as before.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 2.2 KB
Line 
1#ifndef _theplu_svndigest_file_
2#define _theplu_svndigest_file_
3
4// $Id: File.h 207 2006-09-11 07:08:57Z peter $
5
6/*
7  Copyright (C) 2005, 2006 Jari Häkkinen, Peter Johansson
8
9  This file is part of svndigest, http://lev.thep.lu.se/trac/svndigest
10
11  svndigest is free software; you can redistribute it and/or modify it
12  under the terms of the GNU General Public License as published by
13  the Free Software Foundation; either version 2 of the License, or
14  (at your option) any later version.
15
16  svndigest is distributed in the hope that it will be useful, but
17  WITHOUT ANY WARRANTY; without even the implied warranty of
18  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19  General Public License for more details.
20
21  You should have received a copy of the GNU General Public License
22  along with this program; if not, write to the Free Software
23  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
24  02111-1307, USA.
25*/
26
27#include "Node.h"
28
29#include <string>
30
31namespace theplu{
32namespace svndigest{
33
34  class File : public Node
35  {
36  public:
37    ///
38    /// @brief Default Constructor
39    ///
40    File(const u_int level, const std::string& path, 
41         const std::string& output="") 
42      : Node(level,path,output) {}
43
44    ///
45    /// @return href to this file
46    ///
47    std::string href(void) const;
48
49    ///
50    /// @return file
51    ///
52    const std::string node_type(void) const;
53
54    ///
55    /// @brief Parsing out information from svn repository
56    ///
57    /// @return true if succesful
58    ///
59    const Stats& parse(const bool verbose=false);
60
61    ///
62    /// printing all pages related to this file
63    ///
64    void print(const bool verbose=false) const;
65
66    ///
67    /// print blame output
68    ///
69    void print_blame(std::ofstream&, const std::string line_type) const;
70
71    void print_copyright(const std::vector<std::string>&) const;
72
73  private:
74
75    ///
76    /// @brief Parsing svn blame output
77    ///
78    /// @return true if parsing is succesful
79    ///
80    bool blame(void) const;
81
82    ///
83    /// @brief Copy Constructor, not implemented
84    ///
85    File(const File&);
86
87    ///
88    /// print page for specific user (or all) and specific line_style
89    /// (or total).
90    ///
91    void print(const std::string& user, const std::string& line_type) const; 
92
93  };
94
95}} // end of namespace svndigest and namespace theplu
96
97#endif
98
99
Note: See TracBrowser for help on using the repository browser.