source: trunk/lib/Node.cc @ 91

Last change on this file since 91 was 91, checked in by Jari Häkkinen, 17 years ago

Fixes #4, #19, #32, #34: Started to implement subversion API usage.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 1.7 KB
Line 
1// $Id: Node.cc 91 2006-03-23 22:56:17Z jari $
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
27#include <ctime>
28#include <fstream>
29#include <iostream>
30#include <sstream>
31
32namespace theplu{
33namespace svnstat{
34
35
36  std::string Node::name(void) const
37  {
38    std::stringstream ss(path_);
39    std::string name;
40    while (getline(ss,name,'/')) {}
41    return name;
42  }
43
44
45  void Node::print_footer(std::ostream& os) const
46  {
47    time_t rawtime;
48    struct tm * timeinfo;
49    time ( &rawtime );
50    timeinfo = localtime ( &rawtime );
51    os << "<p align=center><font size=-2>Generated on "
52       << asctime (timeinfo) 
53       << "by <a href=http://lev.thep.lu.se/trac/svnstat/>svnstat</a>"
54       << "</font></p></body>\n</html>\n";
55  }
56
57
58  void Node::print_header(std::ostream& os) const
59  {
60    os << "<html>\n"
61       << "<head>\n"
62       << "<title> svnstat " << name() << "</title>\n"
63       << "</head>\n"
64       << "<body bgcolor='FFFBFB'>\n";
65  }
66
67
68}} // end of namespace svnstat and namespace theplu
Note: See TracBrowser for help on using the repository browser.