Changeset 201 for trunk/lib/Directory.cc


Ignore:
Timestamp:
Sep 9, 2006, 7:36:34 PM (16 years ago)
Author:
Peter Johansson
Message:

fixes #76 and refs #87 new output file structure and draft to new main page.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/Directory.cc

    r199 r201  
    7272          if (S_ISDIR(nodestat.st_mode))       // C api from sys/stat.h
    7373            daughters_.push_back(new Directory(level_+1,fullpath,
    74                                                output_name()+"/"));
     74                                               local_path()+"/"));
    7575          else
    76             daughters_.push_back(new File(level_,fullpath,output_name()+"/"));
     76            daughters_.push_back(new File(level_,fullpath,local_path()+"/"));
    7777          break;
    7878        case SVN::unresolved:
     
    118118
    119119
    120   void Directory::print(const bool verbose) const
     120  void Directory::print(const std::string& out_path, const bool verbose) const
    121121  {
    122     mkdir(output_name());
    123     std::string output(output_name() + "/index.html");
     122    mkdir(out_path);
     123    std::string output(out_path + "/index.html");
    124124    if (verbose)
    125125      std::cout << "Printing output for " << path_ << std::endl;
    126126    std::ofstream os(output.c_str());
    127     print_header(os, name(), level_);
     127    print_header(os, name(), level_+2);
    128128    path_anchor(os);
    129129    os << "<p align=center>\n<img src='"
    130        << file_name(stats_.plot(output_name()+"/index.png", output_name()))
     130       << file_name(stats_.plot(out_path+"/index.png", local_path()))
    131131       << "' alt='[plot]' border=0><br>\n";
    132132    os << "<table class=\"listings\">\n";
     
    176176
    177177    // print daughter nodes, i.e, this function is recursive
    178     std::for_each(daughters_.begin(), daughters_.end(),
    179                   std::bind2nd(std::mem_fun(&Node::print),verbose));
     178    for (NodeConstIterator i=daughters_.begin(); i!=daughters_.end(); ++i)
     179      (*i)->print(out_path+"/"+(*i)->name(), verbose);
    180180  }
    181181
Note: See TracChangeset for help on using the changeset viewer.