Ignore:
Timestamp:
Jan 3, 2010, 4:05:25 AM (12 years ago)
Author:
Peter Johansson
Message:

refs #405. Move replicated code to a function

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/html_utility.cc

    r991 r1005  
    44  Copyright (C) 2006 Peter Johansson
    55  Copyright (C) 2007, 2008 Jari Häkkinen, Peter Johansson
    6   Copyright (C) 2009 Peter Johansson
     6  Copyright (C) 2009, 2010 Peter Johansson
    77
    88  This file is part of svndigest, http://dev.thep.lu.se/svndigest
     
    6161
    6262 
     63  std::string image(const std::string& format, const std::string& name)
     64  {
     65    std::ostringstream os;
     66    if (format=="svg")
     67      os << "<object data='" << name << "' type='image/svg+xml' width='600'>\n"
     68         << "<embed src='" << name << "' type='image/svg+xml' width='600' />\n"
     69         << "</object>\n";
     70    else {
     71      assert(false);
     72      throw std::runtime_error("unknown image format: " + format);
     73    }
     74    return os.str();
     75  }
     76
     77
    6378  void print_footer(std::ostream& os)
    6479  {
Note: See TracChangeset for help on using the changeset viewer.