source: trunk/lib/HtmlStream.h

Last change on this file was 1515, checked in by Peter Johansson, 9 years ago

update copyright years

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 1.8 KB
Line 
1#ifndef _theplu_svndigest_html_stream_
2#define _theplu_svndigest_html_stream_
3
4// $Id: HtmlStream.h 1515 2012-09-26 00:35:10Z peter $
5
6/*
7  Copyright (C) 2007, 2008 Jari Häkkinen, Peter Johansson
8  Copyright (C) 2011, 2012 Peter Johansson
9
10  This file is part of svndigest, http://dev.thep.lu.se/svndigest
11
12  svndigest is free software; you can redistribute it and/or modify it
13  under the terms of the GNU General Public License as published by
14  the Free Software Foundation; either version 3 of the License, or
15  (at your option) any later version.
16
17  svndigest is distributed in the hope that it will be useful, but
18  WITHOUT ANY WARRANTY; without even the implied warranty of
19  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20  General Public License for more details.
21
22  You should have received a copy of the GNU General Public License
23  along with svndigest. If not, see <http://www.gnu.org/licenses/>.
24*/
25
26#include "HtmlBuf.h"
27
28#include <ostream>
29
30namespace theplu{
31namespace svndigest{
32  ///
33  /// \brief Convenient class for using HtmlBuf.
34  ///
35  /// Class is created from another ostream, whose buffer is used to
36  /// create an internal HtmlBuf. In other words, when this class is
37  /// used, typical with operator<<, data is sent to the HtmlBuffer,
38  /// which transforms it as appropriate and sends it further to its
39  /// target buffer. The target buffer is the buffer of the ostream
40  /// this class is created of.
41  ///
42  class HtmlStream : public std::ostream
43  {
44  public:
45    ///
46    /// Creates a HtmlBuf from target.rdbuf().
47    ///
48    HtmlStream(std::ostream& target);
49
50    ///
51    /// @brief Destructor
52    ///
53    ~HtmlStream(void);
54
55    ///
56    /// \return reference to underlying ostream
57    ///
58    std::ostream& stream(void);
59
60  private:
61    ///
62    /// @brief Copy Constructor, not implemented
63    ///
64    HtmlStream(const HtmlStream&);
65
66    HtmlBuf hbuf_;
67    std::ostream& os_;
68  };
69
70}} // end of namespace svndigest and namespace theplu
71
72#endif
Note: See TracBrowser for help on using the repository browser.