Changeset 497 for trunk/bin


Ignore:
Timestamp:
Oct 14, 2007, 6:58:06 AM (14 years ago)
Author:
Peter Johansson
Message:

preparing for more statistics by adding StatsType layer in structure on top of previous structure, i.e., NewStructure? = StatsType/OldStructure?

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bin/svndigest.cc

    r487 r497  
    4545#include <unistd.h>
    4646
     47void create_file_struct(std::string stats_type,
     48                        const theplu::svndigest::Stats& stats);
     49
    4750int main(const int argc,const char* argv[])
    4851{
     
    165168    print_css("svndigest.css");
    166169    print_main_page(tree->name(), tree->log(), stats, tree->url());
    167     mkdir("all");
    168     mkdir("images");
    169     touch("all/index.html");
    170     touch("images/index.html");
    171     for (std::set<std::string>::const_iterator i = stats.authors().begin();
    172          i!=stats.authors().end(); ++i) {
    173       mkdir(*i);
    174       touch(std::string(*i+"/index.html"));
    175     }
     170    // create structure StatsType/Author/LineType
     171    create_file_struct("classic/", stats);
    176172    try {
    177173      tree->print(option->verbose());
     
    205201  exit(0);        // normal exit
    206202}
     203
     204  void create_file_struct(std::string stats_type,
     205                          const theplu::svndigest::Stats& stats)
     206  {
     207    using namespace theplu::svndigest;
     208    mkdir(stats_type);
     209    touch(stats_type+std::string("index.html"));
     210    mkdir(stats_type+std::string("all"));
     211    mkdir(stats_type+std::string("images"));
     212    touch(stats_type+std::string("all/index.html"));
     213    touch(stats_type+std::string("images/index.html"));
     214    for (std::set<std::string>::const_iterator i = stats.authors().begin();
     215         i!=stats.authors().end(); ++i) {
     216      mkdir(stats_type+*i);
     217      touch(stats_type+*i+std::string("/index.html"));
     218    }
     219  }
Note: See TracChangeset for help on using the changeset viewer.