source: trunk/lib/Node.cc @ 100

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

closes #9 and move create function from svnstat.cc to lib/utility and also move rmdirhier to lib

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 1.8 KB
Line 
1// $Id: Node.cc 100 2006-06-19 09:53:16Z 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  void Node::print_footer(std::ostream& os) const
43  {
44    time_t rawtime;
45    struct tm * timeinfo;
46    time ( &rawtime );
47    timeinfo = localtime ( &rawtime );
48    os << "<p align=center><font size=-2>Generated on "
49       << asctime (timeinfo) 
50       << "by <a href=http://lev.thep.lu.se/trac/svnstat/>"
51       << PACKAGE_STRING << "</a>"
52       << "</font></p></body>\n</html>\n";
53  }
54
55
56  void Node::print_header(std::ostream& os) const
57  {
58    os << "<html>\n"
59       << "<head>\n"
60       << "<title> svnstat " << name() << "</title>\n"
61       << "</head>\n"
62       << "<body bgcolor='FFFBFB'>\n";
63  }
64
65
66}} // end of namespace svnstat and namespace theplu
Note: See TracBrowser for help on using the repository browser.