1358 |
31 May 11 |
peter |
1 |
#ifndef _theplu_svndigest_copyright_stats_ |
1358 |
31 May 11 |
peter |
2 |
#define _theplu_svndigest_copyright_stats_ |
1358 |
31 May 11 |
peter |
3 |
|
1358 |
31 May 11 |
peter |
// $Id$ |
1358 |
31 May 11 |
peter |
5 |
|
1358 |
31 May 11 |
peter |
6 |
/* |
1635 |
30 Mar 23 |
peter |
Copyright (C) 2011, 2012 Peter Johansson |
1358 |
31 May 11 |
peter |
8 |
|
1358 |
31 May 11 |
peter |
This file is part of svndigest, http://dev.thep.lu.se/svndigest |
1358 |
31 May 11 |
peter |
10 |
|
1358 |
31 May 11 |
peter |
svndigest is free software; you can redistribute it and/or modify it |
1358 |
31 May 11 |
peter |
under the terms of the GNU General Public License as published by |
1358 |
31 May 11 |
peter |
the Free Software Foundation; either version 3 of the License, or |
1358 |
31 May 11 |
peter |
(at your option) any later version. |
1358 |
31 May 11 |
peter |
15 |
|
1358 |
31 May 11 |
peter |
svndigest is distributed in the hope that it will be useful, but |
1358 |
31 May 11 |
peter |
WITHOUT ANY WARRANTY; without even the implied warranty of |
1358 |
31 May 11 |
peter |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
1358 |
31 May 11 |
peter |
General Public License for more details. |
1358 |
31 May 11 |
peter |
20 |
|
1358 |
31 May 11 |
peter |
You should have received a copy of the GNU General Public License |
1358 |
31 May 11 |
peter |
along with svndigest. If not, see <http://www.gnu.org/licenses/>. |
1358 |
31 May 11 |
peter |
23 |
*/ |
1358 |
31 May 11 |
peter |
24 |
|
1358 |
31 May 11 |
peter |
25 |
#include "Alias.h" |
1358 |
31 May 11 |
peter |
26 |
|
1451 |
22 Dec 11 |
peter |
27 |
#include "yat/SegmentSet.h" |
1451 |
22 Dec 11 |
peter |
28 |
|
1358 |
31 May 11 |
peter |
29 |
#include <subversion-1/svn_types.h> |
1358 |
31 May 11 |
peter |
30 |
|
1358 |
31 May 11 |
peter |
31 |
#include <map> |
1358 |
31 May 11 |
peter |
32 |
#include <set> |
1358 |
31 May 11 |
peter |
33 |
#include <string> |
1358 |
31 May 11 |
peter |
34 |
|
1451 |
22 Dec 11 |
peter |
35 |
namespace theplu { |
1451 |
22 Dec 11 |
peter |
36 |
namespace svndigest { |
1358 |
31 May 11 |
peter |
37 |
|
1358 |
31 May 11 |
peter |
38 |
/** |
1358 |
31 May 11 |
peter |
39 |
*/ |
1358 |
31 May 11 |
peter |
40 |
class CopyrightStats |
1358 |
31 May 11 |
peter |
41 |
{ |
1358 |
31 May 11 |
peter |
42 |
public: |
1358 |
31 May 11 |
peter |
43 |
/** |
1358 |
31 May 11 |
peter |
Constructor |
1358 |
31 May 11 |
peter |
45 |
*/ |
1358 |
31 May 11 |
peter |
46 |
CopyrightStats(const std::string& path, bool ignore_cache, |
1451 |
22 Dec 11 |
peter |
47 |
const std::map<int, svn_revnum_t>& year2rev, |
1451 |
22 Dec 11 |
peter |
48 |
const yat::utility::SegmentSet<svn_revnum_t>& ignore_revs); |
1358 |
31 May 11 |
peter |
49 |
|
1376 |
14 Jun 11 |
peter |
50 |
const std::map<int, std::set<std::string> >& map(void) const; |
1358 |
31 May 11 |
peter |
51 |
private: |
1358 |
31 May 11 |
peter |
52 |
/** |
1358 |
31 May 11 |
peter |
load data from cache file (if it exists), and then parse from |
1358 |
31 May 11 |
peter |
blame remaining data required to build data. |
1358 |
31 May 11 |
peter |
55 |
*/ |
1358 |
31 May 11 |
peter |
56 |
void init(bool ignore_cache, const std::map<int, svn_revnum_t>& year2rev); |
1358 |
31 May 11 |
peter |
57 |
|
1358 |
31 May 11 |
peter |
/// return 0 if load failed; otherwise return rev cache represents |
1376 |
14 Jun 11 |
peter |
59 |
svn_revnum_t load_cache(void); |
1358 |
31 May 11 |
peter |
60 |
|
1358 |
31 May 11 |
peter |
61 |
void parse(svn_revnum_t rev, const std::map<int, svn_revnum_t>& year2rev); |
1551 |
03 Nov 12 |
peter |
62 |
void remove_copyright_lines(const std::string& src, |
1551 |
03 Nov 12 |
peter |
63 |
std::string& result) const; |
1358 |
31 May 11 |
peter |
64 |
void reset(void); |
1551 |
03 Nov 12 |
peter |
65 |
|
1551 |
03 Nov 12 |
peter |
66 |
/** |
1551 |
03 Nov 12 |
peter |
sub is subsequence of seq if sub can be created from seq by |
1551 |
03 Nov 12 |
peter |
removing element in seq. |
1551 |
03 Nov 12 |
peter |
69 |
|
1551 |
03 Nov 12 |
peter |
\return true if \a sub is subsequence of \a seq |
1551 |
03 Nov 12 |
peter |
71 |
*/ |
1551 |
03 Nov 12 |
peter |
72 |
bool subseq(const std::string& sub, const std::string& seq) const; |
1551 |
03 Nov 12 |
peter |
73 |
|
1376 |
14 Jun 11 |
peter |
74 |
void write_cache(void); |
1358 |
31 May 11 |
peter |
75 |
|
1376 |
14 Jun 11 |
peter |
76 |
std::string cache_file_; |
1376 |
14 Jun 11 |
peter |
77 |
std::string config_; |
1453 |
23 Dec 11 |
peter |
78 |
const yat::utility::SegmentSet<svn_revnum_t>& ignore_revs_; |
1358 |
31 May 11 |
peter |
79 |
std::string path_; |
1376 |
14 Jun 11 |
peter |
80 |
std::map<int, std::set<std::string> > year2user_; |
1358 |
31 May 11 |
peter |
81 |
}; |
1358 |
31 May 11 |
peter |
82 |
}} // end of namespace svndigest and namespace theplu |
1358 |
31 May 11 |
peter |
83 |
|
1358 |
31 May 11 |
peter |
84 |
#endif |