Changeset 101
Legend:
- Unmodified
- Added
- Removed
-
trunk/lib/Directory.cc
r100 r101 78 78 } 79 79 } 80 daughters_.sort(NodePtrLess()); 80 81 } 81 82 … … 85 86 for (NodeIterator i=daughters_.begin(); i!=daughters_.end(); i++) 86 87 delete *i; 88 } 89 90 bool Directory::dir(void) const 91 { 92 return true; 87 93 } 88 94 … … 112 118 print_header(os); 113 119 os << "<p align=center>\n<img src='" 114 << file_name(stats_.plot(output_name()+"/index.png" ))120 << file_name(stats_.plot(output_name()+"/index.png", output_name())) 115 121 << "' alt='[plot]' border=0><br>\n"; 116 122 os << "<table>\n"; 117 os << "<tr><td><strong>Node</strong></td>\n"; 118 os << "<td><strong>Count</strong></td></tr>\n"; 119 os << "<tr><td>Total</td>\n"; 120 os << "<td align=right>" << stats_.rows() << "</td></tr>\n"; 123 os << "<tr>\n<td><strong>Node</strong></td>\n"; 124 os << "<td><strong>Count</strong></td>\n</tr>\n"; 125 os << "<tr>\n<td bgcolor=#dddddd>Total</td>\n"; 126 os << "<td align=right bgcolor=#dddddd>" << stats_.rows() 127 << "</td>\n</tr>\n"; 128 121 129 // print html links to daughter nodes 122 transform(daughters_.begin(), daughters_.end(), 123 std::ostream_iterator<std::string>(os," "), 124 std::mem_fun(&Node::html_tablerow)); 130 bool dark=true; 131 for (NodeConstIterator d = daughters_.begin(); d!=daughters_.end(); d++){ 132 if (dark) 133 os << (*d)->html_tablerow("#eeeeee"); 134 else 135 os << (*d)->html_tablerow("#dddddd"); 136 dark = !dark; 137 } 125 138 os << "</table>\n"; 126 os << "</p> ";139 os << "</p>\n"; 127 140 print_footer(os); 128 141 os.close(); -
trunk/lib/Directory.h
r100 r101 60 60 61 61 /// 62 /// @return true 63 /// 64 bool dir(void) const; 65 66 /// 62 67 /// @return A properly formatted html link to this directory. 63 68 /// -
trunk/lib/File.cc
r100 r101 65 65 print_header(os); 66 66 os << "<p align=center>\n<img src='" 67 << file_name(stats_.plot(output_name _+".png"))67 << file_name(stats_.plot(output_name()+".png",output_name())) 68 68 << "' alt='[plot]' border=0>\n</p>"; 69 69 print_footer(os); -
trunk/lib/Gnuplot.cc
r84 r101 77 77 78 78 79 voidGnuplot::command(const std::string& cmdstr)79 int Gnuplot::command(const std::string& cmdstr) 80 80 { 81 fputs(cmdstr.c_str(),pipe_);81 int r = fputs(cmdstr.c_str(),pipe_); 82 82 if (*(cmdstr.rbegin())!='\n') 83 83 fputc('\n',pipe_); 84 84 fflush(pipe_); 85 return r; 85 86 } 86 87 -
trunk/lib/Gnuplot.h
r84 r101 70 70 /// Send arbitrary commands to Gnuplot. 71 71 /// 72 voidcommand(const std::string&);72 int command(const std::string&); 73 73 74 74 /// -
trunk/lib/Node.cc
r100 r101 40 40 } 41 41 42 bool Node::dir(void) const 43 { 44 return false; 45 } 46 47 std::string Node::html_tablerow(const std::string& color) const 48 { 49 std::stringstream ss; 50 ss << "<tr>\n<td bgcolor=" << color << ">" << html_link() 51 << "</td>\n<td bgcolor=" << color << " align=right>" 52 << stats_.rows() << "</td>\n</tr>\n"; 53 return ss.str(); 54 } 55 42 56 void Node::print_footer(std::ostream& os) const 43 57 { … … 46 60 time ( &rawtime ); 47 61 timeinfo = localtime ( &rawtime ); 48 os << "<p align=center><font size=-2> Generated on "62 os << "<p align=center><font size=-2>\nGenerated on " 49 63 << asctime (timeinfo) 50 64 << "by <a href=http://lev.thep.lu.se/trac/svnstat/>" 51 65 << PACKAGE_STRING << "</a>" 52 << "</font> </p></body>\n</html>\n";66 << "</font>\n</p>\n</body>\n</html>\n"; 53 67 } 54 68 … … 60 74 << "<title> svnstat " << name() << "</title>\n" 61 75 << "</head>\n" 62 << "<body bgcolor= 'FFFBFB'>\n";76 << "<body bgcolor=#ffffff vlink=#000000>\n"; 63 77 } 64 78 65 66 79 }} // end of namespace svnstat and namespace theplu -
trunk/lib/Node.h
r100 r101 66 66 67 67 /// 68 /// @return true if directory 69 /// 70 virtual bool dir(void) const; 71 72 /// 68 73 /// @return A properly formatted html link to this node. 69 74 /// 70 75 virtual std::string html_link(void) const=0; 71 76 72 inline std::string html_tablerow(void) const 73 { 74 std::stringstream ss; 75 ss << "<tr><td>" << html_link() << "</td><td align=right>" << stats_.rows() 76 << "</td></tr>\n"; 77 return ss.str(); 78 } 77 /// 78 /// 79 /// 80 std::string html_tablerow(const std::string&) const; 79 81 80 82 /// … … 125 127 }; 126 128 129 struct NodePtrLess 130 { 131 inline bool operator()(const Node* first, const Node* second) const 132 { 133 if (first->dir()==second->dir()) 134 return first->output_name()<second->output_name(); 135 return first->dir(); 136 } 137 }; 138 127 139 }} // end of namespace svnstat and namespace theplu 128 140 -
trunk/lib/Stats.cc
r84 r101 131 131 132 132 133 std::string Stats::plot(const std::string& name) const 133 std::string Stats::plot(const std::string& filename, 134 const std::string& title) const 134 135 { 135 136 GnuplotFE* gp=GnuplotFE::instance(); 136 gp->command(std::string("set term png; set output '")+ name+"'");137 gp->command(std::string("set title '")+ name+"'");137 gp->command(std::string("set term png; set output '")+filename+"'"); 138 gp->command(std::string("set title '")+title+"'"); 138 139 gp->command("set key default"); 139 140 gp->command("set key left Left reverse"); … … 168 169 gp->yrange(); 169 170 170 return name;171 return filename; 171 172 } 172 173 -
trunk/lib/Stats.h
r84 r101 54 54 /// Create statistics graph. 55 55 /// 56 std::string plot(const std::string& ) const;56 std::string plot(const std::string&, const std::string&) const; 57 57 58 58 ///
Note: See TracChangeset
for help on using the changeset viewer.