165 |
24 Aug 06 |
jari |
1 |
#ifndef _theplu_svndigest_directory_ |
165 |
24 Aug 06 |
jari |
2 |
#define _theplu_svndigest_directory_ |
165 |
24 Aug 06 |
jari |
3 |
|
7 |
30 Dec 05 |
jari |
// $Id$ |
7 |
30 Dec 05 |
jari |
5 |
|
84 |
13 Mar 06 |
jari |
6 |
/* |
978 |
12 Dec 09 |
peter |
Copyright (C) 2005, 2006, 2007, 2008 Jari Häkkinen, Peter Johansson |
1515 |
26 Sep 12 |
peter |
Copyright (C) 2009, 2010, 2012 Peter Johansson |
84 |
13 Mar 06 |
jari |
9 |
|
687 |
04 Aug 08 |
peter |
This file is part of svndigest, http://dev.thep.lu.se/svndigest |
84 |
13 Mar 06 |
jari |
11 |
|
149 |
12 Aug 06 |
jari |
svndigest is free software; you can redistribute it and/or modify it |
84 |
13 Mar 06 |
jari |
under the terms of the GNU General Public License as published by |
693 |
11 Sep 08 |
jari |
the Free Software Foundation; either version 3 of the License, or |
84 |
13 Mar 06 |
jari |
(at your option) any later version. |
84 |
13 Mar 06 |
jari |
16 |
|
149 |
12 Aug 06 |
jari |
svndigest is distributed in the hope that it will be useful, but |
84 |
13 Mar 06 |
jari |
WITHOUT ANY WARRANTY; without even the implied warranty of |
149 |
12 Aug 06 |
jari |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
84 |
13 Mar 06 |
jari |
General Public License for more details. |
84 |
13 Mar 06 |
jari |
21 |
|
84 |
13 Mar 06 |
jari |
You should have received a copy of the GNU General Public License |
693 |
11 Sep 08 |
jari |
along with svndigest. If not, see <http://www.gnu.org/licenses/>. |
84 |
13 Mar 06 |
jari |
24 |
*/ |
84 |
13 Mar 06 |
jari |
25 |
|
4 |
29 Dec 05 |
peter |
26 |
#include "Node.h" |
4 |
29 Dec 05 |
peter |
27 |
|
226 |
11 Mar 07 |
peter |
28 |
#include <map> |
18 |
30 Dec 05 |
jari |
29 |
#include <string> |
661 |
12 Jun 08 |
peter |
30 |
#include <vector> |
4 |
29 Dec 05 |
peter |
31 |
|
4 |
29 Dec 05 |
peter |
32 |
namespace theplu{ |
149 |
12 Aug 06 |
jari |
33 |
namespace svndigest{ |
4 |
29 Dec 05 |
peter |
34 |
|
1234 |
23 Oct 10 |
peter |
35 |
class NodeVisitor; |
1234 |
23 Oct 10 |
peter |
36 |
|
9 |
30 Dec 05 |
jari |
37 |
/// |
9 |
30 Dec 05 |
jari |
/// Class taking care of directories. |
9 |
30 Dec 05 |
jari |
39 |
/// |
9 |
30 Dec 05 |
jari |
40 |
class Directory : public Node |
9 |
30 Dec 05 |
jari |
41 |
{ |
9 |
30 Dec 05 |
jari |
42 |
public: |
9 |
30 Dec 05 |
jari |
43 |
/// |
9 |
30 Dec 05 |
jari |
/// @brief Constructor |
9 |
30 Dec 05 |
jari |
45 |
/// |
22 |
02 Jan 06 |
jari |
/// Recursively create a directory tree starting from \a path. All |
22 |
02 Jan 06 |
jari |
/// entries except explicit directories are treated as File nodes, |
22 |
02 Jan 06 |
jari |
/// i.e. symbolic links to directories are treated as File |
22 |
02 Jan 06 |
jari |
/// nodes. This will ensure that the directory structure is a tree |
22 |
02 Jan 06 |
jari |
/// and double counting of branches is avoided. |
22 |
02 Jan 06 |
jari |
51 |
/// |
22 |
02 Jan 06 |
jari |
/// @note Nodes named '.', '..', and '.svn' are ignored and not |
18 |
30 Dec 05 |
jari |
/// traversed. |
18 |
30 Dec 05 |
jari |
54 |
/// |
1513 |
23 Sep 12 |
peter |
55 |
Directory(const unsigned int level, const std::string& path, |
1264 |
02 Nov 10 |
peter |
56 |
const std::string& output="", const std::string& project=""); |
4 |
29 Dec 05 |
peter |
57 |
|
9 |
30 Dec 05 |
jari |
58 |
/// |
9 |
30 Dec 05 |
jari |
/// @brief Destructor |
9 |
30 Dec 05 |
jari |
60 |
/// |
10 |
30 Dec 05 |
jari |
61 |
~Directory(void); |
4 |
29 Dec 05 |
peter |
62 |
|
1234 |
23 Oct 10 |
peter |
63 |
/** |
1234 |
23 Oct 10 |
peter |
Collect stats from daughter nodes and reset stats in daughter |
1234 |
23 Oct 10 |
peter |
nodes. |
1234 |
23 Oct 10 |
peter |
66 |
*/ |
1234 |
23 Oct 10 |
peter |
67 |
void collect_stats(void); |
1234 |
23 Oct 10 |
peter |
68 |
|
100 |
19 Jun 06 |
peter |
69 |
/// |
101 |
22 Jun 06 |
peter |
/// @return true |
101 |
22 Jun 06 |
peter |
71 |
/// |
101 |
22 Jun 06 |
peter |
72 |
bool dir(void) const; |
101 |
22 Jun 06 |
peter |
73 |
|
101 |
22 Jun 06 |
peter |
74 |
/// |
175 |
02 Sep 06 |
peter |
/// @return directory-name/index.html |
100 |
19 Jun 06 |
peter |
76 |
/// |
175 |
02 Sep 06 |
peter |
77 |
std::string href(void) const; |
112 |
29 Jun 06 |
peter |
78 |
|
380 |
21 Jun 07 |
jari |
79 |
/** |
834 |
07 Nov 09 |
peter |
\brief Get the revision number of the latest commit. |
834 |
07 Nov 09 |
peter |
81 |
|
834 |
07 Nov 09 |
peter |
Does not only check this directory but also daughter nodes. |
834 |
07 Nov 09 |
peter |
83 |
*/ |
834 |
07 Nov 09 |
peter |
84 |
svn_revnum_t last_changed_rev(void) const; |
834 |
07 Nov 09 |
peter |
85 |
|
834 |
07 Nov 09 |
peter |
86 |
/** |
380 |
21 Jun 07 |
jari |
@return The explicit string "directory", nothing else. |
380 |
21 Jun 07 |
jari |
88 |
*/ |
343 |
19 May 07 |
peter |
89 |
std::string node_type(void) const; |
182 |
03 Sep 06 |
peter |
90 |
|
343 |
19 May 07 |
peter |
91 |
/** |
343 |
19 May 07 |
peter |
@return output path for example 'lib/File.h.html' for this file |
343 |
19 May 07 |
peter |
93 |
*/ |
343 |
19 May 07 |
peter |
94 |
std::string output_path(void) const; |
343 |
19 May 07 |
peter |
95 |
|
653 |
08 Jun 08 |
peter |
96 |
/** |
1538 |
07 Oct 12 |
peter |
\return min of revision of this Directory and its sub-nodes |
1538 |
07 Oct 12 |
peter |
98 |
*/ |
1538 |
07 Oct 12 |
peter |
99 |
svn_revnum_t revision_min(void) const; |
1538 |
07 Oct 12 |
peter |
100 |
|
1538 |
07 Oct 12 |
peter |
101 |
/** |
1234 |
23 Oct 10 |
peter |
Calls visitor.enter(*this). If enter returns true, daughter |
1234 |
23 Oct 10 |
peter |
nodes are traverses. Finally visitor visitor.leave(*this) i called. |
1234 |
23 Oct 10 |
peter |
104 |
*/ |
1234 |
23 Oct 10 |
peter |
105 |
void traverse(NodeVisitor& visitor); |
1234 |
23 Oct 10 |
peter |
106 |
|
9 |
30 Dec 05 |
jari |
107 |
private: |
452 |
17 Aug 07 |
peter |
108 |
/** |
757 |
27 Jan 09 |
peter |
add union of logs from daughter nodes. |
452 |
17 Aug 07 |
peter |
110 |
*/ |
757 |
27 Jan 09 |
peter |
111 |
void log_core(SVNlog&) const; |
452 |
17 Aug 07 |
peter |
112 |
|
9 |
30 Dec 05 |
jari |
113 |
/// |
9 |
30 Dec 05 |
jari |
/// @brief Copy Constructor, not implemented |
9 |
30 Dec 05 |
jari |
115 |
/// |
9 |
30 Dec 05 |
jari |
116 |
Directory(const Directory&); |
9 |
30 Dec 05 |
jari |
117 |
|
658 |
10 Jun 08 |
peter |
118 |
typedef std::vector<Node*> NodeContainer; |
91 |
23 Mar 06 |
jari |
119 |
typedef NodeContainer::iterator NodeIterator; |
91 |
23 Mar 06 |
jari |
120 |
typedef NodeContainer::const_iterator NodeConstIterator; |
91 |
23 Mar 06 |
jari |
121 |
NodeContainer daughters_; |
1290 |
12 Nov 10 |
peter |
122 |
|
1290 |
12 Nov 10 |
peter |
123 |
friend class DirectoryPrinter; |
9 |
30 Dec 05 |
jari |
124 |
}; |
9 |
30 Dec 05 |
jari |
125 |
|
149 |
12 Aug 06 |
jari |
126 |
}} // end of namespace svndigest and namespace theplu |
7 |
30 Dec 05 |
jari |
127 |
|
7 |
30 Dec 05 |
jari |
128 |
#endif |