Ark Server API (ASA) - Wiki
|
#include <IPlatformFileCachedWrapper.h>
Public Member Functions | |
FCachedFileHandle (IFileHandle *InFileHandle, bool bInReadable, bool bInWritable) | |
virtual | ~FCachedFileHandle () |
virtual int64 | Tell () override |
virtual bool | Seek (int64 NewPosition) override |
virtual bool | SeekFromEnd (int64 NewPositionRelativeToEnd=0) override |
virtual bool | Read (uint8 *Destination, int64 BytesToRead) override |
virtual bool | Write (const uint8 *Source, int64 BytesToWrite) override |
virtual int64 | Size () override |
virtual bool | Flush (const bool bFullFlush=false) override |
virtual bool | Truncate (int64 NewSize) override |
virtual void | ShrinkBuffers () override |
Public Member Functions inherited from IFileHandle | |
virtual | ~IFileHandle () |
Private Member Functions | |
bool | InnerSeek (uint64 Pos) |
bool | InnerRead (uint8 *Dest, uint64 BytesToRead) |
int32 | GetCacheIndex (int64 Pos) const |
void | FlushCache () |
Private Attributes | |
TUniquePtr< IFileHandle > | FileHandle |
int64 | FilePos |
int64 | TellPos |
int64 | FileSize |
bool | bWritable |
bool | bReadable |
uint8 | BufferCache [CacheCount][BufferCacheSize] |
int64 | CacheStart [CacheCount] |
int64 | CacheEnd [CacheCount] |
int32 | CurrentCache |
Static Private Attributes | |
static constexpr uint32 | BufferCacheSize = 64 * 1024 |
static constexpr uint64 | BufferSizeMask = ~((uint64)BufferCacheSize-1) |
static constexpr uint32 | CacheCount = 2 |
Definition at line 21 of file IPlatformFileCachedWrapper.h.
|
inline |
Definition at line 24 of file IPlatformFileCachedWrapper.h.
|
inlinevirtual |
Definition at line 36 of file IPlatformFileCachedWrapper.h.
Flushes file handle to disk.
bFullFlush | true to flush everything about the file (including its meta-data) with a strong guarantee that it will be on disk by the time this function returns, or false to let the operating/file system have more leeway about when the data actually gets written to disk |
Implements IFileHandle.
Definition at line 167 of file IPlatformFileCachedWrapper.h.
|
inlineprivate |
Definition at line 235 of file IPlatformFileCachedWrapper.h.
Definition at line 224 of file IPlatformFileCachedWrapper.h.
Definition at line 215 of file IPlatformFileCachedWrapper.h.
Definition at line 202 of file IPlatformFileCachedWrapper.h.
|
inlineoverridevirtual |
Read bytes from the file.
Destination | Buffer to holds the results, should be at least BytesToRead in size. |
BytesToRead | Number of bytes to read into the destination. |
Implements IFileHandle.
Definition at line 61 of file IPlatformFileCachedWrapper.h.
Change the current write or read position.
NewPosition | new write or read position |
Implements IFileHandle.
Definition at line 46 of file IPlatformFileCachedWrapper.h.
|
inlineoverridevirtual |
Change the current write or read position, relative to the end of the file.
NewPositionRelativeToEnd | new write or read position, relative to the end of the file should be <=0! |
Implements IFileHandle.
Definition at line 56 of file IPlatformFileCachedWrapper.h.
Minimizes optional system or process cache kept for the file.
Reimplemented from IFileHandle.
Definition at line 191 of file IPlatformFileCachedWrapper.h.
Return the total size of the file
Reimplemented from IFileHandle.
Definition at line 162 of file IPlatformFileCachedWrapper.h.
Return the current write or read position.
Implements IFileHandle.
Definition at line 41 of file IPlatformFileCachedWrapper.h.
Truncate the file to the given size (in bytes).
NewSize | Truncated file size (in bytes). |
Implements IFileHandle.
Definition at line 176 of file IPlatformFileCachedWrapper.h.
|
inlineoverridevirtual |
Write bytes to the file.
Source | Buffer to write, should be at least BytesToWrite in size. |
BytesToWrite | Number of bytes to write. |
Implements IFileHandle.
Definition at line 138 of file IPlatformFileCachedWrapper.h.
|
private |
Definition at line 248 of file IPlatformFileCachedWrapper.h.
|
private |
Definition at line 249 of file IPlatformFileCachedWrapper.h.
Definition at line 198 of file IPlatformFileCachedWrapper.h.
|
staticconstexprprivate |
Definition at line 199 of file IPlatformFileCachedWrapper.h.
|
private |
Definition at line 247 of file IPlatformFileCachedWrapper.h.
Definition at line 200 of file IPlatformFileCachedWrapper.h.
|
private |
Definition at line 251 of file IPlatformFileCachedWrapper.h.
|
private |
Definition at line 250 of file IPlatformFileCachedWrapper.h.
|
private |
Definition at line 252 of file IPlatformFileCachedWrapper.h.
|
private |
Definition at line 243 of file IPlatformFileCachedWrapper.h.
|
private |
Definition at line 244 of file IPlatformFileCachedWrapper.h.
|
private |
Definition at line 246 of file IPlatformFileCachedWrapper.h.
|
private |
Definition at line 245 of file IPlatformFileCachedWrapper.h.