source: trunk/lib/ClassicStats.cc @ 552

Last change on this file since 552 was 552, checked in by Peter Johansson, 14 years ago

fixes linetype Copyright

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 1.7 KB
Line 
1// $Id: ClassicStats.cc 552 2008-01-08 14:40:37Z peter $
2
3/*
4  Copyright (C) 2005 Peter Johansson
5  Copyright (C) 2006, 2007 Jari Häkkinen, Peter Johansson
6
7  This file is part of svndigest, http://trac.thep.lu.se/svndigest
8
9  svndigest is free software; you can redistribute it and/or modify it
10  under the terms of the GNU General Public License as published by
11  the Free Software Foundation; either version 2 of the License, or
12  (at your option) any later version.
13
14  svndigest is distributed in the hope that it will be useful, but
15  WITHOUT ANY WARRANTY; without even the implied warranty of
16  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17  General Public License for more details.
18
19  You should have received a copy of the GNU General Public License
20  along with this program; if not, write to the Free Software
21  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
22  02111-1307, USA.
23*/
24
25#include "ClassicStats.h"
26
27#include "Functor.h"
28#include "GnuplotFE.h"
29#include "SVNblame.h"
30#include "SVNinfo.h"
31#include "utility.h"
32
33#include <algorithm>
34#include <cassert>
35#include <cstdlib>
36#include <fstream>
37#include <iostream>
38#include <iterator>
39#include <map>
40#include <numeric>
41#include <string>
42#include <sstream>
43#include <unistd.h>
44#include <utility>
45#include <vector>
46
47
48namespace theplu{
49namespace svndigest{
50
51
52  ClassicStats::ClassicStats(const std::string& path)
53    : Stats(path)
54  {
55  }
56
57
58  ClassicStats::ClassicStats(const ClassicStats& other)
59  : Stats(other)
60  {
61  }
62
63
64  void ClassicStats::do_parse(const std::string& path)
65  {
66    LineTypeParser parser(path);
67    SVNblame svn_blame(path);
68    while (svn_blame.valid()) {
69      add(svn_blame.author(), svn_blame.revision(), 
70          parser.parse(svn_blame.line()));
71      svn_blame.next_line();
72    }
73    accumulate_stats();
74
75  }
76
77
78}} // end of namespace svndigest and namespace theplu
Note: See TracBrowser for help on using the repository browser.