Ignore:
Timestamp:
Nov 12, 2010, 5:01:35 AM (11 years ago)
Author:
Peter Johansson
Message:

closes #457. Lifting out plotting functions in Stats into a new class
StatsPlotter?. In same manner lifting out print functions from
Node/Directory/File? into a new hierarchy
NodePrinter/DirectoryPrinter/FilePrinter?. To accomplish these splits
without to much recoding some friendships are introduced. These new
classes are only needed for svndigest (not svncopyright) and are
therefore placed in a library named libsvndigest together with Graph
class and first_page functions. Remaining functionality, shared
between svncopyright and svndigest, are located in libsvndigest_core
and linked into both binaries.

File:
1 copied

Legend:

Unmodified
Added
Removed
  • trunk/lib/FilePrinter.h

    r1289 r1290  
    1 #ifndef _theplu_svndigest_file_
    2 #define _theplu_svndigest_file_
     1#ifndef _theplu_svndigest_file_printer_
     2#define _theplu_svndigest_file_printer_
    33
    44// $Id$
     
    2424*/
    2525
    26 #include "Node.h"
     26#include "NodePrinter.h"
    2727
    28 #include <map>
    2928#include <string>
    3029
     
    3231namespace svndigest{
    3332
    34   class NodeVisitor;
     33  class File;
    3534
    36   class File : public Node
     35  class FilePrinter : public NodePrinter
    3736  {
    3837  public:
     
    4039    /// @brief Default Constructor
    4140    ///
    42     File(const unsigned int level, const std::string& path,
    43          const std::string& output="");
     41    explicit FilePrinter(const File& file);
    4442
    4543    /**
    46        For example 'File.h.html'
    47 
    48        @return href to this file
    49     */
    50     std::string href(void) const;
    51 
    52     /**
    53        \brief Get the revision number of the latest commit.
    54     */
    55     svn_revnum_t last_changed_rev(void) const;
    56 
    57     /**
    58        @return The explicit string "file", nothing else.
    59     */
    60     std::string node_type(void) const;
    61 
    62     /**
    63        @return output path for example 'lib/File.h.html' for this file
     44       @return output path for example 'lib/FilePrinter.h.html' for this file
    6445     */
    6546    std::string output_path(void) const;
    66 
    67     ///
    68     /// @brief Parsing out information from svn repository
    69     ///
    70     /// @return Stats object of the file
    71     ///
    72     const StatsCollection& parse(bool verbose, bool ignore);
    73 
    74     /**
    75        Let the visitor perform its mission via visitor(*this)
    76      */
    77     void traverse(NodeVisitor& visitor);
    7847
    7948  private:
     
    8857    /// @brief Copy Constructor, not implemented
    8958    ///
    90     File(const File&);
     59    FilePrinter(const FilePrinter&);
    9160
    9261    ///
     
    11180                    const std::string& line_type, const SVNlog&) const;
    11281
     82    const Node& node(void) const;
     83
     84    const File& file_;
     85
    11386  };
    11487
Note: See TracChangeset for help on using the changeset viewer.