2 * @file String_IOStream.h
4 * @author Martin Corino <mcorino@remedy.nl>
7 #ifndef ACE_IOS_STRING_IOSTREAM_H
8 #define ACE_IOS_STRING_IOSTREAM_H
10 #include /**/ "ace/pre.h"
12 #include "ace/INet/INet_Export.h"
13 #include "ace/INet/BufferedStreamBuffer.h"
14 #include "ace/SString.h"
18 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
25 * @class ACE_IOS_String_StreamBuffer
30 template <class ACE_CHAR_T
, class TR
= std::char_traits
<ACE_CHAR_T
> >
31 class String_StreamBufferBase
32 : public BasicBufferedStreamBuffer
<ACE_CHAR_T
, TR
>
35 typedef BasicBufferedStreamBuffer
<ACE_CHAR_T
, TR
> super
;
36 typedef typename
super::char_type char_type
;
37 typedef typename
super::openmode openmode
;
38 typedef ACE_String_Base
<ACE_CHAR_T
> string_type
;
39 typedef typename
string_type::size_type size_type
;
40 typedef typename
super::pos_type pos_type
;
41 typedef typename
super::off_type off_type
;
42 typedef typename
super::seekdir seekdir
;
44 String_StreamBufferBase (openmode mode
);
45 String_StreamBufferBase (string_type
& string
, openmode mode
);
46 virtual ~String_StreamBufferBase ();
48 const string_type
& str () const;
55 virtual int read_from_stream (char_type
* buffer
, std::streamsize length
);
57 virtual int write_to_stream (const char_type
* buffer
, std::streamsize length
);
59 virtual pos_type
seekoff (off_type off
,
63 virtual pos_type
seekpos (pos_type pos
,
73 string_type
* string_ref_
;
78 * @class ACE_IOS_String_IOS
83 template <class ACE_CHAR_T
, class TR
= std::char_traits
<ACE_CHAR_T
> >
85 : public virtual std::basic_ios
<ACE_CHAR_T
, TR
>
88 typedef std::basic_ios
<ACE_CHAR_T
, TR
> ios_base
;
89 typedef String_StreamBufferBase
<ACE_CHAR_T
, TR
> buffer_type
;
90 typedef typename
buffer_type::string_type string_type
;
91 typedef typename
buffer_type::openmode openmode
;
93 String_IOSBase (openmode mode
);
94 String_IOSBase (string_type
& string
, openmode mode
);
97 buffer_type
* rdbuf ();
101 const buffer_type
& stream () const;
104 buffer_type streambuf_
;
108 * @class ACE_IOS_Sock_OStream
113 template <class ACE_CHAR_T
, class TR
= std::char_traits
<ACE_CHAR_T
> >
114 class String_OStreamBase
115 : public String_IOSBase
<ACE_CHAR_T
, TR
>,
116 public std::basic_ostream
<ACE_CHAR_T
, TR
>
119 typedef String_IOSBase
<ACE_CHAR_T
, TR
> ios_base
;
120 typedef typename
ios_base::string_type string_type
;
122 explicit String_OStreamBase();
123 explicit String_OStreamBase(string_type
& string
);
124 ~String_OStreamBase();
126 const string_type
& str () const;
132 * @class ACE_IOS_Sock_IStream
137 template <class ACE_CHAR_T
, class TR
= std::char_traits
<ACE_CHAR_T
> >
138 class String_IStreamBase
139 : public String_IOSBase
<ACE_CHAR_T
, TR
>,
140 public std::basic_istream
<ACE_CHAR_T
, TR
>
143 typedef String_IOSBase
<ACE_CHAR_T
, TR
> ios_base
;
144 typedef typename
ios_base::string_type string_type
;
145 typedef typename
ios_base::buffer_type::pos_type pos_type
;
147 explicit String_IStreamBase();
148 explicit String_IStreamBase(const string_type
& string
);
149 ~String_IStreamBase();
151 String_IStreamBase
& rewind ();
154 typedef String_StreamBufferBase
<char> CString_StreamBuffer
;
155 typedef String_IOSBase
<char> CString_IOS
;
156 typedef String_OStreamBase
<char> CString_OStream
;
157 typedef String_IStreamBase
<char> CString_IStream
;
161 ACE_END_VERSIONED_NAMESPACE_DECL
163 #include "ace/INet/String_IOStream.cpp"
165 #include /**/ "ace/post.h"
166 #endif /* ACE_IOS_STRING_IOSTREAM_H */