source: trunk/lib/ClassicStats.cc @ 531

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

moving more stuff to base class and add class for Blame Statistics

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 1.8 KB
RevLine 
[84]1// $Id: ClassicStats.cc 531 2007-12-25 18:51:07Z peter $
[14]2
[84]3/*
4  Copyright (C) 2005 Peter Johansson
[381]5  Copyright (C) 2006, 2007 Jari Häkkinen, Peter Johansson
[84]6
[519]7  This file is part of svndigest, http://trac.thep.lu.se/svndigest
[84]8
[149]9  svndigest is free software; you can redistribute it and/or modify it
[84]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
[149]14  svndigest is distributed in the hope that it will be useful, but
[84]15  WITHOUT ANY WARRANTY; without even the implied warranty of
[149]16  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
[84]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
[487]25#include "ClassicStats.h"
[129]26
[465]27#include "Functor.h"
[73]28#include "GnuplotFE.h"
[138]29#include "SVNblame.h"
[129]30#include "SVNinfo.h"
[14]31#include "utility.h"
32
[41]33#include <algorithm>
[65]34#include <cassert>
[63]35#include <cstdlib>
[454]36#include <fstream>
[60]37#include <iostream>
[454]38#include <iterator>
[14]39#include <map>
40#include <numeric>
41#include <string>
[138]42#include <sstream>
[44]43#include <unistd.h>
[23]44#include <utility>
[14]45#include <vector>
46
[63]47
[14]48namespace theplu{
[149]49namespace svndigest{
[14]50
51
[487]52  ClassicStats::ClassicStats(const std::string& path)
53    : Stats(path)
[80]54  {
55  }
56
[529]57
[528]58  ClassicStats::ClassicStats(const ClassicStats& other)
59  : Stats(other)
60  {
61  }
[80]62
[14]63
[487]64  void ClassicStats::do_parse(const std::string& path)
[60]65  {
[118]66    Parser parser(path);
67    std::vector<Parser::line_type>::const_iterator count=parser.type().begin();
68
[185]69    SVNblame svn_blame(path);
[381]70    while (svn_blame.valid()) {
71      add(svn_blame.author(), svn_blame.revision(), *count);
72      svn_blame.next_line();
[361]73      ++count;
[138]74    }
[60]75  }
76
77
[149]78}} // end of namespace svndigest and namespace theplu
Note: See TracBrowser for help on using the repository browser.