Reece Wilson
bb9c383aee
[+] IOPipeRequest::uMinBytesToRead [+] (secret api intended for unix users) AuIO::NewLSOSHandleEx [*] Fix quirks when running Gtk under an io processor ...CtxYield shouldn't spin while work (improper breakout on remote update) [*] EFileOpenMode::eWrite should assume O_CREAT semantics making eReadWrite somewhat redundant. OpenWrite + eWrite should reasonably work with file-appends. it should not mean force create + cucked GetLength().
65 lines
2.1 KiB
C++
65 lines
2.1 KiB
C++
/***
|
|
Copyright (C) 2022 J Reece Wilson (a/k/a "Reece"). All rights reserved.
|
|
|
|
File: IOPipeRequest.hpp
|
|
Date: 2022-6-20
|
|
Author: Reece
|
|
***/
|
|
#pragma once
|
|
|
|
namespace Aurora::IO
|
|
{
|
|
struct IIOPipeEventListener;
|
|
|
|
struct IOPipeRequest
|
|
{
|
|
/**
|
|
* @brief Amount of bytes to transfer or zero if run until EoS/EoF
|
|
*/
|
|
AuUInt32 uLengthOrZero {};
|
|
|
|
/**
|
|
* @brief true if the underlying stream uses relative stream positions
|
|
* (IE: a network or pipe stream that cannot seek backwards and fowards)
|
|
* (Inversely, file devices and similar IO subsystems use IO packets with absolute offsets)
|
|
*/
|
|
bool bIsStream {false};
|
|
|
|
/**
|
|
* @brief internal frame size, that is one iteration of file or stream read, in bytes or zero if fallback
|
|
* Windows is inclined to read every single requested byte of a file stream asynchronously
|
|
* Streams, on all platforms, yield as soon as there is data available to copy over (usually)
|
|
*/
|
|
AuUInt32 uPageLengthOrZero {};
|
|
|
|
/**
|
|
* @brief internal buffer size or zero if fallback
|
|
*/
|
|
AuUInt32 uBufferLengthOrZero {};
|
|
|
|
/**
|
|
* @brief event listener
|
|
*/
|
|
AuSPtr<IIOPipeEventListener> pListener;
|
|
|
|
/**
|
|
* @brief Minimum amount of bytes to read from the stream *if not identical to uLengthOrZero*
|
|
*
|
|
* Consider padded streams where only the content itself is read from a given interceptor;
|
|
* adjusting this variable permits for under-reads without failing the pipe transaction.
|
|
*
|
|
* Recommended: 0 -> use uLengthOrZero
|
|
*/
|
|
AuUInt32 uMinBytesToRead {};
|
|
|
|
/**
|
|
* @brief Used as the buffer size for streams of page length 0
|
|
*/
|
|
static const AuUInt32 kFallbackPageSize {1024 * 1024 * 5};
|
|
|
|
/**
|
|
* @brief Used as the buffer size for streams of buffer length 0
|
|
*/
|
|
static const AuUInt32 kFallbackBufferSize {1024 * 1024 * 50};
|
|
};
|
|
} |