source: trunk/lib/html_utility.h @ 750

Last change on this file since 750 was 750, checked in by Peter Johansson, 12 years ago

fixes #358

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