NinContentFileDevice class
Base classes
- class NinFileDeviceBase
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
Public functions
- 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
Protected functions
- auto doIsAvailable_() const -> bool override
- auto doOpen_(FileHandle* handle, const SafeString& path, FileOpenFlag flag) -> FileDevice* override
- auto doClose_(FileHandle* handle) -> bool override
- auto doFlush_(FileHandle* handle) -> bool override
- auto doRemove_(const SafeString& path) -> bool override
- auto doRead_(u32* bytesRead, FileHandle* handle, u8* outBuffer, u32 bytesToRead) -> bool override
- auto doWrite_(u32* bytesWritten, FileHandle* handle, const u8* inBuffer, u32 bytesToWrite) -> bool override
- auto doSeek_(FileHandle* handle, s32 offset, SeekOrigin origin) -> bool override
- auto doGetCurrentSeekPos_(u32* seekPos, FileHandle* handle) -> bool override
- auto doGetFileSize_(u32* fileSize, const SafeString& path) -> bool override
- auto doGetFileSize_(u32* fileSize, FileHandle* handle) -> bool override
- auto doIsExistFile_(bool* exists, const SafeString& path) -> bool override
- auto doIsExistDirectory_(bool* exists, const SafeString& path) -> bool override
- auto doOpenDirectory_(DirectoryHandle* handle, const SafeString& path) -> FileDevice* override
- auto doCloseDirectory_(DirectoryHandle* handle) -> bool override
- auto doReadDirectory_(u32* entriesRead, DirectoryHandle* handle, DirectoryEntry* entries, u32 entriesToRead) -> bool override
- auto doMakeDirectory_(const SafeString& path, u32 u_32) -> bool override
- auto doGetLastRawError_() const -> s32 override
- void doResolvePath_(BufferedSafeString* out, const SafeString& path) const override
- auto formatPathForFS_(BufferedSafeString* out, const SafeString& path) const -> bool virtual
- auto getFileHandleInner_(HandleBase* handle, bool construct = false) const -> FileHandleInner*
- auto getDirectoryHandleInner_(HandleBase* handle, bool construct = false) const -> DirectoryHandleInner*
- auto doLoad_(LoadArg& arg) -> u8* virtual
- auto doSave_(SaveArg& arg) -> bool 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
Enum documentation
enum sead:: NinContentFileDevice:: FileOpenFlag
#include <filedevice/seadFileDevice.h>
enum sead:: NinContentFileDevice:: SeekOrigin
#include <filedevice/seadFileDevice.h>
enum class sead:: NinContentFileDevice:: HeapNullOption
#include <heap/seadDisposer.h>
Function documentation
static u32 sead:: NinContentFileDevice:: getListNodeOffset()
#include <heap/seadDisposer.h>
const SafeString& sead:: NinContentFileDevice:: getDriveName() const
#include <filedevice/seadFileDevice.h>
void sead:: NinContentFileDevice:: setDriveName(const SafeString& name)
#include <filedevice/seadFileDevice.h>
bool sead:: NinContentFileDevice:: hasPermission() const
#include <filedevice/seadFileDevice.h>
void sead:: NinContentFileDevice:: setHasPermission(bool perm)
#include <filedevice/seadFileDevice.h>
bool sead:: NinContentFileDevice:: isAvailable() const
#include <filedevice/seadFileDevice.h>
u8* sead:: NinContentFileDevice:: tryLoad(LoadArg& arg)
#include <filedevice/seadFileDevice.h>
bool sead:: NinContentFileDevice:: save(SaveArg& arg)
#include <filedevice/seadFileDevice.h>
bool sead:: NinContentFileDevice:: trySave(SaveArg& arg)
#include <filedevice/seadFileDevice.h>
FileDevice* sead:: NinContentFileDevice:: open(FileHandle* handle,
const SafeString& path,
FileOpenFlag flag,
u32 divSize = 0)
#include <filedevice/seadFileDevice.h>
FileDevice* sead:: NinContentFileDevice:: tryOpen(FileHandle* handle,
const SafeString& path,
FileOpenFlag flag,
u32 divSize = 0)
#include <filedevice/seadFileDevice.h>
bool sead:: NinContentFileDevice:: close(FileHandle* handle)
#include <filedevice/seadFileDevice.h>
bool sead:: NinContentFileDevice:: tryClose(FileHandle* handle)
#include <filedevice/seadFileDevice.h>
bool sead:: NinContentFileDevice:: flush(FileHandle* handle)
#include <filedevice/seadFileDevice.h>
bool sead:: NinContentFileDevice:: tryFlush(FileHandle* handle)
#include <filedevice/seadFileDevice.h>
bool sead:: NinContentFileDevice:: remove(const SafeString& str)
#include <filedevice/seadFileDevice.h>
bool sead:: NinContentFileDevice:: tryRemove(const SafeString& str)
#include <filedevice/seadFileDevice.h>
u32 sead:: NinContentFileDevice:: read(FileHandle* handle,
u8* data,
u32 size)
#include <filedevice/seadFileDevice.h>
bool sead:: NinContentFileDevice:: tryRead(u32* bytesRead,
FileHandle* handle,
u8* outBuffer,
u32 bytesToRead)
#include <filedevice/seadFileDevice.h>
u32 sead:: NinContentFileDevice:: write(FileHandle* handle,
const u8* data,
u32 size)
#include <filedevice/seadFileDevice.h>
bool sead:: NinContentFileDevice:: tryWrite(u32* bytesWritten,
FileHandle* handle,
const u8* inBuffer,
u32 bytesToWrite)
#include <filedevice/seadFileDevice.h>
bool sead:: NinContentFileDevice:: seek(FileHandle* handle,
s32 offset,
SeekOrigin origin)
#include <filedevice/seadFileDevice.h>
bool sead:: NinContentFileDevice:: trySeek(FileHandle* handle,
s32 offset,
SeekOrigin origin)
#include <filedevice/seadFileDevice.h>
u32 sead:: NinContentFileDevice:: getCurrentSeekPos(FileHandle* handle)
#include <filedevice/seadFileDevice.h>
bool sead:: NinContentFileDevice:: tryGetCurrentSeekPos(u32* seekPos,
FileHandle* handle)
#include <filedevice/seadFileDevice.h>
u32 sead:: NinContentFileDevice:: getFileSize(const SafeString& path)
#include <filedevice/seadFileDevice.h>
u32 sead:: NinContentFileDevice:: getFileSize(FileHandle* handle)
#include <filedevice/seadFileDevice.h>
bool sead:: NinContentFileDevice:: tryGetFileSize(u32* fileSize,
const SafeString& path)
#include <filedevice/seadFileDevice.h>
bool sead:: NinContentFileDevice:: tryGetFileSize(u32* size,
FileHandle* handle)
#include <filedevice/seadFileDevice.h>
bool sead:: NinContentFileDevice:: isExistFile(const SafeString& path)
#include <filedevice/seadFileDevice.h>
bool sead:: NinContentFileDevice:: tryIsExistFile(bool* exists,
const SafeString& path)
#include <filedevice/seadFileDevice.h>
bool sead:: NinContentFileDevice:: isExistDirectory(const SafeString& path)
#include <filedevice/seadFileDevice.h>
bool sead:: NinContentFileDevice:: tryIsExistDirectory(bool* exists,
const SafeString& path)
#include <filedevice/seadFileDevice.h>
FileDevice* sead:: NinContentFileDevice:: openDirectory(DirectoryHandle* handle,
const SafeString& path)
#include <filedevice/seadFileDevice.h>
FileDevice* sead:: NinContentFileDevice:: tryOpenDirectory(DirectoryHandle* handle,
const SafeString& path)
#include <filedevice/seadFileDevice.h>
bool sead:: NinContentFileDevice:: closeDirectory(DirectoryHandle* handle)
#include <filedevice/seadFileDevice.h>
bool sead:: NinContentFileDevice:: tryCloseDirectory(DirectoryHandle* handle)
#include <filedevice/seadFileDevice.h>
u32 sead:: NinContentFileDevice:: readDirectory(DirectoryHandle* handle,
DirectoryEntry* entries,
u32 num_entries)
#include <filedevice/seadFileDevice.h>
bool sead:: NinContentFileDevice:: tryReadDirectory(u32* entriesRead,
DirectoryHandle* handle,
DirectoryEntry* entries,
u32 entriesToRead)
#include <filedevice/seadFileDevice.h>
bool sead:: NinContentFileDevice:: makeDirectory(const SafeString& path,
u32 x)
#include <filedevice/seadFileDevice.h>
bool sead:: NinContentFileDevice:: tryMakeDirectory(const SafeString& path,
u32)
#include <filedevice/seadFileDevice.h>
bool sead:: NinContentFileDevice:: makeDirectoryWithParent(const SafeString& path,
u32 x)
#include <filedevice/seadFileDevice.h>
bool sead:: NinContentFileDevice:: tryMakeDirectoryWithParent(const SafeString& path,
u32)
#include <filedevice/seadFileDevice.h>
s32 sead:: NinContentFileDevice:: getLastRawError() const
#include <filedevice/seadFileDevice.h>
void sead:: NinContentFileDevice:: traceFilePath(const SafeString& path) const virtual
#include <filedevice/seadFileDevice.h>
void sead:: NinContentFileDevice:: traceDirectoryPath(const SafeString& path) const virtual
#include <filedevice/seadFileDevice.h>
void sead:: NinContentFileDevice:: resolveFilePath(BufferedSafeString* out,
const SafeString& path) const virtual
#include <filedevice/seadFileDevice.h>
void sead:: NinContentFileDevice:: resolveDirectoryPath(BufferedSafeString* out,
const SafeString& path) const virtual
#include <filedevice/seadFileDevice.h>
bool sead:: NinContentFileDevice:: isMatchDevice_(const HandleBase* handle) const virtual
#include <filedevice/seadFileDevice.h>
void sead:: NinContentFileDevice:: erase()
#include <container/seadTList.h>
bool sead:: NinContentFileDevice:: doIsAvailable_() const override protected
FileDevice* sead:: NinContentFileDevice:: doOpen_(FileHandle* handle,
const SafeString& path,
FileOpenFlag flag) override protected
bool sead:: NinContentFileDevice:: doClose_(FileHandle* handle) override protected
bool sead:: NinContentFileDevice:: doFlush_(FileHandle* handle) override protected
bool sead:: NinContentFileDevice:: doRemove_(const SafeString& path) override protected
bool sead:: NinContentFileDevice:: doRead_(u32* bytesRead,
FileHandle* handle,
u8* outBuffer,
u32 bytesToRead) override protected
bool sead:: NinContentFileDevice:: doWrite_(u32* bytesWritten,
FileHandle* handle,
const u8* inBuffer,
u32 bytesToWrite) override protected
bool sead:: NinContentFileDevice:: doSeek_(FileHandle* handle,
s32 offset,
SeekOrigin origin) override protected
bool sead:: NinContentFileDevice:: doGetCurrentSeekPos_(u32* seekPos,
FileHandle* handle) override protected
bool sead:: NinContentFileDevice:: doGetFileSize_(u32* fileSize,
const SafeString& path) override protected
bool sead:: NinContentFileDevice:: doGetFileSize_(u32* fileSize,
FileHandle* handle) override protected
bool sead:: NinContentFileDevice:: doIsExistFile_(bool* exists,
const SafeString& path) override protected
bool sead:: NinContentFileDevice:: doIsExistDirectory_(bool* exists,
const SafeString& path) override protected
FileDevice* sead:: NinContentFileDevice:: doOpenDirectory_(DirectoryHandle* handle,
const SafeString& path) override protected
bool sead:: NinContentFileDevice:: doCloseDirectory_(DirectoryHandle* handle) override protected
bool sead:: NinContentFileDevice:: doReadDirectory_(u32* entriesRead,
DirectoryHandle* handle,
DirectoryEntry* entries,
u32 entriesToRead) override protected
bool sead:: NinContentFileDevice:: doMakeDirectory_(const SafeString& path,
u32 u_32) override protected
s32 sead:: NinContentFileDevice:: doGetLastRawError_() const override protected
void sead:: NinContentFileDevice:: doResolvePath_(BufferedSafeString* out,
const SafeString& path) const override protected
bool sead:: NinContentFileDevice:: formatPathForFS_(BufferedSafeString* out,
const SafeString& path) const virtual protected
FileHandleInner* sead:: NinContentFileDevice:: getFileHandleInner_(HandleBase* handle,
bool construct = false) const protected
DirectoryHandleInner* sead:: NinContentFileDevice:: getDirectoryHandleInner_(HandleBase* handle,
bool construct = false) const protected
u8* sead:: NinContentFileDevice:: doLoad_(LoadArg& arg) virtual protected
#include <filedevice/seadFileDevice.h>
bool sead:: NinContentFileDevice:: doSave_(SaveArg& arg) virtual protected
#include <filedevice/seadFileDevice.h>
void sead:: NinContentFileDevice:: doTracePath_(const SafeString& path) const virtual protected
#include <filedevice/seadFileDevice.h>
void sead:: NinContentFileDevice:: setFileHandleDivSize_(FileHandle* handle,
u32 divSize) const protected
#include <filedevice/seadFileDevice.h>
void sead:: NinContentFileDevice:: setHandleBaseFileDevice_(HandleBase* handle,
FileDevice* device) const protected
#include <filedevice/seadFileDevice.h>
void sead:: NinContentFileDevice:: setHandleBaseOriginalFileDevice_(HandleBase* handle,
FileDevice* device) const protected
#include <filedevice/seadFileDevice.h>
HandleBuffer& sead:: NinContentFileDevice:: getHandleBaseHandleBuffer_(HandleBase* handle) const protected
#include <filedevice/seadFileDevice.h>
Heap* sead:: NinContentFileDevice:: getDisposerHeap_() const protected
#include <heap/seadDisposer.h>
Variable documentation
static const s32 sead:: NinContentFileDevice:: cBufferMinAlignment
#include <filedevice/seadFileDevice.h>
FileDevice* sead:: NinContentFileDevice:: mData
#include <container/seadTList.h>
TList<FileDevice*>* sead:: NinContentFileDevice:: mList
#include <container/seadTList.h>
nn:: Result sead:: NinContentFileDevice:: mLastError protected
SafeString sead:: NinContentFileDevice:: mMountPoint protected
FixedSafeString<32> sead:: NinContentFileDevice:: mDriveName protected
#include <filedevice/seadFileDevice.h>
bool sead:: NinContentFileDevice:: mPermission protected
#include <filedevice/seadFileDevice.h>