// $Id: Node.cc 149 2006-08-12 09:11:46Z jari $ /* Copyright (C) 2005, 2006 Jari Häkkinen, Peter Johansson This file is part of svndigest, http://lev.thep.lu.se/trac/svndigest svndigest 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. svndigest 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 svndigest{ Node::Node(const u_int level, const std::string& path, const std::string& output="") : level_(level), path_(path), stats_(path), svninfo_(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" << " svndigest " << name() << "\n" << "\n" << "\n" << "\n" << "
" << "
" << "
" << "

" << output_name() << "

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