source: trunk/lib/NodeCounter.cc @ 1449

Last change on this file since 1449 was 1449, checked in by Peter Johansson, 10 years ago

refs #387. svncopyright no longer listens to property
svndigest:ignore. New revision (71) in test repo where
svncopyright:ignore was added to dir_to_be ignored.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 1.4 KB
Line 
1// $Id: NodeCounter.cc 1449 2011-12-22 02:11:55Z peter $
2
3/*
4  Copyright (C) 2010 Peter Johansson
5
6  This file is part of svndigest, http://dev.thep.lu.se/svndigest
7
8  svndigest 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 3 of the License, or
11  (at your option) any later version.
12
13  svndigest 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 svndigest. If not, see <http://www.gnu.org/licenses/>.
20*/
21
22#include "NodeCounter.h"
23
24#include "Directory.h"
25#include "File.h"
26#include "NodeVisitor.h"
27
28namespace theplu {
29namespace svndigest {
30
31  NodeCounter::NodeCounter(void)
32    : NodeVisitor(), directories_(0), files_(0) {}
33
34
35  unsigned int NodeCounter::directories(void) const
36  {
37    return directories_;
38  }
39
40
41  bool NodeCounter::enter(Directory& dir) 
42  {
43    if (dir.svndigest_ignore())
44      return false;
45    ++directories_;
46    return true;
47  }
48 
49
50  unsigned int NodeCounter::files(void) const
51  {
52    return files_;
53  }
54
55
56  void NodeCounter::leave(Directory& dir) 
57  {
58  }
59 
60
61  void NodeCounter::visit(File& file)
62  {
63    if (!file.svndigest_ignore())
64      ++files_;
65  }
66
67}} // end of namespace svndigest and namespace theplu
68
Note: See TracBrowser for help on using the repository browser.