13 #include "wvstreamclone.h"
14 #include "wvmoniker.h"
17 #pragma warning(disable : 4073)
29 #if MUTATE_ISNT_BROKEN
30 return mutate<IWvStream>(_obj);
45 my_type(
"WvStreamClone:(none)")
77 if (cloned && !outbuf.
used())
98 if (stop_write && !outbuf.
used())
100 return cloned->
flush(msec_timeout);
115 len = cloned->read(buf, size);
116 if (len == 0 && !cloned->
isok())
130 return cloned->write(buf, size);
159 WvString WvStreamClone::errstr()
const
162 return WvStream::errstr();
164 return cloned->errstr();
165 return "No child stream!";
169 void WvStreamClone::close_callback()
192 if (newclone != NULL)
193 my_type =
WvString(
"WvStreamClone:%s", newclone->wstype());
195 my_type =
"WvStreamClone:(none)";
204 if (cloned && cloned->
isok())
206 if (!si.inherit_request)
208 si.wants.readable |=
static_cast<bool>(readcb);
209 si.wants.writable |=
static_cast<bool>(writecb);
210 si.wants.isexception |=
static_cast<bool>(exceptcb);
213 if (outbuf.
used() || autoclose_time)
214 si.wants.writable =
true;
216 cloned->pre_select(si);
228 bool val, want_write;
233 if (cloned && cloned->
isok())
235 if (!si.inherit_request)
237 si.wants.readable |=
static_cast<bool>(readcb);
238 si.wants.writable |=
static_cast<bool>(writecb);
239 si.wants.isexception |=
static_cast<bool>(exceptcb);
242 val = cloned->post_select(si);
243 want_write = si.wants.writable;
248 if (want_write && outbuf.
used())
257 return val || result;
267 return cloned->src();
275 if (cloned) cloned->callback();
280 WvString ret = WvStream::getattr(name);
281 if (ret.
isnull() && cloned)
282 return cloned->getattr(name);