1 | // $Id: File.h 112 2006-06-29 09:30:54Z peter $ |
---|
2 | |
---|
3 | /* |
---|
4 | Copyright (C) 2005, 2006 Jari Häkkinen, Peter Johansson |
---|
5 | |
---|
6 | This file is part of svnstat, http://lev.thep.lu.se/trac/svnstat |
---|
7 | |
---|
8 | svnstat is free software; you can redistribute it and/or modify it |
---|
9 | under the terms of the GNU General Public License as published by |
---|
10 | the Free Software Foundation; either version 2 of the License, or |
---|
11 | (at your option) any later version. |
---|
12 | |
---|
13 | svnstat is distributed in the hope that it will be useful, but |
---|
14 | WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
---|
16 | General Public License for more details. |
---|
17 | |
---|
18 | You should have received a copy of the GNU General Public License |
---|
19 | along with this program; if not, write to the Free Software |
---|
20 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA |
---|
21 | 02111-1307, USA. |
---|
22 | */ |
---|
23 | |
---|
24 | #ifndef _theplu_svnstat_file_ |
---|
25 | #define _theplu_svnstat_file_ |
---|
26 | |
---|
27 | #include "Node.h" |
---|
28 | |
---|
29 | #include <string> |
---|
30 | |
---|
31 | namespace theplu{ |
---|
32 | namespace svnstat{ |
---|
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), binary_(false), ignore_(false) {} |
---|
43 | |
---|
44 | /// |
---|
45 | /// |
---|
46 | /// |
---|
47 | std::string author(void) const { return author_; } |
---|
48 | |
---|
49 | /// |
---|
50 | /// @return A properly formatted html link to this node. |
---|
51 | /// |
---|
52 | std::string html_link(void) const; |
---|
53 | |
---|
54 | /// |
---|
55 | /// |
---|
56 | /// |
---|
57 | u_int last_changed_rev(void) const { return revision_; } |
---|
58 | |
---|
59 | /// |
---|
60 | /// Parsing out information from svn repository |
---|
61 | /// |
---|
62 | /// @return true if succesful |
---|
63 | /// |
---|
64 | const Stats& parse(const bool verbose=false); |
---|
65 | |
---|
66 | /// |
---|
67 | /// |
---|
68 | /// |
---|
69 | void print(const bool verbose=false) const; |
---|
70 | |
---|
71 | private: |
---|
72 | /// |
---|
73 | /// @brief Parsing svn blame output |
---|
74 | /// |
---|
75 | /// @return true if parsing is succesful |
---|
76 | /// |
---|
77 | bool blame(void) const; |
---|
78 | |
---|
79 | /// |
---|
80 | /// @brief Copy Constructor, not implemented |
---|
81 | /// |
---|
82 | File(const File&); |
---|
83 | |
---|
84 | std::string author_; |
---|
85 | bool binary_; |
---|
86 | bool ignore_; |
---|
87 | u_int revision_; |
---|
88 | |
---|
89 | }; |
---|
90 | |
---|
91 | }} // end of namespace svnstat and namespace theplu |
---|
92 | |
---|
93 | #endif |
---|
94 | |
---|
95 | |
---|