Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
rtt
os
rtstreams.hpp
Go to the documentation of this file.
1
/***************************************************************************
2
tag: Peter Soetens Thu Oct 10 16:17:00 CEST 2002 rtstreams.hpp
3
4
rtstreams.hpp - description
5
-------------------
6
begin : Thu October 10 2002
7
copyright : (C) 2002 Peter Soetens
8
email : peter.soetens@mech.kuleuven.ac.be
9
10
***************************************************************************
11
* This library is free software; you can redistribute it and/or *
12
* modify it under the terms of the GNU General Public *
13
* License as published by the Free Software Foundation; *
14
* version 2 of the License. *
15
* *
16
* As a special exception, you may use this file as part of a free *
17
* software library without restriction. Specifically, if other files *
18
* instantiate templates or use macros or inline functions from this *
19
* file, or you compile this file and link it with other files to *
20
* produce an executable, this file does not by itself cause the *
21
* resulting executable to be covered by the GNU General Public *
22
* License. This exception does not however invalidate any other *
23
* reasons why the executable file might be covered by the GNU General *
24
* Public License. *
25
* *
26
* This library is distributed in the hope that it will be useful, *
27
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
28
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
29
* Lesser General Public License for more details. *
30
* *
31
* You should have received a copy of the GNU General Public *
32
* License along with this library; if not, write to the Free Software *
33
* Foundation, Inc., 59 Temple Place, *
34
* Suite 330, Boston, MA 02111-1307 USA *
35
* *
36
***************************************************************************/
37
38
#include "
fosi.h
"
39
40
#include "
rtconversions.hpp
"
41
#include "
rtstreambufs.hpp
"
42
43
#ifndef RTSTREAMS_HPP
44
#define RTSTREAMS_HPP
45
56
namespace
RTT
57
{
58
namespace
os
59
{
60
76
class
RTT_API
basic_streams
77
{
78
79
public
:
80
virtual
~
basic_streams
();
81
87
/*
88
virtual void write( const char * c );
89
virtual void write( const char * c, size_t n );
90
virtual void write( const string s );
91
virtual void put( char ch );
92
*/
98
/*
99
virtual string read( int n );
100
virtual string read( char delimiter );
101
virtual char read();
102
*/
103
};
104
113
class
RTT_API
basic_istreams
114
:
virtual
public
basic_streams
115
{
116
117
public
:
118
typedef
streambufs::streamsize
streamsize
;
119
120
basic_istreams
(
streambufs
& s ) : buf(s) {}
121
virtual
~
basic_istreams
();
122
123
int
get
();
124
basic_istreams
&
get
(
char
& c);
125
basic_istreams
&
get
(
char
* c, streamsize n,
char
delim);
126
basic_istreams
&
get
(
char
* c,
char
delim);
127
128
basic_istreams
& read(
char
* c, streamsize n );
129
streamsize readsome(
char
* c, streamsize n);
130
131
132
basic_istreams
&
operator>>
(
int
&i );
133
basic_istreams
&
operator>>
(
char
&c );
134
basic_istreams
&
operator>>
(
double
&f );
135
basic_istreams
&
operator>>
( std::string &s );
136
basic_istreams
&
operator>>
(
unsigned
int
&u );
137
private
:
138
streambufs
&
buf
;
139
};
140
145
class
RTT_API
basic_ostreams
:
virtual
public
basic_streams
146
{
147
148
public
:
149
typedef
streambufs::streamsize
streamsize
;
150
151
basic_ostreams
(
streambufs
& s ) : buf(s) {}
152
virtual
~
basic_ostreams
();
153
154
virtual
basic_ostreams
& put(
char
c );
155
virtual
basic_ostreams
& write(
const
char
* c, streamsize n );
156
161
basic_ostreams
&
operator<<
(
int
i );
162
basic_ostreams
&
operator<<
(
long
i );
163
basic_ostreams
&
operator<<
(
char
c );
164
basic_ostreams
&
operator<<
(
char
* c );
165
basic_ostreams
&
operator<<
(
double
f );
166
basic_ostreams
&
operator<<
( std::string s );
167
basic_ostreams
&
operator<<
(
unsigned
int
u );
168
basic_ostreams
&
operator<<
(
basic_ostreams
& ( *f ) (
basic_ostreams
& ) );
169
private
:
170
streambufs
&
buf
;
171
};
172
173
//#ifdef __KERNEL__
174
// defined in the namespace os
178
basic_ostreams
&
endl
(
basic_ostreams
& );
179
//#endif
180
184
class
RTT_API
basic_iostreams
185
:
public
basic_istreams
,
public
basic_ostreams
186
{
187
public
:
188
basic_iostreams
(
streambufs
& s)
189
:
basic_istreams
(s),
basic_ostreams
(s) {}
190
};
191
192
193
struct
RTT_API
print_helper
{
printbufs
printer
; };
194
200
class
RTT_API
printstream
201
:
private
print_helper
,
public
basic_ostreams
202
{
203
204
public
:
205
printstream
() :
basic_ostreams
(printer) {}
206
virtual
~
printstream
();
207
};
208
212
extern
printstream
cout
;
213
214
struct
RTT_API
string_helper
{
string_helper
() : str() {};
string_helper
(
const
std::string& _init) : str(_init) {};
stringbufs
str; };
215
219
class
RTT_API
stringstreams
220
:
private
string_helper
,
public
basic_iostreams
221
{
222
public
:
223
stringstreams
(
const
std::string& _init) :
string_helper
(_init),
basic_iostreams
(str) {}
224
stringstreams
() :
string_helper
(),
basic_iostreams
(str) {}
225
virtual
~
stringstreams
();
226
};
227
228
}
229
}
230
#endif
RTT::os::printbufs
Definition:
rtstreambufs.hpp:153
RTT::os::string_helper::string_helper
string_helper(const std::string &_init)
Definition:
rtstreams.hpp:214
RTT::os::print_helper::printer
printbufs printer
Definition:
rtstreams.hpp:193
RTT::os::stringstreams::stringstreams
stringstreams(const std::string &_init)
Definition:
rtstreams.hpp:223
RTT::os::basic_ostreams
Definition:
rtstreams.hpp:145
RTT::os::streambufs::streamsize
unsigned int streamsize
Definition:
rtstreambufs.hpp:55
RTT::operator>>
std::istream & operator>>(std::istream &is, BufferPolicy &bp)
Definition:
BufferPolicy.cpp:47
RTT::os::streambufs
Definition:
rtstreambufs.hpp:52
RTT::os::string_helper
Definition:
rtstreams.hpp:214
fosi.h
RTT::os::basic_ostreams::streamsize
streambufs::streamsize streamsize
Definition:
rtstreams.hpp:149
RTT::os::printstream::printstream
printstream()
Definition:
rtstreams.hpp:205
RTT::os::cout
printstream cout
Definition:
rtstreams.cpp:45
RTT::os::stringstreams::stringstreams
stringstreams()
Definition:
rtstreams.hpp:224
RTT::os::basic_iostreams
Definition:
rtstreams.hpp:184
RTT::os::basic_ostreams::basic_ostreams
basic_ostreams(streambufs &s)
Definition:
rtstreams.hpp:151
RTT::os::basic_ostreams::buf
streambufs & buf
Definition:
rtstreams.hpp:170
RTT::os::basic_istreams::streamsize
streambufs::streamsize streamsize
Definition:
rtstreams.hpp:118
RTT::os::endl
basic_ostreams & endl(basic_ostreams &s)
Definition:
rtstreams.cpp:110
RTT::os::basic_istreams::buf
streambufs & buf
Definition:
rtstreams.hpp:138
RTT::os::printstream
Definition:
rtstreams.hpp:200
RTT::operator<<
std::ostream & operator<<(std::ostream &os, const BufferPolicy &bp)
Definition:
BufferPolicy.cpp:34
rtconversions.hpp
RTT::os::basic_iostreams::basic_iostreams
basic_iostreams(streambufs &s)
Definition:
rtstreams.hpp:188
RTT::os::print_helper
Definition:
rtstreams.hpp:193
RTT::os::stringstreams
Definition:
rtstreams.hpp:219
rtstreambufs.hpp
RTT::os::basic_istreams
Definition:
rtstreams.hpp:113
RTT
Contains TaskContext, Activity, OperationCaller, Operation, Property, InputPort, OutputPort, Attribute.
Definition:
Activity.cpp:53
RTT::os::basic_streams
Definition:
rtstreams.hpp:76
RTT::os::stringbufs
Definition:
rtstreambufs.hpp:70
RTT::os::basic_istreams::basic_istreams
basic_istreams(streambufs &s)
Definition:
rtstreams.hpp:120
rtt
Author(s): RTT Developers
autogenerated on Fri Oct 25 2019 03:59:35