Changeset 23 for trunk/lib/Node.cc


Ignore:
Timestamp:
Jan 2, 2006, 9:14:57 AM (16 years ago)
Author:
Peter Johansson
Message:

added print functionality

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/Node.cc

    r20 r23  
    44#include "utility.h"
    55
     6#include <ctime>
    67#include <fstream>
    78#include <iostream>
     
    1112namespace svnstat{
    1213
    13   void Node::info(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       // Jari, throw exception.
    19       std::cerr << "Error: svn info " << path_ << std::endl;     
    20       exit(-1);
    21     }
    22     std::cerr << "Ok: svn info " << path_ << std::endl;     
    23     std::ifstream is("svnstat.tmp");
    24     std::string line;
    25     while (getline(is,line)){
    26       std::stringstream ss(line);
    27       std::string tag;
    28       getline(ss,tag,':');
    29       if (tag == std::string("Repository UUID"))
    30         ss >> uuid_;
    31       else if (tag == std::string("Last Changed Author"))
    32         ss >> author_;
    33       else if (tag == std::string("Last Changed Rev"))
    34         ss >> revision_;
    35     }
    36   }
     14  std::string Node::name(void) const
     15  {
     16    std::stringstream ss(path_);
     17    std::string name;
     18    while (getline(ss,name,'/')) {}
     19    return name;
     20  }
     21
     22
     23  void Node::print_footer(std::ostream& os) const
     24  {
     25    os << "</body>\n"
     26       << "</html>";
     27  }
     28
     29
     30  void Node::print_header(std::ostream& os) const
     31  {
     32    os << "<html>\n"
     33       << "<head>\n"
     34       << "<title> svnstat " << name() << "\n"
     35       << "</head>\n"
     36       << "<body bgcolor='FFFBFB'\n";
     37  }
    3738
    3839
Note: See TracChangeset for help on using the changeset viewer.