Ark Server API (ASA) - Wiki
Loading...
Searching...
No Matches
IFileHandle Class Referenceabstract

#include <GenericPlatformFile.h>

+ Inheritance diagram for IFileHandle:

Public Member Functions

virtual ~IFileHandle ()
 
virtual int64 Tell ()=0
 
virtual bool Seek (int64 NewPosition)=0
 
virtual bool SeekFromEnd (int64 NewPositionRelativeToEnd=0)=0
 
virtual bool Read (uint8 *Destination, int64 BytesToRead)=0
 
virtual bool Write (const uint8 *Source, int64 BytesToWrite)=0
 
virtual bool Flush (const bool bFullFlush=false)=0
 
virtual bool Truncate (int64 NewSize)=0
 
virtual void ShrinkBuffers ()
 
virtual int64 Size ()
 

Detailed Description

File handle interface.

Definition at line 84 of file GenericPlatformFile.h.

Constructor & Destructor Documentation

◆ ~IFileHandle()

virtual IFileHandle::~IFileHandle ( )
inlinevirtual

Destructor, also the only way to close the file handle

Definition at line 88 of file GenericPlatformFile.h.

Member Function Documentation

◆ Flush()

virtual bool IFileHandle::Flush ( const bool bFullFlush = false)
pure virtual

Flushes file handle to disk.

Parameters
bFullFlushtrue 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
Returns
true if operation completed successfully.

Implemented in FCachedFileHandle, FLoggedFileHandle, and FManagedStorageFileWriteHandle.

◆ Read()

virtual bool IFileHandle::Read ( uint8 * Destination,
int64 BytesToRead )
pure virtual

Read bytes from the file.

Parameters
DestinationBuffer to holds the results, should be at least BytesToRead in size.
BytesToReadNumber of bytes to read into the destination.
Returns
true if the operation completed successfully.

Implemented in FCachedFileHandle, FLoggedFileHandle, and FManagedStorageFileWriteHandle.

◆ Seek()

virtual bool IFileHandle::Seek ( int64 NewPosition)
pure virtual

Change the current write or read position.

Parameters
NewPositionnew write or read position
Returns
true if the operation completed successfully.

Implemented in FCachedFileHandle, FLoggedFileHandle, and FManagedStorageFileWriteHandle.

◆ SeekFromEnd()

virtual bool IFileHandle::SeekFromEnd ( int64 NewPositionRelativeToEnd = 0)
pure virtual

Change the current write or read position, relative to the end of the file.

Parameters
NewPositionRelativeToEndnew write or read position, relative to the end of the file should be <=0!
Returns
true if the operation completed successfully.

Implemented in FLoggedFileHandle, FCachedFileHandle, and FManagedStorageFileWriteHandle.

◆ ShrinkBuffers()

virtual void IFileHandle::ShrinkBuffers ( )
inlinevirtual

Minimizes optional system or process cache kept for the file.

Reimplemented in FCachedFileHandle, FLoggedFileHandle, and FManagedStorageFileWriteHandle.

Definition at line 142 of file GenericPlatformFile.h.

◆ Size()

virtual int64 IFileHandle::Size ( )
virtual

Return the total size of the file

Reimplemented in FCachedFileHandle, FLoggedFileHandle, and FManagedStorageFileWriteHandle.

+ Here is the caller graph for this function:

◆ Tell()

virtual int64 IFileHandle::Tell ( )
pure virtual

Return the current write or read position.

Implemented in FCachedFileHandle, FLoggedFileHandle, and FManagedStorageFileWriteHandle.

+ Here is the caller graph for this function:

◆ Truncate()

virtual bool IFileHandle::Truncate ( int64 NewSize)
pure virtual

Truncate the file to the given size (in bytes).

Parameters
NewSizeTruncated file size (in bytes).
Returns
true if the operation completed successfully.

Implemented in FCachedFileHandle, FLoggedFileHandle, and FManagedStorageFileWriteHandle.

◆ Write()

virtual bool IFileHandle::Write ( const uint8 * Source,
int64 BytesToWrite )
pure virtual

Write bytes to the file.

Parameters
SourceBuffer to write, should be at least BytesToWrite in size.
BytesToWriteNumber of bytes to write.
Returns
true if the operation completed successfully.

Implemented in FCachedFileHandle, FLoggedFileHandle, and FManagedStorageFileWriteHandle.


The documentation for this class was generated from the following file: