source: trunk/lib/HtmlBuf.h @ 847

Last change on this file since 847 was 847, checked in by Peter Johansson, 12 years ago

updating copyrights

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 1.5 KB
RevLine 
[606]1#ifndef _theplu_svndigest_html_buf_
2#define _theplu_svndigest_html_buf_
[234]3
4// $Id: HtmlBuf.h 847 2009-11-17 01:38:52Z peter $
5
6/*
[847]7  Copyright (C) 2007, 2008 Jari Häkkinen, Peter Johansson
[234]8
[687]9  This file is part of svndigest, http://dev.thep.lu.se/svndigest
[234]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
[693]13  the Free Software Foundation; either version 3 of the License, or
[234]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
[693]22  along with svndigest. If not, see <http://www.gnu.org/licenses/>.
[234]23*/
24
[606]25#include <cstdio>
26#include <locale>
[234]27#include <map>
[606]28#include <streambuf>
29#include <string>
[234]30
31namespace theplu{
32namespace svndigest{
33  ///
[606]34  /// Buffer that translates certain chars to the corresponding string
35  /// representing the character in HTML. The class is typically not
36  /// used directly but through the convenience class HtmlStream.
[234]37  ///
[606]38  class HtmlBuf : public std::streambuf
[234]39  {
40  public:
[606]41    /// \param buf Buffer output is sent to.
42    HtmlBuf(std::streambuf& buf);
[234]43
[606]44    typedef std::char_traits<char>::int_type int_type;
[234]45
46  private:
[606]47    // dictionary how to transform chars
48    std::map<char, std::string> map_;
49    std::streambuf& buf_;
[234]50
[606]51    // called from base class
52    int_type overflow (int_type c);
[234]53  };
54
55}} // end of namespace svndigest and namespace theplu
56
57#endif
Note: See TracBrowser for help on using the repository browser.