Changeset 286 for trunk/lib


Ignore:
Timestamp:
May 7, 2007, 6:07:23 PM (14 years ago)
Author:
Peter Johansson
Message:

moved trac link detection to separate file. refs #178

Location:
trunk/lib
Files:
2 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/HtmlStream.cc

    r235 r286  
    7373  }
    7474
     75 
     76  std::ostream& HtmlStream::stream(void)
     77  {
     78    return os_;
     79  }
     80
    7581}} // end of namespace svndigest and namespace theplu
  • trunk/lib/HtmlStream.h

    r234 r286  
    5454    void print(std::stringstream&);
    5555
     56    ///
     57    /// \return reference to underlying ostream
     58    ///
     59    std::ostream& stream(void);
     60
    5661  private:
    5762    ///
  • trunk/lib/Makefile.am

    r285 r286  
    3030  HtmlStream.h html_utility.h Node.h Parser.h rmdirhier.h \
    3131  Stats.h SVN.h SVNblame.h  \
    32   SVNinfo.h SVNlog.h SVNproperty.h utility.h
     32  SVNinfo.h SVNlog.h SVNproperty.h Trac.h utility.h
    3333
    3434libsvndigest_la_SOURCES = ColumnStream.cc Commitment.cc Configuration.cc \
     
    3636  Gnuplot.cc GnuplotFE.cc HtmlStream.cc \
    3737  html_utility.cc Node.cc Parser.cc rmdirhier.cc Stats.cc SVN.cc        \
    38   SVNblame.cc SVNinfo.cc SVNlog.cc SVNproperty.cc utility.cc
     38  SVNblame.cc SVNinfo.cc SVNlog.cc SVNproperty.cc Trac.cc utility.cc
    3939
    4040clean-local:
  • trunk/lib/first_page.cc

    r285 r286  
    3232#include "Stats.h"
    3333#include "SVNlog.h"
     34#include "Trac.h"
    3435#include "utility.h"
    3536#include <config.h> // this header file is created by configure
     
    182183      if (conf->trac_ticket().empty())
    183184        hs << mess;
    184       else { // make anchors to trac
    185         char c;
    186         std::stringstream ss(mess);
    187         for (ss.get(c); ss.good(); ss.get(c)) {
    188           if (c=='#') {
    189             int ticket=0;
    190             ss >> ticket;
    191             if (!ss.fail()){
    192               std::stringstream s;
    193               s << ticket;
    194               os << anchor(conf->trac_ticket()+s.str(),"#"+s.str());
    195             }
    196             else {
    197               ss.clear(std::ios::goodbit);
    198               hs << c;
    199             }
    200           }
    201           else
    202             hs << c;
    203         }
     185      else {// make anchors to trac
     186        Trac trac(hs);
     187        trac.print(mess);
    204188      }
    205189
Note: See TracChangeset for help on using the changeset viewer.