ReXGlue SDK
Loading...
Searching...
No Matches
rex::kernel::IOpenedFile Class Referenceabstract

#include <rex/kernel/object/file_object.h>

Inheritance diagram for rex::kernel::IOpenedFile:
[legend]

Public Member Functions

virtual X_STATUS Read (u32 buffer_address, u32 buffer_length, u64 byte_offset, u32 *out_bytes_read, u32 apc_context, bool notify_completion=true)=0
virtual X_STATUS Write (u32 buffer_address, u32 buffer_length, u64 byte_offset, u32 *out_bytes_written, u32 apc_context)=0
virtual u64 Seek (i64 distance, SeekOrigin origin)=0
virtual X_STATUS SetLengthToPosition ()=0
virtual void SetFindPattern (std::string_view pattern)=0
virtual std::optional< filesystem::FileStat > FindNext ()=0
virtual u64 GetSize ()=0
virtual std::string GetAbsolutePath ()=0

Detailed Description

Interface XAM uses to operate on an open file or directory.

Member Function Documentation

◆ FindNext()

virtual std::optional< filesystem::FileStat > rex::kernel::IOpenedFile::FindNext ( )
pure virtual
Returns
The entry, empty when the listing is exhausted or absent.

Implemented in rex::kernel::FileObject.

◆ Read()

virtual X_STATUS rex::kernel::IOpenedFile::Read ( u32 buffer_address,
u32 buffer_length,
u64 byte_offset,
u32 * out_bytes_read,
u32 apc_context,
bool notify_completion = true )
pure virtual

Reads into guest memory and notifies the IO completion ports of the file.

Parameters
byte_offsetThe file offset, or the maximum value to read at the current position.
out_bytes_readReceives the bytes read, may be null.
apc_contextThe context reported to the completion ports.
notify_completionFalse to skip the completion ports and the async event.

Implemented in rex::kernel::FileObject.

◆ Seek()

virtual u64 rex::kernel::IOpenedFile::Seek ( i64 distance,
SeekOrigin origin )
pure virtual

Moves the position of the file.

Parameters
distanceThe signed byte distance.
originThe origin the distance is measured from.

Implemented in rex::kernel::FileObject.

◆ SetFindPattern()

virtual void rex::kernel::IOpenedFile::SetFindPattern ( std::string_view pattern)
pure virtual

Starts a directory listing.

Parameters
patternThe pattern to match, empty for every entry.

Implemented in rex::kernel::FileObject.

◆ SetLengthToPosition()

virtual X_STATUS rex::kernel::IOpenedFile::SetLengthToPosition ( )
pure virtual

Sets the length of the file to the current position.

Returns
X_STATUS_SUCCESS, or the mapped filesystem error.

Implemented in rex::kernel::FileObject.

◆ Write()

virtual X_STATUS rex::kernel::IOpenedFile::Write ( u32 buffer_address,
u32 buffer_length,
u64 byte_offset,
u32 * out_bytes_written,
u32 apc_context )
pure virtual

Writes from guest memory and notifies the IO completion ports of the file.

Parameters
byte_offsetThe file offset, or the maximum value to write at the current position.
out_bytes_writtenReceives the bytes written, may be null.
apc_contextThe context reported to the completion ports.

Implemented in rex::kernel::FileObject.


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