Changeset 44


Ignore:
Timestamp:
Jan 13, 2006, 7:38:16 PM (16 years ago)
Author:
Jari Häkkinen
Message:

Removed unused #includes.
Fixed doxygen tag spelling errors.
Changed png filename generation.

Location:
trunk/lib
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/Stats.cc

    r42 r44  
    55#include "utility.h"
    66
    7 #include <cstdio>
    8 #include <fstream>
    9 
    107#include <algorithm>
    118#include <map>
     
    1310#include <sstream>
    1411#include <string>
     12#include <unistd.h>
    1513#include <utility>
    1614#include <vector>
    17 
    18 #include <iostream>
    1915
    2016namespace theplu{
     
    6965  std::string Stats::plot(void) const
    7066  {
    71     char name[]="svnstatXXXXXX";
    72     if (!strlen(mktemp(name))) {
    73       std::cerr << "Failed to get unique filename: " << name << std::endl;
    74       exit(-1);
    75     }
    76     std::string cmd=std::string("set term png; set output '")+name+".png'";
     67    char name[]="svnstat_XXXXXX.png";
     68    if (mkstemps(name,4)==-1)
     69      throw std::runtime_error(std::string("Failed to get unique filename: ") +
     70                               name);
     71    std::string cmd=std::string("set term png; set output '")+name+"'";
    7772    gnuplot_pipe_.command(cmd);
    7873    gnuplot_pipe_.command("set key left Left reverse");
     
    9590    gnuplot_pipe_.command(cmd);
    9691    gnuplot_pipe_.command("replot");
    97     return std::string(name)+".png";
    98   }
    99 
    100   void Stats::print(std::ostream& os) const
    101   {
    102     os << "<p><img src='" << plot() << "' alt='[svnstat plot]' border=0></p>\n";
     92    return name;
    10393  }
    10494
  • trunk/lib/Stats.h

    r41 r44  
    55
    66#include <map>
     7#include <ostream>
    78#include <string>
    89#include <vector>
     
    3031
    3132    ///
    32     /// @bief print statistics
     33    /// @brief Print statistics
    3334    ///
    34     void print(std::ostream&) const;
     35    void inline print(std::ostream& s) const
     36    { s << "<p><img src='" << plot() << "' alt='[plot]' border=0></p>\n"; }
    3537
    3638    ///
Note: See TracChangeset for help on using the changeset viewer.