Changeset 1290 for trunk/lib/Node.h


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 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/Node.h

    r1280 r1290  
    9292    virtual std::string href(void) const=0;
    9393
    94     void html_tablerow(std::ostream&, const std::string&,
    95                        const std::string& css,
     94    /**
     95     */
     96    void html_tablerow(std::ostream& os,
     97                       const std::string& stats_type,
     98                       const std::string& css_class,
    9699                       const std::string& user) const;
    97100
     
    127130    const SVNlog& log(void) const;
    128131
     132    ///
     133    /// @return
     134    ///
     135    inline const std::string& local_path(void) const { return local_path_; }
     136
     137    ///
     138    /// Function returning everything after the last '/'
     139    ///
     140    /// @return name of node (not full path)
     141    ///
     142    std::string name(void) const;
     143
    129144    /**
    130145       @return The explicit string identifying the underlying derived
     
    132147    */
    133148    virtual std::string node_type(void) const=0;
    134 
    135     ///
    136     /// @return
    137     ///
    138     inline const std::string& local_path(void) const { return local_path_; }
    139 
    140     ///
    141     /// Function returning everything after the last '/'
    142     ///
    143     /// @return name of node (not full path)
    144     ///
    145     std::string name(void) const;
    146 
    147     /**
    148        Note that returned string always end with '/' with the
    149        exception when an empty string is returned.
    150 
    151        @return output dir for example 'lib/' for this file
    152      */
    153     std::string output_dir(void) const;
    154 
    155     /**
    156        @return output path for example 'lib/Node.h.html' for this file
    157      */
    158     virtual std::string output_path(void) const=0;
    159149
    160150    ///
     
    163153    inline const std::string& path(void) const { return path_; }
    164154
    165     ///
    166     /// Function printing HTML in current working directory
    167     ///
    168     void print(const bool verbose=false) const;
    169 
    170     void print_author_summary(std::ostream&,
    171                               const Stats& stats,
    172                               const std::string& line_type,
    173                               const SVNlog&) const;
    174 
    175155    /**
    176156       \return true if svncopyright::ignore property was set
     
    194174    const StatsCollection& stats(void) const;
    195175
     176    /**
     177     */
    196178    StatsCollection& stats(void);
    197179
     
    203185
    204186    /**
    205        \see SVNinfo::url(void)
    206     */
    207     std::string url(void) const;
    208    
     187     */
    209188    inline const SVNinfo& svn_info(void) const { return svninfo_; }
    210189
     190    /**
     191     */
     192    const TinyStats& tiny_stats(void) const { return tiny_stats_; }
     193
    211194  protected:
    212     ///
    213     /// print path in html format (with anchors) to @a os
    214     ///
    215     void path_anchor(std::ostream& os) const;
    216 
    217195    unsigned int level_;
    218196    std::string output_dir_;
     
    228206    Node(const Node&);
    229207
    230     void html_tabletd(std::ostream&, const std::string& stats_type,
     208    /**
     209     */
     210    void html_tabletd(std::ostream&,
     211                      const std::string& stats_type,
    231212                      const std::string& user,
    232213                      LineTypeParser::line_type lt) const;
    233214
    234215    virtual void log_core(SVNlog&) const=0;
    235 
    236     virtual void print_core(bool verbose=false) const=0;
    237 
    238     ///
    239     /// print page for specific user (or all) and specific line_style
    240     /// (or total).
    241     ///
    242     virtual void print_core(const std::string& stats_type,
    243                             const std::string& user,
    244                             const std::string& line_type,
    245                             const SVNlog&) const=0;
    246216
    247217    bool binary_;
     
    252222    bool svncopyright_ignore_;
    253223    SVNinfo svninfo_;
     224
     225    friend class FilePrinter;
     226    friend class DirectoryPrinter;
     227    friend class NodePrinter;
    254228  };
    255229
Note: See TracChangeset for help on using the changeset viewer.