Changeset 199


Ignore:
Timestamp:
Sep 9, 2006, 12:42:09 PM (13 years ago)
Author:
Peter Johansson
Message:

refs #87 moved print_header function to html_utility

Location:
trunk/lib
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/Directory.cc

    r198 r199  
    125125      std::cout << "Printing output for " << path_ << std::endl;
    126126    std::ofstream os(output.c_str());
    127     print_header(os);
     127    print_header(os, name(), level_);
     128    path_anchor(os);
    128129    os << "<p align=center>\n<img src='"
    129130       << file_name(stats_.plot(output_name()+"/index.png", output_name()))
  • trunk/lib/File.cc

    r198 r199  
    6565      std::cout << "Printing output for " << path_ << std::endl;
    6666    std::ofstream os(output.c_str());
    67     print_header(os);
     67    print_header(os, name(), level_);
     68    path_anchor(os);
    6869    os << "<p align=center>\n<img src='"
    6970       << file_name(stats_.plot(output_name()+".png",output_name()))
  • trunk/lib/Node.cc

    r185 r199  
    5454  void Node::path_anchor(std::ostream& os) const
    5555  {
     56    os << "<h2 class=\"path\">\n";
    5657    std::vector<std::string> words;
    5758    words.reserve(level_+1);
     
    6667    anchor(os,href(), words.back(), level_+2-words.size(),
    6768           "View " + words.back());
     69    os << "\n</h2>\n";
    6870  }
    6971
     
    103105
    104106
    105   void Node::print_header(std::ostream& os) const
    106   {
    107     os << "<!DOCTYPE html\n"
    108        << "PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\"\n"
    109        << "\"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">\n"
    110        << "<html xmlns=\"http://www.w3.org/1999/xhtml\""
    111        << " xml:lang=\"en\" lang=\"en\"><head>\n"
    112        << "<head>\n"
    113        << "<title> svndigest " << name() << "</title>\n"
    114        << "</head>\n"
    115        << "<link rel=\"stylesheet\" "
    116        << "href=\"";
    117     for (u_int i=0; i<level_; ++i)
    118       os << "../";
    119     os << "svndigest.css\" type=\"text/css\" />\n"
    120        << "<body>\n"
    121        << "<div id=\"menu\">"
    122        << "<ul><li></li>"
    123        << "<li>";
    124     anchor(os, "index.html", "Home", level_, "Main page");
    125     os << "</li>"
    126        << "</ul></div>"
    127        << "<div id=\"main\">\n"
    128        << "<h2 class=\"path\">\n";
    129     path_anchor(os);
    130     os << "\n</h2>\n";
    131   }
    132 
    133107}} // end of namespace svndigest and namespace theplu
  • trunk/lib/Node.h

    r198 r199  
    156156
    157157    ///
     158    /// print path in html format (with anchors) to @a os
     159    ///
     160    void path_anchor(std::ostream& os) const;
     161
     162    ///
    158163    /// @brief print html footer of page
    159164    ///
    160165    void print_footer(std::ostream&) const;
    161166   
    162     ///
    163     /// @brief print html header of page
    164     ///
    165     void print_header(std::ostream&) const;
    166 
    167167    u_int level_;
    168168    std::string output_name_; //without suffix
     
    175175    ///
    176176    Node(const Node&);
    177 
    178     ///
    179     /// print path in html format (with anchors) to @a os
    180     ///
    181     void path_anchor(std::ostream& os) const;
    182177
    183178    bool binary_;
  • trunk/lib/html_utility.cc

    r190 r199  
    177177
    178178
     179  void print_header(std::ostream& os, const std::string& title, u_int level)
     180  {
     181    os << "<!DOCTYPE html\n"
     182       << "PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\"\n"
     183       << "\"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">\n"
     184       << "<html xmlns=\"http://www.w3.org/1999/xhtml\""
     185       << " xml:lang=\"en\" lang=\"en\"><head>\n"
     186       << "<head>\n"
     187       << "<title> svndigest " << title << "</title>\n"
     188       << "</head>\n"
     189       << "<link rel=\"stylesheet\" "
     190       << "href=\"";
     191    for (u_int i=0; i<level; ++i)
     192      os << "../";
     193    os << "svndigest.css\" type=\"text/css\" />\n"
     194       << "<body>\n"
     195       << "<div id=\"menu\">"
     196       << "<ul><li></li>"
     197       << "<li>";
     198    anchor(os, "index.html", "Home", level, "Main page");
     199    os << "</li>"
     200       << "</ul></div>"
     201       << "<div id=\"main\">\n";
     202  }
     203
     204
    179205}} // end of namespace svndigest and namespace theplu
  • trunk/lib/html_utility.h

    r179 r199  
    5656  void print_css(std::ostream& s);
    5757
     58  ///
     59  /// @brief print html header of page
     60  ///
     61  void print_header(std::ostream&, const std::string& name, u_int level);
     62
     63
    5864}} // end of namespace svndigest end of namespace theplu
    5965
Note: See TracChangeset for help on using the changeset viewer.