// $Id: Node.cc 120 2006-07-03 13:47:06Z peter $ /* Copyright (C) 2005, 2006 Jari Häkkinen, Peter Johansson This file is part of svnstat, http://lev.thep.lu.se/trac/svnstat svnstat is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. svnstat is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "Node.h" #include "utility.h" #include // this header file is created by configure #include #include #include #include namespace theplu{ namespace svnstat{ Node::Node(const u_int level, const std::string& path, const std::string& output="") : level_(level), path_(path), stats_(path) { output_name_ = output+file_name(path_); } bool Node::dir(void) const { return false; } std::string Node::html_tablerow(const std::string& css_class) const { std::stringstream ss; ss << "\n" << "\n" << "" << stats_.lines() << "\n" << "" << stats_.code() << "\n" << "" << stats_.comments() << "\n" << "" << stats_.last_changed_rev() << "\n" << "" << author() << "\n" << "\n"; return ss.str(); } void Node::print_footer(std::ostream& os) const { time_t rawtime; struct tm * timeinfo; time ( &rawtime ); timeinfo = localtime ( &rawtime ); os << "

\nGenerated on " << asctime (timeinfo) << "by " << PACKAGE_STRING << "" << "\n

\n\n\n\n"; } void Node::print_header(std::ostream& os) const { os << "\n" << "\n" << "\n" << " svnstat " << name() << "\n" << "\n" << "\n" << "\n" << "
" << "
" << "
" << "

" << output_name() << "

\n"; } }} // end of namespace svnstat and namespace theplu