[][src]Struct nitro_fs::fnt::Directory

pub struct Directory {
    pub path: PathBuf,
    pub files: Vec<FileEntry>,
    // some fields omitted
}

Represents a NitroROM directory.

Notes

path will be the full path relative to the root of the file name table.

value for the root directory is the number of directories in the file name table. For non-root directories, it is the ID of the directory's parent.

Because the root directory has no parent ID value, a parent_id call on the root directory will return ROOT_ID.

Fields

path: PathBuf

Name of the directory

files: Vec<FileEntry>

Implementations

impl Directory[src]

pub fn new<R: Read>(reader: &mut R, id: u16) -> Result<Self, Error>[src]

pub fn set_path<P: AsRef<Path>>(&mut self, path: P)[src]

Sets the full path that this directory is referenced by.

pub fn offset(&self) -> u32[src]

The offset into the FNT where this directory's info is stored.

pub fn id(&self) -> u16[src]

The ID of the directory.

pub fn start_id(&self) -> u16[src]

The ID of the first file in the directory's subtable.

pub fn parent_id(&self) -> u16[src]

The ID of the parent directory.

If this is the root directory, ROOT_ID will be returned instead.

pub fn is_root(&self) -> bool[src]

Whether this directory is the root.

pub fn append_file(&mut self, file: FileEntry)[src]

Appends a file to the file list associated with this directory.

pub fn append_files(&mut self, files: &[FileEntry])[src]

Appends several files to the list associated with this directory.

Trait Implementations

impl Clone for Directory[src]

impl Debug for Directory[src]

impl Eq for Directory[src]

impl Hash for Directory[src]

impl Ord for Directory[src]

impl PartialEq<Directory> for Directory[src]

impl PartialOrd<Directory> for Directory[src]

impl StructuralEq for Directory[src]

impl StructuralPartialEq for Directory[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.