source: trunk/lib/html_utility.h

Last change on this file was 1537, checked in by Peter Johansson, 11 years ago

refs #334. Implement option --update for files

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 2.6 KB
Line 
1#ifndef _theplu_svndigest_html_utility_
2#define _theplu_svndigest_html_utility_
3
4// $Id: html_utility.h 1537 2012-10-07 07:37:33Z peter $
5
6/*
7  Copyright (C) 2006 Peter Johansson
8  Copyright (C) 2007, 2008 Jari Häkkinen, Peter Johansson
9  Copyright (C) 2009, 2010, 2012 Peter Johansson
10
11  This file is part of svndigest, http://dev.thep.lu.se/svndigest
12
13  svndigest is free software; you can redistribute it and/or modify it
14  under the terms of the GNU General Public License as published by
15  the Free Software Foundation; either version 3 of the License, or
16  (at your option) any later version.
17
18  svndigest is distributed in the hope that it will be useful, but
19  WITHOUT ANY WARRANTY; without even the implied warranty of
20  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
21  General Public License for more details.
22
23  You should have received a copy of the GNU General Public License
24  along with svndigest. If not, see <http://www.gnu.org/licenses/>.
25*/
26
27#include <fstream>
28#include <iosfwd>
29#include <string>
30#include <vector>
31
32#include <subversion-1/svn_types.h>
33
34namespace theplu{
35namespace svndigest{
36
37  ///
38  /// @brief create anchor
39  ///
40  /// @param url address to link to
41  /// @param name text visible on page
42  /// @param level '../' is added @a level times before @a href
43  /// @param title title of anchor
44  ///
45  std::string anchor(const std::string& url,
46                     const std::string& name, unsigned int level=0,
47                     const std::string& title="",
48                     const std::string& color="");
49
50  /**
51   */
52  std::string image(const std::string& name);
53
54  ///
55  /// @Brief print html footer of page
56  ///
57  void print_footer(std::ostream&);
58
59  ///
60  /// @brief print html header of page
61  ///
62  /// \param os stream to print to
63  /// \param name
64  /// \param level
65  /// \param user
66  /// \param item total, code, comment, or other
67  /// \param path current path
68  /// \param stats which stats are we in
69  /// \param rev revision output page reflects
70  ///
71  void print_header(std::ostream& os, std::string name, unsigned int level,
72                    std::string user, std::string item, std::string path,
73                    const std::string& stats, svn_revnum_t rev=0);
74
75
76  /**
77     \brief print html start
78
79     Just like print_header, this function outputs start of html page,
80     but in contrast to print_header there are no menus in the otput
81     of this function.
82   */
83  void print_html_start(std::ostream& os, const std::string& title,
84                        unsigned int level, svn_revnum_t rev=0);
85
86
87  ///
88  /// @return if trac-revision is set in config file anchor to trac is
89  /// given otherwise just a string corresponding to passed parameter.
90  ///
91  std::string trac_revision(svn_revnum_t, std::string color="");
92
93}} // end of namespace svndigest end of namespace theplu
94
95#endif
Note: See TracBrowser for help on using the repository browser.