#include <string>
#include <sstream>
#include <iostream>
#include <fstream>
#include <iomanip>
#include <map>
#include <list>
◆ add_online_info_into_contributors_list()
void add_online_info_into_contributors_list |
( |
list< contributor > & |
contributors_list, |
|
|
const char * |
filename |
|
) |
| |
122 ifstream online_info;
123 online_info.open(
filename, ios::in);
124 while (!getline(online_info,
line).eof()) {
125 string hgname, realname, url, misc;
127 size_t last_bar =
line.find_last_of(
'|');
128 if (last_bar == string::npos)
continue;
129 if (last_bar <
line.length()) misc =
line.substr(last_bar + 1);
130 line.erase(last_bar);
132 last_bar =
line.find_last_of(
'|');
133 if (last_bar == string::npos)
continue;
134 if (last_bar <
line.length()) url =
line.substr(last_bar + 1);
135 line.erase(last_bar);
137 last_bar =
line.find_last_of(
'|');
138 if (last_bar == string::npos)
continue;
139 if (last_bar <
line.length()) realname =
line.substr(last_bar + 1);
140 line.erase(last_bar);
145 if (hgname.find(
"MercurialName") != string::npos)
continue;
147 list<contributor>::iterator it;
148 for (it = contributors_list.begin(); it != contributors_list.end() && it->name != hgname; ++it) {
151 if (it == contributors_list.end()) {
156 contributors_list.push_back(
c);
string filename
Definition: MergeRestartFiles.py:39
int c
Definition: calibrate.py:100
line
Definition: calibrate.py:103
Definition: eigen_gen_credits.cpp:108
References calibrate::c, MergeRestartFiles::filename, and calibrate::line.
Referenced by main().
◆ contributor_name()
std::string contributor_name |
( |
const std::string & |
line | ) |
|
18 if (
line.find(
"markb@localhost.localdomain") != string::npos) {
19 return "Mark Borgerding";
22 if (
line.find(
"kayhman@contact.intra.cea.fr") != string::npos) {
23 return "Guillaume Saupin";
32 size_t position_of_email_address =
line.find_first_of(
'<');
33 if (position_of_email_address != string::npos) {
37 if (
line.find(
"hauke.heibel") != string::npos)
38 result =
"Hauke Heibel";
41 result =
line.substr(0, position_of_email_address);
46 if (
line.find(
"convert-repo") != string::npos)
53 size_t length = result.length();
54 while (length >= 1 && result[length - 1] ==
' ') result.erase(--length);
References calibrate::line.
Referenced by contributors_map_from_churn_output().
◆ contributors_map_from_churn_output()
map<string, int> contributors_map_from_churn_output |
( |
const char * |
filename | ) |
|
61 map<string, int> contributors_map;
66 while (!getline(churn_out,
line).eof()) {
68 size_t first_star =
line.find_first_of(
'*');
69 if (first_star != string::npos)
line.erase(first_star);
72 size_t length =
line.length();
73 while (length >= 1 &&
line[length - 1] ==
' ')
line.erase(--length);
76 size_t last_space =
line.find_last_of(
' ');
80 istringstream(
line.substr(last_space + 1)) >> number;
83 line.erase(last_space);
86 map<string, int>::iterator it = contributors_map.find(
name);
88 if (it == contributors_map.end()) contributors_map.insert(pair<string, int>(
name, number));
95 return contributors_map;
std::string contributor_name(const std::string &line)
Definition: eigen_gen_credits.cpp:13
string name
Definition: plotDoE.py:33
References contributor_name(), MergeRestartFiles::filename, calibrate::line, and plotDoE::name.
Referenced by main().
◆ lastname()
string lastname |
( |
const string & |
name | ) |
|
◆ main()
171 list<contributor> contributors_list;
172 map<string, int>::iterator it;
173 for (it = contributors_map_for_changedlines.begin(); it != contributors_map_for_changedlines.end(); ++it) {
176 c.changedlines = it->second;
178 contributors_list.push_back(
c);
183 contributors_list.sort();
185 cout <<
"{| cellpadding=\"5\"\n";
187 cout <<
"! Lines changed\n";
190 list<contributor>::iterator itc;
192 for (itc = contributors_list.begin(); itc != contributors_list.end(); ++itc) {
193 if (itc->name.length() == 0)
continue;
197 cout <<
"|- style=\"background:#FFFFD0\"\n";
198 if (itc->url.length())
199 cout <<
"| [" << itc->url <<
" " << itc->name <<
"]\n";
201 cout <<
"| " << itc->name <<
"\n";
202 if (itc->changedlines)
203 cout <<
"| " << itc->changedlines <<
"\n";
205 cout <<
"| (no information)\n";
206 cout <<
"| " << itc->misc <<
"\n";
209 cout <<
"|}" << endl;
int i
Definition: BiCGSTAB_step_by_step.cpp:9
map< string, int > contributors_map_from_churn_output(const char *filename)
Definition: eigen_gen_credits.cpp:60
void add_online_info_into_contributors_list(list< contributor > &contributors_list, const char *filename)
Definition: eigen_gen_credits.cpp:120
References add_online_info_into_contributors_list(), calibrate::c, contributors_map_from_churn_output(), and i.