Skip to main content

read

Function read 

Source
pub fn read(text: &str, file: &str) -> Result<CatalogFile, OrcError>
Expand description

Reads one .orc file’s text; file names it in each Part::file.

Only text nested past MAX_DEPTH, text that isn’t XML, or a root that isn’t <OpenRocketComponent> is refused. A part this can’t read (a missing or unreadable size, a unit or shape it doesn’t take, a material of the wrong kind, an element that isn’t a kind of part) is left out with a warning, where OpenRocket 24.12 refuses the whole file for most of these. Fields a part’s kind doesn’t have are ignored with a warning, as is anything beside the three lists; a list stated twice keeps the last, as OpenRocket does, with a warning.

§Errors

OrcError::TooDeep, OrcError::Xml and OrcError::NotACatalog.