source: trunk/lib/Node.cc @ 44

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

modified output file names

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 936 bytes
Line 
1// $Id: Node.cc 29 2006-01-09 09:35:50Z 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    os << "</body>\n" 
33       << "</html>";
34  }
35
36
37  void Node::print_header(std::ostream& os) const
38  {
39    os << "<html>\n"
40       << "<head>\n"
41       << "<title> svnstat " << name() << "\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.