Changeset 750
- Timestamp:
- Jan 12, 2009, 5:46:11 AM (13 years ago)
- Location:
- trunk/lib
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/lib/Directory.cc
r693 r750 3 3 /* 4 4 Copyright (C) 2005, 2006, 2007 Jari Häkkinen, Peter Johansson 5 Copyright (C) 2009 Peter Johansson 5 6 6 7 This file is part of svndigest, http://dev.thep.lu.se/svndigest … … 140 141 void Directory::print_core(const bool verbose) const 141 142 { 143 mkdir("blame_output/" + local_path_); 142 144 // print daughter nodes, i.e., this function is recursive 143 145 for (NodeConstIterator i=daughters_.begin(); i!=daughters_.end(); ++i) -
trunk/lib/File.cc
r712 r750 3 3 /* 4 4 Copyright (C) 2005, 2006, 2007 Jari Häkkinen, Peter Johansson 5 Copyright (C) 2009 Peter Johansson 5 6 6 7 This file is part of svndigest, http://dev.thep.lu.se/svndigest … … 54 55 if (!output_dir_.empty()) 55 56 output_dir_+='/'; 57 } 58 59 60 std::string File::blame_output_file_name(void) const 61 { 62 return "blame_output/" + local_path() + ".html"; 56 63 } 57 64 … … 215 222 void File::print_blame(std::ofstream& os) const 216 223 { 217 os << "<br /><h3> Blame Information</h3>";224 os << "<br /><h3>" << local_path() << "</h3>"; 218 225 os << "<table class=\"blame\">\n"; 219 226 os << "<thead>\n"; … … 324 331 void File::print_core(const bool verbose) const 325 332 { 333 std::ofstream os(blame_output_file_name().c_str()); 334 assert(os.good()); 335 print_html_start(os, "svndigest", level_+1); 336 print_blame(os); 337 print_footer(os); 338 os.close(); 326 339 } 327 340 … … 354 367 print_author_summary(os, stats_[stats_type], line_type, log); 355 368 os << "\n"; 356 357 print_blame(os); 369 os << "<h3>" 370 << anchor(blame_output_file_name(), 371 "Blame Information", level_+3) 372 << "</h3>\n"; 358 373 359 374 print_footer(os); -
trunk/lib/File.h
r693 r750 6 6 /* 7 7 Copyright (C) 2005, 2006, 2007 Jari Häkkinen, Peter Johansson 8 Copyright (C) 2009 Peter Johansson 8 9 9 10 This file is part of svndigest, http://dev.thep.lu.se/svndigest … … 73 74 74 75 private: 76 std::string blame_output_file_name(void) const; 77 75 78 /** 76 79 @return log of this File. -
trunk/lib/html_utility.cc
r733 r750 4 4 Copyright (C) 2006 Peter Johansson 5 5 Copyright (C) 2007 Jari Häkkinen, Peter Johansson 6 Copyright (C) 2009 Peter Johansson 6 7 7 8 This file is part of svndigest, http://dev.thep.lu.se/svndigest … … 21 22 */ 22 23 24 #include <config.h> 25 23 26 #include "html_utility.h" 24 27 25 #include "config.h"26 28 #include "Configuration.h" 27 29 #include "Date.h" 28 30 #include "HtmlStream.h" 29 31 #include "subversion_info.h" 30 #include <config.h> // this header file is created by configure31 32 32 33 #include <sstream> … … 77 78 const std::string& stats) 78 79 { 80 print_html_start(os, title, level); 81 os << "<div id=\"menu\">" 82 << "<ul>\n<li></li>\n"; 83 if (item=="main") 84 os << "<li class=\"highlight\">"; 85 else 86 os << "<li>"; 87 os << anchor("index.html", "Main", level, "Main page"); 88 os << "</li>\n"; 89 90 std::string stats_local(stats); 91 if (stats_local=="none") 92 stats_local = "classic"; 93 94 if (item=="total") 95 os << "<li class=\"highlight\">"; 96 else 97 os << "<li>\n"; 98 os << anchor(stats_local+"/"+user+"/total/"+path, "Total", level, 99 "View statistics of all lines"); 100 os << "</li>\n"; 101 102 if (item=="code") 103 os << "<li class=\"highlight\">"; 104 else 105 os << "<li>"; 106 os << anchor(stats_local+"/"+user+"/code/"+path, "Code", level, 107 "View statistics of code lines"); 108 os << "</li>\n"; 109 110 if (item=="comments") 111 os << "<li class=\"highlight\">"; 112 else 113 os << "<li>"; 114 os << anchor(stats_local+"/"+user+"/comments/"+path, "Comment", level, 115 "View statistics of comment lines"); 116 os << "</li>\n"; 117 118 119 if (item=="empty") 120 os << "<li class=\"highlight\">"; 121 else 122 os << "<li>"; 123 os << anchor(stats_local+"/"+user+"/empty/"+path, "Other", level, 124 "View statistics of other lines"); 125 os << "</li>\n"; 126 os << "<li>"; 127 // Peter, this is ugly! But how to add space? 128 for (size_t i=0; i<50; ++i) 129 os << " "; 130 os << "</li>\n"; 131 132 std::string item_local(item); 133 if (item_local=="none") 134 item_local = "total"; 135 if (item_local=="main") 136 item_local = "total"; 137 138 if (stats=="classic") 139 os << "<li class=\"highlight\">"; 140 else 141 os << "<li>"; 142 os << anchor("classic/"+user+"/"+item_local+"/"+path, "Classic", level, 143 "View classic statistics"); 144 os << "</li>\n"; 145 146 if (stats=="blame") 147 os << "<li class=\"highlight\">"; 148 else 149 os << "<li>"; 150 os << anchor("blame/"+user+"/"+item_local+"/"+path, "Blame", level, 151 "View blame statistics"); 152 os << "</li>\n"; 153 154 if (stats=="add") 155 os << "<li class=\"highlight\">"; 156 else 157 os << "<li>"; 158 os << anchor("add/"+user+"/"+item_local+"/"+path, "Add", level, 159 "View add statistics"); 160 os << "</li>\n"; 161 162 163 os << "</li>\n" 164 << "</ul></div>\n" 165 << "<div id=\"main\">\n"; 166 } 167 168 169 void print_html_start(std::ostream& os, const std::string& title, 170 unsigned int level) 171 { 79 172 os << "<!-- Generated by " << PACKAGE_STRING << "-->\n"; 80 173 os << "<!DOCTYPE html\n" … … 91 184 os << "svndigest.css\" type=\"text/css\" />\n" 92 185 << "</head>\n" 93 << "<body>\n" 94 << "<div id=\"menu\">" 95 << "<ul>\n<li></li>\n"; 96 if (item=="main") 97 os << "<li class=\"highlight\">"; 98 else 99 os << "<li>"; 100 os << anchor("index.html", "Main", level, "Main page"); 101 os << "</li>\n"; 102 103 std::string stats_local(stats); 104 if (stats_local=="none") 105 stats_local = "classic"; 106 107 if (item=="total") 108 os << "<li class=\"highlight\">"; 109 else 110 os << "<li>\n"; 111 os << anchor(stats_local+"/"+user+"/total/"+path, "Total", level, 112 "View statistics of all lines"); 113 os << "</li>\n"; 114 115 if (item=="code") 116 os << "<li class=\"highlight\">"; 117 else 118 os << "<li>"; 119 os << anchor(stats_local+"/"+user+"/code/"+path, "Code", level, 120 "View statistics of code lines"); 121 os << "</li>\n"; 122 123 if (item=="comments") 124 os << "<li class=\"highlight\">"; 125 else 126 os << "<li>"; 127 os << anchor(stats_local+"/"+user+"/comments/"+path, "Comment", level, 128 "View statistics of comment lines"); 129 os << "</li>\n"; 130 131 132 if (item=="empty") 133 os << "<li class=\"highlight\">"; 134 else 135 os << "<li>"; 136 os << anchor(stats_local+"/"+user+"/empty/"+path, "Other", level, 137 "View statistics of other lines"); 138 os << "</li>\n"; 139 os << "<li>"; 140 // Peter, this is ugly! But how to add space? 141 for (size_t i=0; i<50; ++i) 142 os << " "; 143 os << "</li>\n"; 144 145 std::string item_local(item); 146 if (item_local=="none") 147 item_local = "total"; 148 if (item_local=="main") 149 item_local = "total"; 150 151 if (stats=="classic") 152 os << "<li class=\"highlight\">"; 153 else 154 os << "<li>"; 155 os << anchor("classic/"+user+"/"+item_local+"/"+path, "Classic", level, 156 "View classic statistics"); 157 os << "</li>\n"; 158 159 if (stats=="blame") 160 os << "<li class=\"highlight\">"; 161 else 162 os << "<li>"; 163 os << anchor("blame/"+user+"/"+item_local+"/"+path, "Blame", level, 164 "View blame statistics"); 165 os << "</li>\n"; 166 167 if (stats=="add") 168 os << "<li class=\"highlight\">"; 169 else 170 os << "<li>"; 171 os << anchor("add/"+user+"/"+item_local+"/"+path, "Add", level, 172 "View add statistics"); 173 os << "</li>\n"; 174 175 176 os << "</li>\n" 177 << "</ul></div>\n" 178 << "<div id=\"main\">\n"; 179 } 180 186 << "<body>\n"; 187 } 181 188 182 189 std::string trac_revision(svn_revnum_t r, std::string color) -
trunk/lib/html_utility.h
r716 r750 8 8 Copyright (C) 2007 Jari Häkkinen, Peter Johansson 9 9 Copyright (C) 2008 Jari Häkkinen 10 Copyright (C) 2008 Peter Johansson 10 11 11 12 This file is part of svndigest, http://dev.thep.lu.se/svndigest … … 68 69 69 70 71 /** 72 \brief print html start 73 74 Just like print_header, this function outputs start of html page, 75 but in contrast to print_header there are no menus in the otput 76 of this function. 77 */ 78 void print_html_start(std::ostream& os, const std::string& title, 79 unsigned int level); 80 81 70 82 /// 71 83 /// @return if trac-revision is set in config file anchor to trac is -
trunk/lib/utility.cc
r724 r750 3 3 /* 4 4 Copyright (C) 2006, 2007 Jari Häkkinen, Peter Johansson 5 Copyright (C) 2009 Peter Johansson 5 6 6 7 This file is part of svndigest, http://dev.thep.lu.se/svndigest … … 191 192 if (code){ 192 193 std::stringstream ss; 193 ss << "mkdir(" << dir << "): failed with error code: errno=" << errno;194 ss << "mkdir(" << dir << "): failed\n" << strerror(errno); 194 195 throw std::runtime_error(ss.str()); 195 196 }
Note: See TracChangeset
for help on using the changeset viewer.