- Timestamp:
- Jan 16, 2008, 2:35:00 PM (16 years ago)
- Location:
- trunk/lib
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/lib/Configuration.cc
r523 r556 263 263 Configuration& Configuration::instance(void) 264 264 { 265 if (!instance_) 265 if (!instance_){ 266 266 instance_ = new Configuration; 267 instance_->load(); 268 } 267 269 return *instance_; 268 270 } … … 412 414 translate(word, *iter); 413 415 } 414 415 416 } 416 417 -
trunk/lib/Configuration.h
r523 r556 58 58 59 59 /// 60 /// @brief load deafult configuration61 ///62 void load(void);63 64 ///65 60 /// throw if stream is not a valid config 66 61 /// … … 91 86 // assignment not implemented because assignment is always self-assignment 92 87 Configuration& operator=(const Configuration&); 88 // destructor not implemented 89 ~Configuration(void); 93 90 94 91 friend std::ostream& operator<<(std::ostream&, const Configuration&); … … 100 97 bool equal_false(const std::string&) const; 101 98 bool equal_true(const std::string&) const; 99 /// 100 /// @brief load deafult configuration 101 /// 102 void load(void); 103 102 104 void set_default(void); 103 105 /** -
trunk/lib/LineTypeParser.cc
r552 r556 52 52 // check if line is end of copyright statement, i.e. contains 53 53 // no alphanumerical character (except in copyright_prefix). 54 post_copyright_ = true; 54 55 for (size_t i=0; i<line.size()&&post_copyright_; ++i) 55 56 if (isalnum(line[i]) && -
trunk/lib/Stats.cc
r552 r556 88 88 std::vector<u_int>& other = other_stats()[*iter]; 89 89 accumulate(other); 90 std::vector<u_int>& copyright = copyright_stats()[*iter]; 91 accumulate(copyright); 90 92 } 91 93 } … … 98 100 add_author(user); 99 101 100 // Peterremove repeat102 // FIXME: Peter, remove repeat 101 103 std::vector<u_int>& code = code_stats()[user]; 102 104 if (code.size() < rev+1){ … … 134 136 else if (lt == LineTypeParser::other) 135 137 other[rev]+=n; 138 139 std::vector<u_int>& copy = copyright_stats()[user]; 140 if (copy.size() < rev+1){ 141 copy.reserve(revision() + 1); 142 copy.insert(copy.end(), rev - copy.size(), 0); 143 if (lt == LineTypeParser::copyright) 144 copy.push_back(n); 145 else 146 copy.push_back(0); 147 } 148 else if (lt == LineTypeParser::copyright) 149 copy[rev]+=n; 136 150 } 137 151 -
trunk/lib/first_page.cc
r546 r556 51 51 52 52 void print_main_page(const std::string& dir, const SVNlog& log, 53 const Stats & stats, std::string url)53 const StatsCollection& stats, std::string url) 54 54 { 55 55 std::string filename="index.html"; … … 69 69 latest_commit.push_back(log.latest_commit(*i)); 70 70 71 print_summary_plot(os, stats );71 print_summary_plot(os, stats["classic"]); 72 72 print_general_information(os, log, authors.size(), url); 73 73 sort(latest_commit.begin(), latest_commit.end(), GreaterRevision()); 74 print_authors(os, latest_commit, stats );75 print_recent_logs(os, log );74 print_authors(os, latest_commit, stats["classic"]); 75 print_recent_logs(os, log, stats); 76 76 os << "<hr width=100% />"; 77 77 print_footer(os); … … 130 130 <<"</tr>"; 131 131 132 std::string timefmt("% b %d %H:%M:%S %Y");132 std::string timefmt("%Y %b %d %H:%M:%S"); 133 133 using namespace std; 134 134 for (vector<Commitment>::const_iterator i=lc.begin(); i!=lc.end(); ++i) { … … 158 158 159 159 160 void print_recent_logs(std::ostream& os, const SVNlog& log) 160 void print_recent_logs(std::ostream& os, const SVNlog& log, 161 const StatsCollection& stats) 161 162 { 162 163 os << "<div class=\"main\">\n" … … 172 173 assert(log.author().size()==log.message().size()); 173 174 assert(log.author().size()==log.revision().size()); 174 os << "<tr><td>Author</td><td>Date</td><td>Rev</td><td>Message</td></tr>\n"; 175 os << "<tr><td>Author</td><td>Date</td><td>Rev</td><td>Added</td>" 176 << "<td>Removed</td><td>Message</td></tr>\n"; 175 177 HtmlStream hs(os); 176 std::string timefmt("% b %d %H:%M:%S %Y");178 std::string timefmt("%Y %b %d %H:%M:%S"); 177 179 const size_t maxlength = 80; 178 180 const Configuration& conf = Configuration::instance(); … … 187 189 os << "</td>"; 188 190 os << "<td>"; 191 int added = stats["add"](LineTypeParser::total, "all", *r) - 192 stats["add"](LineTypeParser::total, "all", *r - 1); 193 os << added; 194 os << "</td>"; 195 os << "<td>"; 196 os << added - (stats["blame"](LineTypeParser::total, "all", *r) - 197 stats["blame"](LineTypeParser::total, "all", *r - 1)); 198 os << "</td>"; 199 os << "<td>"; 189 200 std::string mess = *m; 190 201 // replace newlines with space -
trunk/lib/first_page.h
r519 r556 34 34 class Commitment; 35 35 class Stats; 36 class StatsCollection; 36 37 class SVNlog; 37 38 … … 49 50 /// @brief print main page 50 51 /// 51 void print_main_page(const std::string&, const SVNlog&, const Stats&,52 std::string url);52 void print_main_page(const std::string&, const SVNlog&, 53 const StatsCollection&, std::string url); 53 54 54 void print_recent_logs(std::ostream&, const SVNlog& log); 55 void print_recent_logs(std::ostream&, const SVNlog& log, 56 const StatsCollection&); 55 57 56 58 void print_summary_plot(std::ostream&, const Stats& stats); -
trunk/lib/html_utility.cc
r550 r556 78 78 const std::string& stats) 79 79 { 80 os << "<!-- Generated by " << PACKAGE_STRING << "-->\n"; 80 81 os << "<!DOCTYPE html\n" 81 82 << "PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\"\n" … … 146 147 if (item_local=="none") 147 148 item_local = "total"; 149 if (item_local=="main") 150 item_local = "total"; 148 151 149 152 if (stats=="classic")
Note: See TracChangeset
for help on using the changeset viewer.