Elm  1.0
ELM is a library providing generic data structures, OS-independent interface, plugins and XML.
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
TeeOutStream.h
1 /*
2  * io::TeeOutStream class interface
3  *
4  * This file is part of OTAWA
5  * Copyright (c) 2013, IRIT UPS.
6  *
7  * OTAWA is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation; either version 2 of the License, or
10  * (at your option) any later version.
11  *
12  * OTAWA is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with OTAWA; if not, write to the Free Software
19  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
20  */
21 
22 #ifndef ELM_IO_TEEOUTSTREAM_H_
23 #define ELM_IO_TEEOUTSTREAM_H_
24 
25 #include <elm/io/OutStream.h>
26 
27 namespace elm { namespace io {
28 
29 class TeeOutStream: public OutStream {
30 public:
31  TeeOutStream(OutStream& out1, OutStream& out2);
32  virtual int write (const char *buffer, int size);
33  virtual int flush (void);
34  virtual cstring lastErrorMessage(void);
35 private:
36  OutStream& _out1;
37  OutStream& _out2;
38  enum {
39  OK = 0,
40  OUT1_ERROR,
41  OUT2_ERROR
42  } state;
43 };
44 
45 } } // elm::io
46 
47 #endif /* TEEOUTSTREAM_H_ */
Definition: CString.h:17
Definition: OutStream.h:30
virtual int flush(void)
Definition: io_TeeOutStream.cpp:58
uint32 size
Definition: int.h:41
Definition: TeeOutStream.h:29
TeeOutStream(OutStream &out1, OutStream &out2)
Definition: io_TeeOutStream.cpp:35
virtual cstring lastErrorMessage(void)
Definition: io_TeeOutStream.cpp:75
virtual int write(const char *buffer, int size)
Definition: io_TeeOutStream.cpp:41