Elm  2
ELM is a library providing generic data structures, OS-independent interface, plugins and XML.
SystemIO.h
1 /*
2  * SystemInStream and SystemOutStream class interfaces
3  *
4  * This file is part of OTAWA
5  * Copyright (c) 2005-12, 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 #ifndef ELM_SYS_SYSTEM_IO_H
22 #define ELM_SYS_SYSTEM_IO_H
23 
24 // Unix system streams
25 #if defined(__unix) || defined(__APPLE__)
26 # include <elm/io/UnixInStream.h>
27 # include <elm/io/UnixOutStream.h>
28 
29  namespace elm { namespace sys {
30 
31  class SystemInStream: public io::UnixInStream {
32  public:
33  SystemInStream(int fd);
34  protected:
35  friend class System;
36  };
37 
38  class SystemOutStream: public io::UnixOutStream {
39  public:
40  SystemOutStream(int fd);
41  protected:
42  friend class System;
43  };
44 
45  } } // elm::sys
46 
47 // Windows system streams
48 #elif defined(__WIN32) || defined(__WIN64)
49 # include <elm/io/WinInStream.h>
50 # include <elm/io/WinOutStream.h>
51 
52  namespace elm { namespace sys {
53 
54  class SystemInStream: public io::WinInStream {
55  protected:
56  friend class System;
57  public:
58  SystemInStream(void* fd);
59  };
60 
61  class SystemOutStream: public io::WinOutStream {
62  protected:
63  friend class System;
64  public:
65  SystemOutStream(void* fd);
66  };
67 
68  } } // elm::sys
69 
70 // unsupported OS
71 #else
72 # error "Unsupported OS !"
73 #endif
74 
75 
76 // Standard Streams
77 namespace elm { namespace io {
78 
79 extern sys::SystemInStream& in;
80 extern sys::SystemOutStream& out;
81 extern sys::SystemOutStream& err;
82 
83 } } // elm::io
84 
85 #endif // ELM_SYS_SYSTEM_IO_H
SystemInStream
elm::io::err
sys::SystemOutStream & err
Definition: system_SystemIO.cpp:128
elm::io::out
sys::SystemOutStream & out
Definition: system_SystemIO.cpp:122
SystemOutStream
elm
Definition: adapter.h:26
elm::io::in
sys::SystemInStream & in
Definition: system_SystemIO.cpp:116