source: trunk/lib/Node.cc @ 15

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

removed superfluous includes

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 1.2 KB
Line 
1// $Id: Node.cc 15 2005-12-30 17:04:16Z peter $
2
3#include "Node.h"
4#include "utility.h"
5
6#include <fstream>
7#include <iostream>
8#include <sstream>
9
10namespace theplu{
11namespace svnstat{
12
13  bool Node::info()
14  {
15    std::string system_call = "svn info " + path_ + " > svnstat.tmp";
16    int system_return = system(system_call.c_str());
17    if (system_return){
18      std::cerr << "Error: svn info " << path_ << std::endl;     
19      return false;
20    }
21    std::ifstream is("svnstat.tmp");
22    std::string line;
23    while (getline(is,line)){
24      std::stringstream ss(line);
25      std::string tag;
26      getline(ss,tag,':');
27      if (tag == std::string("Repository UUID"))
28        ss >> uuid_; 
29      else if (tag == std::string("Last Changed Author"))
30        ss >> author_;
31      else if (tag == std::string("Last Changed Rev"))
32        ss >> revision_;
33    }
34   
35    return true;
36  }
37
38  bool Node::subversion_controlled(void) const {
39    std::string system_call = "svn info " + path_;
40    int system_return = system(system_call.c_str());
41    if (system_return){
42      std::cerr << "Error: svn info " << path_ << std::endl;     
43      return false;
44    }
45    std::cerr << "Alright: svn info " << path_ << std::endl;     
46
47    return true;
48  }
49
50}} // end of namespace svnstat and namespace theplu
Note: See TracBrowser for help on using the repository browser.