Function a2lfile::load

source ·
pub fn load<P: AsRef<Path>>(
    path: P,
    a2ml_spec: Option<String>,
    log_msgs: &mut Vec<A2lError>,
    strict_parsing: bool
) -> Result<A2lFile, A2lError>
Expand description

Load an a2l file

a2ml_spec is optional and contains a String that is valid A2ML that can be used while parsing the file in addition to the A2ML that might be contained inside the A2ML block in the file. If a definition is provided here and there is also an A2ML block in the file, then the definition provided here will be tried first during parsing.

log_msgs is a reference to a Vec<A2LError> which will receive all warnings generated during parsing

strict_parsing toggles strict parsing: If strict parsing is enabled, most warnings become errors.

§Example

let mut log_msgs = Vec::<A2lError>::new();
match a2lfile::load("example.a2l", None, &mut log_msgs, true) {
    Ok(a2l_file) => {/* do something with it*/},
    Err(error_message) => println!("{}", error_message)
}

§Errors

An A2lError provides details information if loading the file fails.