Changeset 538 for trunk/lib


Ignore:
Timestamp:
Dec 27, 2007, 8:25:08 AM (16 years ago)
Author:
Peter Johansson
Message:

added ignore-cache option

Location:
trunk/lib
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/Directory.cc

    r532 r538  
    129129  }
    130130
    131   const StatsCollection& Directory::parse(const bool verbose)
     131  const StatsCollection& Directory::parse(bool verbose, bool ignore)
    132132  {
    133133    stats_.reset();
     
    135135    for (NodeIterator i=daughters_.begin(); i!=daughters_.end(); ++i)
    136136      if (!(*i)->ignore())
    137         stats_ += (*i)->parse(verbose);
     137        stats_ += (*i)->parse(verbose, ignore);
    138138    return stats_;
    139139  }
  • trunk/lib/Directory.h

    r532 r538  
    8181    std::string output_path(void) const;
    8282
    83     const StatsCollection& parse(const bool verbose=false);
     83    const StatsCollection& parse(bool verbose, bool ignore);
    8484
    8585    void print_copyright(std::map<std::string, Alias>&, bool verbose) const;
  • trunk/lib/File.cc

    r536 r538  
    189189
    190190
    191   const StatsCollection& File::parse(const bool verbose)
     191  const StatsCollection& File::parse(bool verbose, bool ignore)
    192192  {
    193193    if (verbose)
     
    201201        return stats_;
    202202      }
    203     }
     203      is.close();
     204    }
     205    else
     206      stats_.parse(path_);
    204207    if (!node_exist(cache_dir))
    205208      mkdir(cache_dir);
    206209    std::ofstream os(cache_file.c_str());
    207210    stats_.print(os);
     211    os.close();
    208212    return stats_;
    209213  }
  • trunk/lib/File.h

    r532 r538  
    6464    /// @return Stats object of the file
    6565    ///
    66     const StatsCollection& parse(const bool verbose=false);
     66    const StatsCollection& parse(bool verbose, bool ignore);
    6767
    6868    /**
  • trunk/lib/Node.h

    r532 r538  
    152152    /// @brief parsing file using svn blame.
    153153    ///
    154     virtual const StatsCollection& parse(const bool verbose=false)=0;
     154    virtual const StatsCollection& parse(bool verbose,
     155                                         bool ignore_cache)=0;
    155156
    156157    ///
  • trunk/lib/StatsCollection.cc

    r533 r538  
    7777
    7878
    79   const StatsCollection& StatsCollection::parse(const std::string& path)
     79  void StatsCollection::parse(const std::string& path)
    8080  {
    8181    for (map::iterator i(stats_.begin()); i!=stats_.end(); ++i) {
    8282      i->second->parse(path);
    8383    }
    84     return *this;
    8584  }
    8685
  • trunk/lib/StatsCollection.h

    r532 r538  
    5656    bool load_cache(std::istream&);
    5757
    58     const std::map<std::string, Stats*>& stats(void) const;
    59 
     58    /**
     59       Do the parsing for different statistics
     60     */
     61    void parse(const std::string& path);
    6062
    6163    /**
     
    6870     */
    6971    void reset(void);
     72
     73    const std::map<std::string, Stats*>& stats(void) const;
    7074
    7175    /**
     
    8690
    8791  private:
    88     /**
    89        Do the parsing for different statistics
    90      */
    91     const StatsCollection& parse(const std::string& path);
    92 
    9392    const std::string path_;
    9493    typedef std::map<std::string, Stats*> map;
Note: See TracChangeset for help on using the changeset viewer.