234 |
09 Apr 07 |
peter |
1 |
#ifndef _theplu_svndigest_html_stream_ |
234 |
09 Apr 07 |
peter |
2 |
#define _theplu_svndigest_html_stream_ |
234 |
09 Apr 07 |
peter |
3 |
|
234 |
09 Apr 07 |
peter |
// $Id$ |
234 |
09 Apr 07 |
peter |
5 |
|
234 |
09 Apr 07 |
peter |
6 |
/* |
1635 |
30 Mar 23 |
peter |
Copyright (C) 2007 Peter Johansson |
1635 |
30 Mar 23 |
peter |
Copyright (C) 2008 Jari Häkkinen, Peter Johansson |
1635 |
30 Mar 23 |
peter |
Copyright (C) 2011 Peter Johansson |
234 |
09 Apr 07 |
peter |
10 |
|
687 |
04 Aug 08 |
peter |
This file is part of svndigest, http://dev.thep.lu.se/svndigest |
234 |
09 Apr 07 |
peter |
12 |
|
234 |
09 Apr 07 |
peter |
svndigest is free software; you can redistribute it and/or modify it |
234 |
09 Apr 07 |
peter |
under the terms of the GNU General Public License as published by |
693 |
11 Sep 08 |
jari |
the Free Software Foundation; either version 3 of the License, or |
234 |
09 Apr 07 |
peter |
(at your option) any later version. |
234 |
09 Apr 07 |
peter |
17 |
|
234 |
09 Apr 07 |
peter |
svndigest is distributed in the hope that it will be useful, but |
234 |
09 Apr 07 |
peter |
WITHOUT ANY WARRANTY; without even the implied warranty of |
234 |
09 Apr 07 |
peter |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
234 |
09 Apr 07 |
peter |
General Public License for more details. |
234 |
09 Apr 07 |
peter |
22 |
|
234 |
09 Apr 07 |
peter |
You should have received a copy of the GNU General Public License |
693 |
11 Sep 08 |
jari |
along with svndigest. If not, see <http://www.gnu.org/licenses/>. |
234 |
09 Apr 07 |
peter |
25 |
*/ |
234 |
09 Apr 07 |
peter |
26 |
|
606 |
20 Apr 08 |
peter |
27 |
#include "HtmlBuf.h" |
606 |
20 Apr 08 |
peter |
28 |
|
1398 |
13 Oct 11 |
peter |
29 |
#include <ostream> |
234 |
09 Apr 07 |
peter |
30 |
|
234 |
09 Apr 07 |
peter |
31 |
namespace theplu{ |
234 |
09 Apr 07 |
peter |
32 |
namespace svndigest{ |
234 |
09 Apr 07 |
peter |
33 |
/// |
1513 |
23 Sep 12 |
peter |
/// \brief Convenient class for using HtmlBuf. |
234 |
09 Apr 07 |
peter |
35 |
/// |
606 |
20 Apr 08 |
peter |
/// Class is created from another ostream, whose buffer is used to |
606 |
20 Apr 08 |
peter |
/// create an internal HtmlBuf. In other words, when this class is |
606 |
20 Apr 08 |
peter |
/// used, typical with operator<<, data is sent to the HtmlBuffer, |
606 |
20 Apr 08 |
peter |
/// which transforms it as appropriate and sends it further to its |
606 |
20 Apr 08 |
peter |
/// target buffer. The target buffer is the buffer of the ostream |
606 |
20 Apr 08 |
peter |
/// this class is created of. |
606 |
20 Apr 08 |
peter |
42 |
/// |
606 |
20 Apr 08 |
peter |
43 |
class HtmlStream : public std::ostream |
234 |
09 Apr 07 |
peter |
44 |
{ |
234 |
09 Apr 07 |
peter |
45 |
public: |
234 |
09 Apr 07 |
peter |
46 |
/// |
606 |
20 Apr 08 |
peter |
/// Creates a HtmlBuf from target.rdbuf(). |
234 |
09 Apr 07 |
peter |
48 |
/// |
606 |
20 Apr 08 |
peter |
49 |
HtmlStream(std::ostream& target); |
234 |
09 Apr 07 |
peter |
50 |
|
234 |
09 Apr 07 |
peter |
51 |
/// |
234 |
09 Apr 07 |
peter |
/// @brief Destructor |
234 |
09 Apr 07 |
peter |
53 |
/// |
234 |
09 Apr 07 |
peter |
54 |
~HtmlStream(void); |
234 |
09 Apr 07 |
peter |
55 |
|
234 |
09 Apr 07 |
peter |
56 |
/// |
286 |
07 May 07 |
peter |
/// \return reference to underlying ostream |
286 |
07 May 07 |
peter |
58 |
/// |
286 |
07 May 07 |
peter |
59 |
std::ostream& stream(void); |
286 |
07 May 07 |
peter |
60 |
|
234 |
09 Apr 07 |
peter |
61 |
private: |
234 |
09 Apr 07 |
peter |
62 |
/// |
234 |
09 Apr 07 |
peter |
/// @brief Copy Constructor, not implemented |
234 |
09 Apr 07 |
peter |
64 |
/// |
234 |
09 Apr 07 |
peter |
65 |
HtmlStream(const HtmlStream&); |
234 |
09 Apr 07 |
peter |
66 |
|
606 |
20 Apr 08 |
peter |
67 |
HtmlBuf hbuf_; |
234 |
09 Apr 07 |
peter |
68 |
std::ostream& os_; |
234 |
09 Apr 07 |
peter |
69 |
}; |
234 |
09 Apr 07 |
peter |
70 |
|
234 |
09 Apr 07 |
peter |
71 |
}} // end of namespace svndigest and namespace theplu |
234 |
09 Apr 07 |
peter |
72 |
|
234 |
09 Apr 07 |
peter |
73 |
#endif |