source: trunk/lib/Node.cc @ 16

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

merged Node::info() and Node::subversion_controlled()

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 973 bytes
Line 
1// $Id: Node.cc 16 2005-12-30 17:30:51Z 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::subversion_controlled(void) 
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::cerr << "Ok: svn info " << path_ << std::endl;     
22    std::ifstream is("svnstat.tmp");
23    std::string line;
24    while (getline(is,line)){
25      std::stringstream ss(line);
26      std::string tag;
27      getline(ss,tag,':');
28      if (tag == std::string("Repository UUID"))
29        ss >> uuid_; 
30      else if (tag == std::string("Last Changed Author"))
31        ss >> author_;
32      else if (tag == std::string("Last Changed Rev"))
33        ss >> revision_;
34    }
35   
36    return true;
37  }
38
39 
40}} // end of namespace svnstat and namespace theplu
Note: See TracBrowser for help on using the repository browser.