source: trunk/lib/HtmlStream.h @ 1398

Last change on this file since 1398 was 1398, checked in by Peter Johansson, 10 years ago

improve includes

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