source: trunk/lib/Node.cc @ 101

Last change on this file since 101 was 101, checked in by Peter Johansson, 15 years ago

closes #28 #18 and added some lippstick to the node daughters table output

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 2.1 KB
Line 
1// $Id: Node.cc 101 2006-06-22 09:00:06Z peter $
2
3/*
4  Copyright (C) 2005, 2006 Jari Häkkinen, Peter Johansson
5
6  This file is part of svnstat, http://lev.thep.lu.se/trac/svnstat
7
8  svnstat is free software; you can redistribute it and/or modify it
9  under the terms of the GNU General Public License as published by
10  the Free Software Foundation; either version 2 of the License, or
11  (at your option) any later version.
12
13  svnstat is distributed in the hope that it will be useful, but
14  WITHOUT ANY WARRANTY; without even the implied warranty of
15  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
16  General Public License for more details.
17
18  You should have received a copy of the GNU General Public License
19  along with this program; if not, write to the Free Software
20  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
21  02111-1307, USA.
22*/
23
24#include "Node.h"
25#include "utility.h"
26#include <config.h> // this header file is created by configure
27
28#include <ctime>
29#include <fstream>
30#include <iostream>
31#include <sstream>
32
33namespace theplu{
34namespace svnstat{
35
36  Node::Node(const std::string& path, const std::string& output="")
37      : path_(path), stats_(path)
38  { 
39    output_name_ = output+file_name(path_); 
40  }
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
56  void Node::print_footer(std::ostream& os) const
57  {
58    time_t rawtime;
59    struct tm * timeinfo;
60    time ( &rawtime );
61    timeinfo = localtime ( &rawtime );
62    os << "<p align=center><font size=-2>\nGenerated on "
63       << asctime (timeinfo) 
64       << "by <a href=http://lev.thep.lu.se/trac/svnstat/>"
65       << PACKAGE_STRING << "</a>"
66       << "</font>\n</p>\n</body>\n</html>\n";
67  }
68
69
70  void Node::print_header(std::ostream& os) const
71  {
72    os << "<html>\n"
73       << "<head>\n"
74       << "<title> svnstat " << name() << "</title>\n"
75       << "</head>\n"
76       << "<body bgcolor=#ffffff vlink=#000000>\n";
77  }
78
79}} // end of namespace svnstat and namespace theplu
Note: See TracBrowser for help on using the repository browser.