source: trunk/lib/Node.cc @ 79

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

Clean up code.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 1.0 KB
Line 
1// $Id: Node.cc 79 2006-03-10 11:44:45Z jari $
2
3#include "Node.h"
4#include "utility.h"
5
6#include <ctime>
7#include <fstream>
8#include <iostream>
9#include <sstream>
10
11namespace theplu{
12namespace svnstat{
13
14
15  std::string Node::name(void) const
16  {
17    std::stringstream ss(path_);
18    std::string name;
19    while (getline(ss,name,'/')) {}
20    return name;
21  }
22
23
24  void Node::print_footer(std::ostream& os) const
25  {
26    time_t rawtime;
27    struct tm * timeinfo;
28    time ( &rawtime );
29    timeinfo = localtime ( &rawtime );
30    os << "<p align=center><font size=-2>Generated on "
31       << asctime (timeinfo) 
32       << "by <a href=http://lev.thep.lu.se/trac/svnstat/>svnstat</a>"
33       << "</font></p></body>\n</html>\n";
34  }
35
36
37  void Node::print_header(std::ostream& os) const
38  {
39    os << "<html>\n"
40       << "<head>\n"
41       << "<title> svnstat " << name() << "</title>\n"
42       << "</head>\n"
43       << "<body bgcolor='FFFBFB'>\n";
44  }
45
46
47  bool Node::subversion_controlled(void) const
48  {
49    std::string system_call = "svn proplist " + path_ + ">&/dev/null";
50    return !system(system_call.c_str());
51  }
52
53}} // end of namespace svnstat and namespace theplu
Note: See TracBrowser for help on using the repository browser.