CafeContentFileDevice class
Base classes
- class CafeFSAFileDevice
Public types
- enum FileOpenFlag { cFileOpenFlag_ReadOnly = 0, cFileOpenFlag_WriteOnly = 1, cFileOpenFlag_ReadWrite = 2, cFileOpenFlag_Create = 3 }
- enum SeekOrigin { cSeekOrigin_Begin = 0, cSeekOrigin_Current = 1, cSeekOrigin_End = 2 }
- enum class HeapNullOption { AlwaysUseSpecifiedHeap = 0, UseSpecifiedOrContainHeap = 1, DoNotAppendDisposerIfNoHeapSpecified = 2, UseSpecifiedOrCurrentHeap = 3 }
Public static variables
- static const s32 cBufferMinAlignment
Public static functions
- static auto getListNodeOffset() -> u32
Constructors, destructors, conversion operators
- CafeContentFileDevice()
- ~CafeContentFileDevice() virtual
Public functions
- auto doIsAvailable_() const -> bool virtual
- auto doOpen_(FileHandle* handle, const SafeString& path, FileOpenFlag flag) -> FileDevice* virtual
- auto doClose_(FileHandle* handle) -> bool virtual
- auto doRead_(u32* bytesRead, FileHandle* handle, u8* outBuffer, u32 bytesToRead) -> bool virtual
- auto doWrite_(u32* bytesWritten, FileHandle* handle, const u8* inBuffer, u32 bytesToWrite) -> bool virtual
- auto doSeek_(FileHandle* handle, s32 offset, SeekOrigin origin) -> bool virtual
- auto doGetCurrentSeekPos_(u32* seekPos, FileHandle* handle) -> bool virtual
- auto doGetFileSize_(u32* fileSize, const SafeString& path) -> bool virtual
- auto doGetFileSize_(u32* fileSize, FileHandle* handle) -> bool virtual
- auto doIsExistFile_(bool* exists, const SafeString& path) -> bool virtual
- auto doIsExistDirectory_(bool* exists, const SafeString& path) -> bool virtual
- auto doOpenDirectory_(DirectoryHandle* handle, const SafeString& path) -> FileDevice* virtual
- auto doCloseDirectory_(DirectoryHandle* handle) -> bool virtual
- auto doReadDirectory_(u32* entriesRead, DirectoryHandle* handle, DirectoryEntry* entries, u32 entriesToRead) -> bool virtual
- auto doMakeDirectory_(const SafeString& path, u32) -> bool virtual
- auto doGetLastRawError_() const -> s32 virtual
- void doResolvePath_(BufferedSafeString* out, const SafeString& path) const virtual
- void formatPathForFSA_(BufferedSafeString* out, const SafeString& path) const virtual
- auto getUsableFSClient_() const -> FSClient*
- auto getFileHandleInner_(FileHandle* handle) -> FSFileHandle*
- auto getDirHandleInner_(DirectoryHandle* handle) -> FSDirHandle*
- auto getDriveName() const -> const SafeString&
- void setDriveName(const SafeString& name)
- auto hasPermission() const -> bool
- void setHasPermission(bool perm)
- auto isAvailable() const -> bool
- auto tryLoad(LoadArg& arg) -> u8*
- auto save(SaveArg& arg) -> bool
- auto trySave(SaveArg& arg) -> bool
- auto open(FileHandle* handle, const SafeString& path, FileOpenFlag flag, u32 divSize = 0) -> FileDevice*
- auto tryOpen(FileHandle* handle, const SafeString& path, FileOpenFlag flag, u32 divSize = 0) -> FileDevice*
- auto close(FileHandle* handle) -> bool
- auto tryClose(FileHandle* handle) -> bool
- auto flush(FileHandle* handle) -> bool
- auto tryFlush(FileHandle* handle) -> bool
- auto remove(const SafeString& str) -> bool
- auto tryRemove(const SafeString& str) -> bool
- auto read(FileHandle* handle, u8* data, u32 size) -> u32
- auto tryRead(u32* bytesRead, FileHandle* handle, u8* outBuffer, u32 bytesToRead) -> bool
- auto write(FileHandle* handle, const u8* data, u32 size) -> u32
- auto tryWrite(u32* bytesWritten, FileHandle* handle, const u8* inBuffer, u32 bytesToWrite) -> bool
- auto seek(FileHandle* handle, s32 offset, SeekOrigin origin) -> bool
- auto trySeek(FileHandle* handle, s32 offset, SeekOrigin origin) -> bool
- auto getCurrentSeekPos(FileHandle* handle) -> u32
- auto tryGetCurrentSeekPos(u32* seekPos, FileHandle* handle) -> bool
- auto getFileSize(const SafeString& path) -> u32
- auto getFileSize(FileHandle* handle) -> u32
- auto tryGetFileSize(u32* fileSize, const SafeString& path) -> bool
- auto tryGetFileSize(u32* size, FileHandle* handle) -> bool
- auto isExistFile(const SafeString& path) -> bool
- auto tryIsExistFile(bool* exists, const SafeString& path) -> bool
- auto isExistDirectory(const SafeString& path) -> bool
- auto tryIsExistDirectory(bool* exists, const SafeString& path) -> bool
- auto openDirectory(DirectoryHandle* handle, const SafeString& path) -> FileDevice*
- auto tryOpenDirectory(DirectoryHandle* handle, const SafeString& path) -> FileDevice*
- auto closeDirectory(DirectoryHandle* handle) -> bool
- auto tryCloseDirectory(DirectoryHandle* handle) -> bool
- auto readDirectory(DirectoryHandle* handle, DirectoryEntry* entries, u32 num_entries) -> u32
- auto tryReadDirectory(u32* entriesRead, DirectoryHandle* handle, DirectoryEntry* entries, u32 entriesToRead) -> bool
- auto makeDirectory(const SafeString& path, u32 x) -> bool
- auto tryMakeDirectory(const SafeString& path, u32) -> bool
- auto makeDirectoryWithParent(const SafeString& path, u32 x) -> bool
- auto tryMakeDirectoryWithParent(const SafeString& path, u32) -> bool
- auto getLastRawError() const -> s32
- void traceFilePath(const SafeString& path) const virtual
- void traceDirectoryPath(const SafeString& path) const virtual
- void resolveFilePath(BufferedSafeString* out, const SafeString& path) const virtual
- void resolveDirectoryPath(BufferedSafeString* out, const SafeString& path) const virtual
- auto isMatchDevice_(const HandleBase* handle) const -> bool virtual
- void erase()
Public variables
- const char* devicePath
- FSStatus status
- FSRetFlag openErrHandling
- FSRetFlag closeErrHandling
- FSRetFlag readErrHandling
- FSClient* client
- FileDevice* mData
- TList<FileDevice*>* mList
Protected functions
- auto doLoad_(LoadArg& arg) -> u8* virtual
- auto doSave_(SaveArg& arg) -> bool virtual
- auto doFlush_(FileHandle* handle) -> bool pure virtual
- auto doRemove_(const SafeString& str) -> bool pure virtual
- void doTracePath_(const SafeString& path) const virtual
- void setFileHandleDivSize_(FileHandle* handle, u32 divSize) const
- void setHandleBaseFileDevice_(HandleBase* handle, FileDevice* device) const
- void setHandleBaseOriginalFileDevice_(HandleBase* handle, FileDevice* device) const
- auto getHandleBaseHandleBuffer_(HandleBase* handle) const -> HandleBuffer&
- auto getDisposerHeap_() const -> Heap*
Protected variables
- FixedSafeString<32> mDriveName
- bool mPermission
Enum documentation
enum sead:: CafeContentFileDevice:: FileOpenFlag
#include <filedevice/seadFileDevice.h>
enum sead:: CafeContentFileDevice:: SeekOrigin
#include <filedevice/seadFileDevice.h>
enum class sead:: CafeContentFileDevice:: HeapNullOption
#include <heap/seadDisposer.h>
Function documentation
static u32 sead:: CafeContentFileDevice:: getListNodeOffset()
#include <heap/seadDisposer.h>
const SafeString& sead:: CafeContentFileDevice:: getDriveName() const
#include <filedevice/seadFileDevice.h>
void sead:: CafeContentFileDevice:: setDriveName(const SafeString& name)
#include <filedevice/seadFileDevice.h>
bool sead:: CafeContentFileDevice:: hasPermission() const
#include <filedevice/seadFileDevice.h>
void sead:: CafeContentFileDevice:: setHasPermission(bool perm)
#include <filedevice/seadFileDevice.h>
bool sead:: CafeContentFileDevice:: isAvailable() const
#include <filedevice/seadFileDevice.h>
u8* sead:: CafeContentFileDevice:: tryLoad(LoadArg& arg)
#include <filedevice/seadFileDevice.h>
bool sead:: CafeContentFileDevice:: save(SaveArg& arg)
#include <filedevice/seadFileDevice.h>
bool sead:: CafeContentFileDevice:: trySave(SaveArg& arg)
#include <filedevice/seadFileDevice.h>
FileDevice* sead:: CafeContentFileDevice:: open(FileHandle* handle,
const SafeString& path,
FileOpenFlag flag,
u32 divSize = 0)
#include <filedevice/seadFileDevice.h>
FileDevice* sead:: CafeContentFileDevice:: tryOpen(FileHandle* handle,
const SafeString& path,
FileOpenFlag flag,
u32 divSize = 0)
#include <filedevice/seadFileDevice.h>
bool sead:: CafeContentFileDevice:: close(FileHandle* handle)
#include <filedevice/seadFileDevice.h>
bool sead:: CafeContentFileDevice:: tryClose(FileHandle* handle)
#include <filedevice/seadFileDevice.h>
bool sead:: CafeContentFileDevice:: flush(FileHandle* handle)
#include <filedevice/seadFileDevice.h>
bool sead:: CafeContentFileDevice:: tryFlush(FileHandle* handle)
#include <filedevice/seadFileDevice.h>
bool sead:: CafeContentFileDevice:: remove(const SafeString& str)
#include <filedevice/seadFileDevice.h>
bool sead:: CafeContentFileDevice:: tryRemove(const SafeString& str)
#include <filedevice/seadFileDevice.h>
u32 sead:: CafeContentFileDevice:: read(FileHandle* handle,
u8* data,
u32 size)
#include <filedevice/seadFileDevice.h>
bool sead:: CafeContentFileDevice:: tryRead(u32* bytesRead,
FileHandle* handle,
u8* outBuffer,
u32 bytesToRead)
#include <filedevice/seadFileDevice.h>
u32 sead:: CafeContentFileDevice:: write(FileHandle* handle,
const u8* data,
u32 size)
#include <filedevice/seadFileDevice.h>
bool sead:: CafeContentFileDevice:: tryWrite(u32* bytesWritten,
FileHandle* handle,
const u8* inBuffer,
u32 bytesToWrite)
#include <filedevice/seadFileDevice.h>
bool sead:: CafeContentFileDevice:: seek(FileHandle* handle,
s32 offset,
SeekOrigin origin)
#include <filedevice/seadFileDevice.h>
bool sead:: CafeContentFileDevice:: trySeek(FileHandle* handle,
s32 offset,
SeekOrigin origin)
#include <filedevice/seadFileDevice.h>
u32 sead:: CafeContentFileDevice:: getCurrentSeekPos(FileHandle* handle)
#include <filedevice/seadFileDevice.h>
bool sead:: CafeContentFileDevice:: tryGetCurrentSeekPos(u32* seekPos,
FileHandle* handle)
#include <filedevice/seadFileDevice.h>
u32 sead:: CafeContentFileDevice:: getFileSize(const SafeString& path)
#include <filedevice/seadFileDevice.h>
u32 sead:: CafeContentFileDevice:: getFileSize(FileHandle* handle)
#include <filedevice/seadFileDevice.h>
bool sead:: CafeContentFileDevice:: tryGetFileSize(u32* fileSize,
const SafeString& path)
#include <filedevice/seadFileDevice.h>
bool sead:: CafeContentFileDevice:: tryGetFileSize(u32* size,
FileHandle* handle)
#include <filedevice/seadFileDevice.h>
bool sead:: CafeContentFileDevice:: isExistFile(const SafeString& path)
#include <filedevice/seadFileDevice.h>
bool sead:: CafeContentFileDevice:: tryIsExistFile(bool* exists,
const SafeString& path)
#include <filedevice/seadFileDevice.h>
bool sead:: CafeContentFileDevice:: isExistDirectory(const SafeString& path)
#include <filedevice/seadFileDevice.h>
bool sead:: CafeContentFileDevice:: tryIsExistDirectory(bool* exists,
const SafeString& path)
#include <filedevice/seadFileDevice.h>
FileDevice* sead:: CafeContentFileDevice:: openDirectory(DirectoryHandle* handle,
const SafeString& path)
#include <filedevice/seadFileDevice.h>
FileDevice* sead:: CafeContentFileDevice:: tryOpenDirectory(DirectoryHandle* handle,
const SafeString& path)
#include <filedevice/seadFileDevice.h>
bool sead:: CafeContentFileDevice:: closeDirectory(DirectoryHandle* handle)
#include <filedevice/seadFileDevice.h>
bool sead:: CafeContentFileDevice:: tryCloseDirectory(DirectoryHandle* handle)
#include <filedevice/seadFileDevice.h>
u32 sead:: CafeContentFileDevice:: readDirectory(DirectoryHandle* handle,
DirectoryEntry* entries,
u32 num_entries)
#include <filedevice/seadFileDevice.h>
bool sead:: CafeContentFileDevice:: tryReadDirectory(u32* entriesRead,
DirectoryHandle* handle,
DirectoryEntry* entries,
u32 entriesToRead)
#include <filedevice/seadFileDevice.h>
bool sead:: CafeContentFileDevice:: makeDirectory(const SafeString& path,
u32 x)
#include <filedevice/seadFileDevice.h>
bool sead:: CafeContentFileDevice:: tryMakeDirectory(const SafeString& path,
u32)
#include <filedevice/seadFileDevice.h>
bool sead:: CafeContentFileDevice:: makeDirectoryWithParent(const SafeString& path,
u32 x)
#include <filedevice/seadFileDevice.h>
bool sead:: CafeContentFileDevice:: tryMakeDirectoryWithParent(const SafeString& path,
u32)
#include <filedevice/seadFileDevice.h>
s32 sead:: CafeContentFileDevice:: getLastRawError() const
#include <filedevice/seadFileDevice.h>
void sead:: CafeContentFileDevice:: traceFilePath(const SafeString& path) const virtual
#include <filedevice/seadFileDevice.h>
void sead:: CafeContentFileDevice:: traceDirectoryPath(const SafeString& path) const virtual
#include <filedevice/seadFileDevice.h>
void sead:: CafeContentFileDevice:: resolveFilePath(BufferedSafeString* out,
const SafeString& path) const virtual
#include <filedevice/seadFileDevice.h>
void sead:: CafeContentFileDevice:: resolveDirectoryPath(BufferedSafeString* out,
const SafeString& path) const virtual
#include <filedevice/seadFileDevice.h>
bool sead:: CafeContentFileDevice:: isMatchDevice_(const HandleBase* handle) const virtual
#include <filedevice/seadFileDevice.h>
void sead:: CafeContentFileDevice:: erase()
#include <container/seadTList.h>
u8* sead:: CafeContentFileDevice:: doLoad_(LoadArg& arg) virtual protected
#include <filedevice/seadFileDevice.h>
bool sead:: CafeContentFileDevice:: doSave_(SaveArg& arg) virtual protected
#include <filedevice/seadFileDevice.h>
bool sead:: CafeContentFileDevice:: doFlush_(FileHandle* handle) pure virtual protected
#include <filedevice/seadFileDevice.h>
bool sead:: CafeContentFileDevice:: doRemove_(const SafeString& str) pure virtual protected
#include <filedevice/seadFileDevice.h>
void sead:: CafeContentFileDevice:: doTracePath_(const SafeString& path) const virtual protected
#include <filedevice/seadFileDevice.h>
void sead:: CafeContentFileDevice:: setFileHandleDivSize_(FileHandle* handle,
u32 divSize) const protected
#include <filedevice/seadFileDevice.h>
void sead:: CafeContentFileDevice:: setHandleBaseFileDevice_(HandleBase* handle,
FileDevice* device) const protected
#include <filedevice/seadFileDevice.h>
void sead:: CafeContentFileDevice:: setHandleBaseOriginalFileDevice_(HandleBase* handle,
FileDevice* device) const protected
#include <filedevice/seadFileDevice.h>
HandleBuffer& sead:: CafeContentFileDevice:: getHandleBaseHandleBuffer_(HandleBase* handle) const protected
#include <filedevice/seadFileDevice.h>
Heap* sead:: CafeContentFileDevice:: getDisposerHeap_() const protected
#include <heap/seadDisposer.h>
Variable documentation
static const s32 sead:: CafeContentFileDevice:: cBufferMinAlignment
#include <filedevice/seadFileDevice.h>
FileDevice* sead:: CafeContentFileDevice:: mData
#include <container/seadTList.h>
TList<FileDevice*>* sead:: CafeContentFileDevice:: mList
#include <container/seadTList.h>
FixedSafeString<32> sead:: CafeContentFileDevice:: mDriveName protected
#include <filedevice/seadFileDevice.h>
bool sead:: CafeContentFileDevice:: mPermission protected
#include <filedevice/seadFileDevice.h>