pub struct A2lFile {
pub asap2_version: Option<Asap2Version>,
pub a2ml_version: Option<A2mlVersion>,
pub project: Project,
/* private fields */
}
Expand description
Contains all the objects of an A2lfile
An instance of this struct is returned when an a2l file is loaded successfully
Fields
asap2_version: Option<Asap2Version>
a2ml_version: Option<A2mlVersion>
project: Project
Implementations
sourceimpl A2lFile
impl A2lFile
sourcepub fn write_to_string(&self) -> String
pub fn write_to_string(&self) -> String
construct a string containing the whole a2l data of this A2lFile object
sourcepub fn write(
&self,
filename: &OsStr,
banner: Option<&str>
) -> Result<(), String>
pub fn write(
&self,
filename: &OsStr,
banner: Option<&str>
) -> Result<(), String>
write this A2lFile object to the given file the banner will be placed inside a comment at the beginning of the file; “/” an “/” should not be part of the banner string
sourcepub fn merge_modules(&mut self, merge_file: &mut A2lFile)
pub fn merge_modules(&mut self, merge_file: &mut A2lFile)
Merge another a2l file on the MODULE level.
The input file and the merge file must each contain exactly one MODULE. The contents will be merged so that there is one merged MODULE in the output.
sourcepub fn sort(&mut self)
pub fn sort(&mut self)
sort the data in the a2l file. This changes the order in which the blocks will be written to an output file
sourcepub fn sort_new_items(&mut self)
pub fn sort_new_items(&mut self)
sort newly added or merged blocks into sensible locations between the existing blocks
sourcepub fn cleanup(&mut self)
pub fn cleanup(&mut self)
cleanup: remove unused GROUPs, RECORD_LAYOUTs, COMPU_METHODs, COMPU_(V)TABs and UNITs
sourcepub fn ifdata_cleanup(&mut self)
pub fn ifdata_cleanup(&mut self)
cleanup IF_DATA: remove any IF_DATA blocks that could not be parsed using either the specification provided during load or the specification in the A2ML block in the file
Trait Implementations
sourceimpl A2lObject<()> for A2lFile
impl A2lObject<()> for A2lFile
sourcefn get_layout(&self) -> &BlockInfo<()>
fn get_layout(&self) -> &BlockInfo<()>
get a reference to the BlockInfo that describes the layout of the a2l object
sourcefn get_layout_mut(&mut self) -> &mut BlockInfo<()>
fn get_layout_mut(&mut self) -> &mut BlockInfo<()>
get a mutable reference to the BlockInfo that describes the layout of the a2l object
sourcefn reset_location(&mut self)
fn reset_location(&mut self)
reset the location information on the a2l object. It will be treated like a new object when writing a file
sourcefn merge_includes(&mut self)
fn merge_includes(&mut self)
reset the reference to an include file on this objct and its children. This causes the object to be written into the output file instead of referenced through /include “filename” Read more
Auto Trait Implementations
impl RefUnwindSafe for A2lFile
impl Send for A2lFile
impl Sync for A2lFile
impl Unpin for A2lFile
impl UnwindSafe for A2lFile
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more