Changeset 101 for trunk/lib/Directory.cc


Ignore:
Timestamp:
Jun 22, 2006, 11:00:06 AM (17 years ago)
Author:
Peter Johansson
Message:

closes #28 #18 and added some lippstick to the node daughters table output

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/Directory.cc

    r100 r101  
    7878        }
    7979      }
     80    daughters_.sort(NodePtrLess());
    8081  }
    8182
     
    8586    for (NodeIterator i=daughters_.begin(); i!=daughters_.end(); i++)
    8687      delete *i;
     88  }
     89
     90  bool Directory::dir(void) const
     91  {
     92    return true;
    8793  }
    8894
     
    112118    print_header(os);
    113119    os << "<p align=center>\n<img src='"
    114        << file_name(stats_.plot(output_name()+"/index.png"))
     120       << file_name(stats_.plot(output_name()+"/index.png", output_name()))
    115121       << "' alt='[plot]' border=0><br>\n";
    116122    os << "<table>\n";
    117     os << "<tr><td><strong>Node</strong></td>\n";
    118     os << "<td><strong>Count</strong></td></tr>\n";
    119     os << "<tr><td>Total</td>\n";
    120     os << "<td align=right>" << stats_.rows() << "</td></tr>\n";
     123    os << "<tr>\n<td><strong>Node</strong></td>\n";
     124    os << "<td><strong>Count</strong></td>\n</tr>\n";
     125    os << "<tr>\n<td bgcolor=#dddddd>Total</td>\n";
     126    os << "<td align=right bgcolor=#dddddd>" << stats_.rows()
     127       << "</td>\n</tr>\n";
     128
    121129    // print html links to daughter nodes
    122     transform(daughters_.begin(), daughters_.end(),
    123               std::ostream_iterator<std::string>(os," "),
    124               std::mem_fun(&Node::html_tablerow));
     130    bool dark=true;
     131    for (NodeConstIterator d = daughters_.begin(); d!=daughters_.end(); d++){
     132      if (dark)
     133        os << (*d)->html_tablerow("#eeeeee");
     134      else
     135        os << (*d)->html_tablerow("#dddddd");
     136      dark = !dark;
     137    }
    125138    os << "</table>\n";
    126     os << "</p>";
     139    os << "</p>\n";
    127140    print_footer(os);
    128141    os.close();
Note: See TracChangeset for help on using the changeset viewer.