Awali
Another Weighted Automata library
null_stream.hxx
Go to the documentation of this file.
1 // This file is part of Awali.
2 // Copyright 2016-2022 Sylvain Lombardy, Victor Marsault, Jacques Sakarovitch
3 //
4 // Awali is a free software: you can redistribute it and/or modify
5 // it under the terms of the GNU General Public License as published by
6 // the Free Software Foundation, either version 3 of the License, or
7 // (at your option) any later version.
8 //
9 // This program is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 // GNU General Public License for more details.
13 //
14 // You should have received a copy of the GNU General Public License
15 // along with this program. If not, see <http://www.gnu.org/licenses/>.
16 
17 #ifndef AWALI_STTC_NULL_STREAM
18 #define AWALI_STTC_NULL_STREAM
19 #include<iostream>
20 
21 class null_buffer_t : public std::streambuf {
22  public:
23  int overflow(int c) {
24  return c;
25  }
26 };
27 class null_stream_t : public std::ostream {
28  public:
29  null_stream_t() : std::ostream(&m_sb) {}
30  private:
31  null_buffer_t m_sb;
32 };
33 
35 
36 #endif
Definition: null_stream.hxx:21
int overflow(int c)
Definition: null_stream.hxx:23
Definition: null_stream.hxx:27
null_stream_t()
Definition: null_stream.hxx:29
null_stream_t null_stream
Definition: null_stream.hxx:34