[][src]Struct cpclib_disc::amsdos::AmsdosManager

pub struct AmsdosManager { /* fields omitted */ }

http://cpctech.cpc-live.com/docs/manual/s968se09.pdf Current implementatin only focus on DATA format

Methods

impl AmsdosManager[src]

pub fn dsk(&self) -> &ExtendedDsk[src]

pub fn dsk_mut(&mut self) -> &mut ExtendedDsk[src]

pub fn new_from_disc<S: Into<Head>>(disc: ExtendedDsk, head: S) -> Self[src]

pub fn format(&mut self)[src]

Format the disc. Currently it only modifies the catalog

pub fn catalog(&self) -> AmsdosEntries[src]

Return the entries of the Amsdos catalog Panic if dsk is not compatible

pub fn set_catalog(&mut self, entries: &AmsdosEntries)[src]

Rewrite the whole catalog

pub fn print_catalog(&self)[src]

Print the catalog on screen

pub fn compute_basic_header(
    filename: &AmsdosFileName,
    data: &[u8]
) -> AmsdosHeader
[src]

Generate a header for a basic file

pub fn compute_binary_header(
    filename: &AmsdosFileName,
    loading_address: u16,
    execution_address: u16,
    data: &[u8]
) -> AmsdosHeader
[src]

Generate a header for binary file

pub fn get_file<F: Into<AmsdosFileName>>(
    &self,
    filename: F
) -> Option<AmsdosFile>
[src]

Return the file if it exists

pub fn add_file(
    &mut self,
    file: &AmsdosFile,
    is_system: bool,
    is_read_only: bool
) -> Result<(), AmsdosError>
[src]

Add the given amsdos file to the disc Code is greatly inspired by idsk with no special verifications. In case of error, the disk is in a broken state => part of the file may be stored...

pub fn padding(data: &[u8], size: usize) -> Vec<u8>[src]

Returns a Vec of the right size by padding 0

pub fn update_entry(&mut self, entry: &AmsdosEntry)[src]

Write the entry information on disc AFTER the sectors has been set up. Panic if dsk is invalid Still stolen to iDSK

pub fn update_bloc(&mut self, bloc_idx: BlocIdx, content: &[u8])[src]

Write bloc content on disc. One bloc use 2 sectors Implementation is stolen to iDSK

pub fn read_bloc(&self, bloc_idx: BlocIdx) -> Vec<u8>[src]

Read the content of the given bloc

pub fn read_entry(&self, entry: &AmsdosEntry) -> Vec<u8>[src]

Read the content of the given entry

Trait Implementations

impl Debug for AmsdosManager[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, 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.