Changeset 176


Ignore:
Timestamp:
Sep 2, 2006, 6:17:28 AM (13 years ago)
Author:
Peter Johansson
Message:

fixes #12 binary files are now printed with note without anchor. Binary files and directories all counted as zero lines.

Location:
trunk/lib
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/Directory.cc

    r175 r176  
    9090  }
    9191
     92  bool Directory::binary(void) const
     93  {
     94    return false;
     95  }
     96
    9297  bool Directory::dir(void) const
    9398  {
  • trunk/lib/Directory.h

    r175 r176  
    8080    Directory(const Directory&);
    8181
     82    ///
     83    /// @return false
     84    ///
     85    bool binary(void) const;
     86
    8287    typedef std::list<Node*> NodeContainer;
    8388    typedef NodeContainer::iterator NodeIterator;
  • trunk/lib/File.cc

    r175 r176  
    3232namespace svndigest{
    3333
     34  bool File::binary(void) const
     35  {
     36    return binary_;
     37  }
     38
     39
    3440  std::string File::href(void) const
    3541  {
     
    4955  void File::print(const bool verbose) const
    5056  {
     57    // no output page for binary files
     58    if (binary_)
     59      return;
    5160    std::string output(output_name() + ".html");
    5261    if (verbose)
  • trunk/lib/File.h

    r175 r176  
    6161  private:
    6262    ///
     63    /// @return true if file is binary
     64    ///
     65    bool binary(void) const;
     66
     67    ///
    6368    /// @brief Parsing svn blame output
    6469    ///
  • trunk/lib/Node.cc

    r175 r176  
    6767    os << "<tr class=\"" << css_class << "\">\n"
    6868       << "<td>" ;
    69     anchor(os,href(), name());
     69    if (binary())
     70      os << name() << " (<i>binary</i>)";
     71    else
     72      anchor(os,href(), name());
    7073    os << "</td>\n"
    7174       << "<td>" << stats_.lines() << "</td>\n"
  • trunk/lib/Node.h

    r175 r176  
    9797    virtual const Stats& parse(const bool verbose=false)=0;
    9898
     99    ///
     100    /// @todo doc
     101    ///
    99102    inline const std::string& path(void) const { return path_; }
    100103
     
    105108
    106109  protected:
     110
     111    ///
     112    /// @note Directories are not consider binary.
     113    ///
     114    virtual bool binary(void) const=0;
    107115
    108116    ///
Note: See TracChangeset for help on using the changeset viewer.