#![doc(alias = "filesystem")]
use bitflags::bitflags;
bitflags! {
#[derive(Default, PartialEq, Eq, PartialOrd, Ord, Hash, Debug, Clone, Copy)]
struct Open: u8 {
const FS_OPEN_READ = ctru_sys::FS_OPEN_READ;
const FS_OPEN_WRITE = ctru_sys::FS_OPEN_WRITE;
const FS_OPEN_CREATE = ctru_sys::FS_OPEN_CREATE;
}
#[derive(Default, PartialEq, Eq, PartialOrd, Ord, Hash, Debug, Clone, Copy)]
struct Write: u16 {
const FS_WRITE_FLUSH = ctru_sys::FS_WRITE_FLUSH;
const FS_WRITE_UPDATE_TIME = ctru_sys::FS_WRITE_UPDATE_TIME;
}
#[derive(Default, PartialEq, Eq, PartialOrd, Ord, Hash, Debug, Clone, Copy)]
struct Attribute: u32 {
const FS_ATTRIBUTE_DIRECTORY = ctru_sys::FS_ATTRIBUTE_DIRECTORY;
const FS_ATTRIBUTE_HIDDEN = ctru_sys::FS_ATTRIBUTE_HIDDEN;
const FS_ATTRIBUTE_ARCHIVE = ctru_sys::FS_ATTRIBUTE_ARCHIVE;
const FS_ATTRIBUTE_READ_ONLY = ctru_sys::FS_ATTRIBUTE_READ_ONLY;
}
}
#[doc(alias = "FS_MediaType")]
#[derive(Copy, Clone, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum MediaType {
Nand = ctru_sys::MEDIATYPE_NAND,
Sd = ctru_sys::MEDIATYPE_SD,
GameCard = ctru_sys::MEDIATYPE_GAME_CARD,
}
#[doc(alias = "FS_PathType")]
#[derive(Copy, Clone, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum PathType {
Invalid = ctru_sys::PATH_INVALID,
Empty = ctru_sys::PATH_EMPTY,
Binary = ctru_sys::PATH_BINARY,
ASCII = ctru_sys::PATH_ASCII,
UTF16 = ctru_sys::PATH_UTF16,
}
#[doc(alias = "FS_ArchiveID")]
#[derive(Copy, Clone, Debug, PartialEq, Eq)]
#[repr(u32)]
pub enum ArchiveID {
RomFS = ctru_sys::ARCHIVE_ROMFS,
Savedata = ctru_sys::ARCHIVE_SAVEDATA,
Extdata = ctru_sys::ARCHIVE_EXTDATA,
SharedExtdata = ctru_sys::ARCHIVE_SHARED_EXTDATA,
SystemSavedata = ctru_sys::ARCHIVE_SYSTEM_SAVEDATA,
Sdmc = ctru_sys::ARCHIVE_SDMC,
SdmcWriteOnly = ctru_sys::ARCHIVE_SDMC_WRITE_ONLY,
BossExtdata = ctru_sys::ARCHIVE_BOSS_EXTDATA,
CardSpiFS = ctru_sys::ARCHIVE_CARD_SPIFS,
ExtDataAndBossExtdata = ctru_sys::ARCHIVE_EXTDATA_AND_BOSS_EXTDATA,
SystemSaveData2 = ctru_sys::ARCHIVE_SYSTEM_SAVEDATA2,
NandRW = ctru_sys::ARCHIVE_NAND_RW,
NandRO = ctru_sys::ARCHIVE_NAND_RO,
NandROWriteAccess = ctru_sys::ARCHIVE_NAND_RO_WRITE_ACCESS,
SaveDataAndContent = ctru_sys::ARCHIVE_SAVEDATA_AND_CONTENT,
SaveDataAndContent2 = ctru_sys::ARCHIVE_SAVEDATA_AND_CONTENT2,
NandCtrFS = ctru_sys::ARCHIVE_NAND_CTR_FS,
TwlPhoto = ctru_sys::ARCHIVE_TWL_PHOTO,
NandTwlFS = ctru_sys::ARCHIVE_NAND_TWL_FS,
GameCardSavedata = ctru_sys::ARCHIVE_GAMECARD_SAVEDATA,
UserSavedata = ctru_sys::ARCHIVE_USER_SAVEDATA,
DemoSavedata = ctru_sys::ARCHIVE_DEMO_SAVEDATA,
}
from_impl!(MediaType, ctru_sys::FS_MediaType);
from_impl!(PathType, ctru_sys::FS_PathType);
from_impl!(ArchiveID, ctru_sys::FS_ArchiveID);