mirror of
https://github.com/oatpp/oatpp.git
synced 2025-01-18 16:43:57 +08:00
FIFOBuffer should accept an WriteCallback
/ReadCallback
to its readAndWriteToStream
and readFromStreamAndWrite
functions.
There is no need to specialize on a `Stream`. Its an non-breaking change. Also renaming the functions to `readAndWriteToCallback` and `readFromCallbackAndWrite` would break things.
This commit is contained in:
parent
341812cf29
commit
5d70a226ae
@ -246,7 +246,7 @@ v_io_size FIFOBuffer::write(const void *data, v_buff_size count) {
|
||||
|
||||
}
|
||||
|
||||
v_io_size FIFOBuffer::readAndWriteToStream(data::stream::OutputStream* stream, v_buff_size count, async::Action& action) {
|
||||
v_io_size FIFOBuffer::readAndWriteToStream(data::stream::WriteCallback* stream, v_buff_size count, async::Action& action) {
|
||||
|
||||
if(!m_canRead) {
|
||||
return IOError::RETRY_READ;
|
||||
@ -299,7 +299,7 @@ v_io_size FIFOBuffer::readAndWriteToStream(data::stream::OutputStream* stream, v
|
||||
|
||||
}
|
||||
|
||||
v_io_size FIFOBuffer::readFromStreamAndWrite(data::stream::InputStream* stream, v_buff_size count, async::Action& action) {
|
||||
v_io_size FIFOBuffer::readFromStreamAndWrite(data::stream::ReadCallback* stream, v_buff_size count, async::Action& action) {
|
||||
|
||||
if(m_canRead && m_writePosition == m_readPosition) {
|
||||
return IOError::RETRY_WRITE;
|
||||
|
@ -123,7 +123,7 @@ public:
|
||||
* @param action
|
||||
* @return [1..count], IOErrors.
|
||||
*/
|
||||
v_io_size readAndWriteToStream(data::stream::OutputStream* stream, v_buff_size count, async::Action& action);
|
||||
v_io_size readAndWriteToStream(data::stream::WriteCallback* stream, v_buff_size count, async::Action& action);
|
||||
|
||||
/**
|
||||
* call stream.read() and then write bytes read to buffer
|
||||
@ -132,7 +132,7 @@ public:
|
||||
* @param action
|
||||
* @return
|
||||
*/
|
||||
v_io_size readFromStreamAndWrite(data::stream::InputStream* stream, v_buff_size count, async::Action& action);
|
||||
v_io_size readFromStreamAndWrite(data::stream::ReadCallback* stream, v_buff_size count, async::Action& action);
|
||||
|
||||
/**
|
||||
* flush all availableToRead bytes to stream
|
||||
|
Loading…
Reference in New Issue
Block a user