source: trunk/lib/Node.cc @ 71

Last change on this file since 71 was 71, checked in by Peter Johansson, 16 years ago

class goes to typename, hi hi

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 1.1 KB
Line 
1// $Id: Node.cc 71 2006-02-23 09:25:41Z peter $
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  Node::Node(const std::string& path, const std::string& output) 
15    : path_(path)
16  {
17    output_name_ = output + name(); 
18  }
19
20
21  std::string Node::name(void) const
22  {
23    std::stringstream ss(path_);
24    std::string name;
25    while (getline(ss,name,'/')) {}
26    return name;
27  }
28
29
30  void Node::print_footer(std::ostream& os) const
31  {
32    time_t rawtime;
33    struct tm * timeinfo;
34    time ( &rawtime );
35    timeinfo = localtime ( &rawtime );
36    os << "<p><font size=1>Generated on "
37       << asctime (timeinfo) 
38       << "by svnstat</font></p></body>\n" 
39       << "</html>";
40  }
41
42
43  void Node::print_header(std::ostream& os) const
44  {
45    os << "<html>\n"
46       << "<head>\n"
47       << "<title> svnstat " << name() << "\n"
48       << "</head>\n"
49       << "<body bgcolor='FFFBFB'\n";
50  }
51
52
53  bool Node::subversion_controlled(void) const
54  {
55    std::string system_call = "svn proplist " + path_ + ">&/dev/null";
56    return !system(system_call.c_str());
57  }
58
59}} // end of namespace svnstat and namespace theplu
Note: See TracBrowser for help on using the repository browser.