1 | #ifndef _theplu_svndigest_html_stream_ |
---|
2 | #define _theplu_svndigest_html_stream_ |
---|
3 | |
---|
4 | // $Id: HtmlStream.h 768 2009-01-31 21:30:37Z peter $ |
---|
5 | |
---|
6 | /* |
---|
7 | Copyright (C) 2007, 2008 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 <map> |
---|
28 | #include <fstream> |
---|
29 | #include <sstream> |
---|
30 | |
---|
31 | namespace theplu{ |
---|
32 | namespace svndigest{ |
---|
33 | /// |
---|
34 | /// \brief Convenient class for using HtmlBuf. |
---|
35 | /// |
---|
36 | /// Class is created from another ostream, whose buffer is used to |
---|
37 | /// create an internal HtmlBuf. In other words, when this class is |
---|
38 | /// used, typical with operator<<, data is sent to the HtmlBuffer, |
---|
39 | /// which transforms it as appropriate and sends it further to its |
---|
40 | /// target buffer. The target buffer is the buffer of the ostream |
---|
41 | /// this class is created of. |
---|
42 | /// |
---|
43 | class HtmlStream : public std::ostream |
---|
44 | { |
---|
45 | public: |
---|
46 | /// |
---|
47 | /// Creates a HtmlBuf from target.rdbuf(). |
---|
48 | /// |
---|
49 | HtmlStream(std::ostream& target); |
---|
50 | |
---|
51 | /// |
---|
52 | /// @brief Destructor |
---|
53 | /// |
---|
54 | ~HtmlStream(void); |
---|
55 | |
---|
56 | /// |
---|
57 | /// \return reference to underlying ostream |
---|
58 | /// |
---|
59 | std::ostream& stream(void); |
---|
60 | |
---|
61 | private: |
---|
62 | /// |
---|
63 | /// @brief Copy Constructor, not implemented |
---|
64 | /// |
---|
65 | HtmlStream(const HtmlStream&); |
---|
66 | |
---|
67 | HtmlBuf hbuf_; |
---|
68 | std::ostream& os_; |
---|
69 | }; |
---|
70 | |
---|
71 | }} // end of namespace svndigest and namespace theplu |
---|
72 | |
---|
73 | #endif |
---|