606 |
20 Apr 08 |
peter |
1 |
#ifndef _theplu_svndigest_html_buf_ |
606 |
20 Apr 08 |
peter |
2 |
#define _theplu_svndigest_html_buf_ |
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 |
234 |
09 Apr 07 |
peter |
9 |
|
687 |
04 Aug 08 |
peter |
This file is part of svndigest, http://dev.thep.lu.se/svndigest |
234 |
09 Apr 07 |
peter |
11 |
|
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 |
16 |
|
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 |
21 |
|
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 |
24 |
*/ |
234 |
09 Apr 07 |
peter |
25 |
|
606 |
20 Apr 08 |
peter |
26 |
#include <cstdio> |
606 |
20 Apr 08 |
peter |
27 |
#include <locale> |
234 |
09 Apr 07 |
peter |
28 |
#include <map> |
606 |
20 Apr 08 |
peter |
29 |
#include <streambuf> |
606 |
20 Apr 08 |
peter |
30 |
#include <string> |
234 |
09 Apr 07 |
peter |
31 |
|
234 |
09 Apr 07 |
peter |
32 |
namespace theplu{ |
234 |
09 Apr 07 |
peter |
33 |
namespace svndigest{ |
234 |
09 Apr 07 |
peter |
34 |
/// |
606 |
20 Apr 08 |
peter |
/// Buffer that translates certain chars to the corresponding string |
606 |
20 Apr 08 |
peter |
/// representing the character in HTML. The class is typically not |
606 |
20 Apr 08 |
peter |
/// used directly but through the convenience class HtmlStream. |
234 |
09 Apr 07 |
peter |
38 |
/// |
606 |
20 Apr 08 |
peter |
39 |
class HtmlBuf : public std::streambuf |
234 |
09 Apr 07 |
peter |
40 |
{ |
234 |
09 Apr 07 |
peter |
41 |
public: |
606 |
20 Apr 08 |
peter |
/// \param buf Buffer output is sent to. |
606 |
20 Apr 08 |
peter |
43 |
HtmlBuf(std::streambuf& buf); |
234 |
09 Apr 07 |
peter |
44 |
|
606 |
20 Apr 08 |
peter |
45 |
typedef std::char_traits<char>::int_type int_type; |
234 |
09 Apr 07 |
peter |
46 |
|
234 |
09 Apr 07 |
peter |
47 |
private: |
606 |
20 Apr 08 |
peter |
// dictionary how to transform chars |
606 |
20 Apr 08 |
peter |
49 |
std::map<char, std::string> map_; |
606 |
20 Apr 08 |
peter |
50 |
std::streambuf& buf_; |
234 |
09 Apr 07 |
peter |
51 |
|
606 |
20 Apr 08 |
peter |
// called from base class |
606 |
20 Apr 08 |
peter |
53 |
int_type overflow (int_type c); |
234 |
09 Apr 07 |
peter |
54 |
}; |
234 |
09 Apr 07 |
peter |
55 |
|
234 |
09 Apr 07 |
peter |
56 |
}} // end of namespace svndigest and namespace theplu |
234 |
09 Apr 07 |
peter |
57 |
|
234 |
09 Apr 07 |
peter |
58 |
#endif |