[−][src]Struct cpclib_basic::BasicProgram
Encode a complete basic program
Methods
impl BasicProgram
[src]
pub fn new(lines: Vec<BasicLine>) -> Self
[src]
Create the program from a list of lines
pub fn parse<S: AsRef<str>>(code: S) -> Result<Self, String>
[src]
Create the program from a code to parse
pub fn add_line(&mut self, line: BasicLine)
[src]
Add a line to the program. If a line with the same number already exists, it is replaced
pub fn get_line_mut(
&mut self,
idx: BasicProgramLineIdx
) -> Option<&mut BasicLine>
[src]
&mut self,
idx: BasicProgramLineIdx
) -> Option<&mut BasicLine>
Returns a mutable reference on the requested line if exists
pub fn get_line(&mut self, idx: BasicProgramLineIdx) -> Option<&BasicLine>
[src]
Returns a reference on the requested line if exists
pub fn is_first_line(&self, idx: BasicProgramLineIdx) -> bool
[src]
Returns true if the index corresponds to the very first line. False if it does not correspond or does not exists
pub fn previous_idx(
&self,
idx: BasicProgramLineIdx
) -> Option<BasicProgramLineIdx>
[src]
&self,
idx: BasicProgramLineIdx
) -> Option<BasicProgramLineIdx>
Returns the previous index of idx if it exists
pub fn has_line(&self, idx: BasicProgramLineIdx) -> bool
[src]
Check if the program contains the requested line
pub fn hide_line(&mut self, idx: BasicProgramLineIdx) -> Result<(), BasicError>
[src]
https://cpcrulez.fr/applications_protect-protection_logiciel_n42_ACPC.htm
pub fn hide_lines(&mut self, lines: &[u16]) -> Result<(), BasicError>
[src]
pub fn as_bytes(&self) -> Vec<u8>
[src]
Generate the byte stream for the gien program
Trait Implementations
impl Clone for BasicProgram
[src]
fn clone(&self) -> BasicProgram
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for BasicProgram
[src]
impl Display for BasicProgram
[src]
Auto Trait Implementations
impl RefUnwindSafe for BasicProgram
impl Send for BasicProgram
impl Sync for BasicProgram
impl Unpin for BasicProgram
impl UnwindSafe for BasicProgram
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,