1254 |
31 Oct 10 |
peter |
// $Id$ |
1254 |
31 Oct 10 |
peter |
2 |
|
1254 |
31 Oct 10 |
peter |
3 |
/* |
1635 |
30 Mar 23 |
peter |
Copyright (C) 2010, 2011, 2023 Peter Johansson |
1254 |
31 Oct 10 |
peter |
5 |
|
1254 |
31 Oct 10 |
peter |
This file is part of svndigest, http://dev.thep.lu.se/svndigest |
1254 |
31 Oct 10 |
peter |
7 |
|
1254 |
31 Oct 10 |
peter |
svndigest is free software; you can redistribute it and/or modify it |
1254 |
31 Oct 10 |
peter |
under the terms of the GNU General Public License as published by |
1254 |
31 Oct 10 |
peter |
the Free Software Foundation; either version 3 of the License, or |
1254 |
31 Oct 10 |
peter |
(at your option) any later version. |
1254 |
31 Oct 10 |
peter |
12 |
|
1254 |
31 Oct 10 |
peter |
svndigest is distributed in the hope that it will be useful, but |
1254 |
31 Oct 10 |
peter |
WITHOUT ANY WARRANTY; without even the implied warranty of |
1254 |
31 Oct 10 |
peter |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
1254 |
31 Oct 10 |
peter |
General Public License for more details. |
1254 |
31 Oct 10 |
peter |
17 |
|
1254 |
31 Oct 10 |
peter |
You should have received a copy of the GNU General Public License |
1254 |
31 Oct 10 |
peter |
along with svndigest. If not, see <http://www.gnu.org/licenses/>. |
1254 |
31 Oct 10 |
peter |
20 |
*/ |
1254 |
31 Oct 10 |
peter |
21 |
|
1619 |
12 Mar 23 |
peter |
22 |
#include <config.h> |
1619 |
12 Mar 23 |
peter |
23 |
|
1254 |
31 Oct 10 |
peter |
24 |
#include "NodeCounter.h" |
1254 |
31 Oct 10 |
peter |
25 |
|
1254 |
31 Oct 10 |
peter |
26 |
#include "Directory.h" |
1254 |
31 Oct 10 |
peter |
27 |
#include "File.h" |
1254 |
31 Oct 10 |
peter |
28 |
#include "NodeVisitor.h" |
1254 |
31 Oct 10 |
peter |
29 |
|
1254 |
31 Oct 10 |
peter |
30 |
namespace theplu { |
1254 |
31 Oct 10 |
peter |
31 |
namespace svndigest { |
1254 |
31 Oct 10 |
peter |
32 |
|
1254 |
31 Oct 10 |
peter |
33 |
NodeCounter::NodeCounter(void) |
1254 |
31 Oct 10 |
peter |
34 |
: NodeVisitor(), directories_(0), files_(0) {} |
1254 |
31 Oct 10 |
peter |
35 |
|
1254 |
31 Oct 10 |
peter |
36 |
|
1254 |
31 Oct 10 |
peter |
37 |
unsigned int NodeCounter::directories(void) const |
1254 |
31 Oct 10 |
peter |
38 |
{ |
1254 |
31 Oct 10 |
peter |
39 |
return directories_; |
1254 |
31 Oct 10 |
peter |
40 |
} |
1254 |
31 Oct 10 |
peter |
41 |
|
1254 |
31 Oct 10 |
peter |
42 |
|
1513 |
23 Sep 12 |
peter |
43 |
bool NodeCounter::enter(Directory& dir) |
1254 |
31 Oct 10 |
peter |
44 |
{ |
1449 |
22 Dec 11 |
peter |
45 |
if (dir.svndigest_ignore()) |
1254 |
31 Oct 10 |
peter |
46 |
return false; |
1254 |
31 Oct 10 |
peter |
47 |
++directories_; |
1254 |
31 Oct 10 |
peter |
48 |
return true; |
1254 |
31 Oct 10 |
peter |
49 |
} |
1254 |
31 Oct 10 |
peter |
50 |
|
1513 |
23 Sep 12 |
peter |
51 |
|
1254 |
31 Oct 10 |
peter |
52 |
unsigned int NodeCounter::files(void) const |
1254 |
31 Oct 10 |
peter |
53 |
{ |
1254 |
31 Oct 10 |
peter |
54 |
return files_; |
1254 |
31 Oct 10 |
peter |
55 |
} |
1254 |
31 Oct 10 |
peter |
56 |
|
1254 |
31 Oct 10 |
peter |
57 |
|
1513 |
23 Sep 12 |
peter |
58 |
void NodeCounter::leave(Directory& dir) |
1254 |
31 Oct 10 |
peter |
59 |
{ |
1254 |
31 Oct 10 |
peter |
60 |
} |
1254 |
31 Oct 10 |
peter |
61 |
|
1513 |
23 Sep 12 |
peter |
62 |
|
1254 |
31 Oct 10 |
peter |
63 |
void NodeCounter::visit(File& file) |
1254 |
31 Oct 10 |
peter |
64 |
{ |
1449 |
22 Dec 11 |
peter |
65 |
if (!file.svndigest_ignore()) |
1254 |
31 Oct 10 |
peter |
66 |
++files_; |
1254 |
31 Oct 10 |
peter |
67 |
} |
1254 |
31 Oct 10 |
peter |
68 |
|
1254 |
31 Oct 10 |
peter |
69 |
}} // end of namespace svndigest and namespace theplu |