Changeset 16 for trunk/lib


Ignore:
Timestamp:
Dec 30, 2005, 6:30:51 PM (17 years ago)
Author:
Peter Johansson
Message:

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

Location:
trunk/lib
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/Directory.cc

    r14 r16  
    6060  const Stats& Directory::parse(void)
    6161  {
    62     // calling svn info;
    63     info();
    6462    stats_.reset();
    6563
  • trunk/lib/File.cc

    r15 r16  
    2424  const Stats& File::parse(void)
    2525  {
    26     // calling svn info
    27     info();
    2826    stats_.reset();
    2927    if (binary_){
  • trunk/lib/Node.cc

    r15 r16  
    1111namespace svnstat{
    1212
    13   bool Node::info()
     13  bool Node::subversion_controlled(void)
    1414  {
    1515    std::string system_call = "svn info " + path_ + " > svnstat.tmp";
     
    1919      return false;
    2020    }
     21    std::cerr << "Ok: svn info " << path_ << std::endl;     
    2122    std::ifstream is("svnstat.tmp");
    2223    std::string line;
     
    3637  }
    3738
    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 
     39 
    5040}} // end of namespace svnstat and namespace theplu
  • trunk/lib/Node.h

    r15 r16  
    2020    /// @brief Constructor
    2121    ///
    22     inline Node(const std::string& path) : path_(path) { info(); }
     22    inline Node(const std::string& path) : path_(path) {}
    2323
    2424    ///
     
    3838
    3939    ///
    40     /// Check if the node is under subversion control.
     40    /// Check if the node is under subversion control. If node
     41    /// is under subversion control, information about node is
     42    /// parsed from the 'svn info' output.
     43    ///
    4144    ///
    4245    /// @return True if subversion controlled, false otherwise.
    4346    ///
    44     bool subversion_controlled(void) const;
     47    bool subversion_controlled(void);
    4548
    4649  protected:
    47     ///
    48     /// @brief performing svn info and parsing the info.
    49     ///
    50     /// @return true if parsing succesful
    51     ///
    52     bool info(void);
    53 
    5450    std::string author_;
    5551    std::string path_;
Note: See TracChangeset for help on using the changeset viewer.