Changeset 63 for trunk/lib/Stats.cc


Ignore:
Timestamp:
Jan 20, 2006, 12:07:36 AM (16 years ago)
Author:
Peter Johansson
Message:

Fixed problem with mapping revison to date. Removed mkstemps. name of
png files are now in line with their html file name. Binary works on
svnstat, but is asserted on c++_tools.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/Stats.cc

    r60 r63  
    66
    77#include <algorithm>
     8#include <cstdlib>
    89#include <iostream>
    910#include <map>
     
    1415#include <utility>
    1516#include <vector>
     17
    1618
    1719namespace theplu{
     
    3133    std::vector<double> accum(sum.size());
    3234    std::partial_sum(sum.begin(),sum.end(),accum.begin());
     35    assert(sum.size()==accum.size());
    3336    return accum;
    3437  }
     
    106109
    107110
    108   std::string Stats::plot(void) const
     111  std::string Stats::plot(const std::string& name) const
    109112  {
    110     char name[]="svnstat_XXXXXX.png";
    111     if (mkstemps(name,4)==-1){
    112       throw std::runtime_error(std::string("Failed to get unique filename: ") +
    113                              name);
    114     }
    115113    std::string cmd=std::string("set term png; set output '")+name+"'";
    116114    gnuplot_pipe_.command(cmd);
Note: See TracChangeset for help on using the changeset viewer.