Line data Source code
1 : /*
2 : * License:
3 : * Copyright (c) 2013-2019 Made to Order Software Corp. All Rights Reserved
4 : *
5 : * https://snapwebsites.org/
6 : * contact@m2osw.com
7 : *
8 : * This program is free software; you can redistribute it and/or modify
9 : * it under the terms of the GNU General Public License as published by
10 : * the Free Software Foundation; either version 2 of the License, or
11 : * (at your option) any later version.
12 : *
13 : * This program is distributed in the hope that it will be useful,
14 : * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 : * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 : * GNU General Public License for more details.
17 : *
18 : * You should have received a copy of the GNU General Public License along
19 : * with this program; if not, write to the Free Software Foundation, Inc.,
20 : * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
21 : *
22 : * Authors:
23 : * Alexis Wilke alexis@m2osw.com
24 : */
25 : #pragma once
26 :
27 : /** \file
28 : * \brief The buffer appender sends its output to a memory buffer.
29 : *
30 : * This file declares the buffer appender class.
31 : */
32 :
33 : // self
34 : //
35 : #include "snaplogger/appender.h"
36 :
37 :
38 : // C++ lib
39 : //
40 : #include <sstream>
41 :
42 :
43 :
44 : namespace snaplogger
45 : {
46 :
47 :
48 3 : class buffer_appender
49 : : public appender
50 : , public std::stringstream
51 : {
52 : public:
53 : typedef std::shared_ptr<buffer_appender> pointer_t;
54 :
55 : buffer_appender(std::string const name);
56 :
57 : protected:
58 : virtual void process_message(message const & msg, std::string const & formatted_message) override;
59 : };
60 :
61 :
62 : } // snaplogger namespace
63 : // vim: ts=4 sw=4 et
|