pub fn detect_schema_version(content: &[u8]) -> &'static strExpand description
The IFC schema a STEP file declares: "IFC2X3", "IFC4", "IFC4X3" or
"IFC5". THE detector for every schema_version this workspace reports,
the native pipeline’s ModelMetadata and the server’s /parse/metadata
alike (PROCESSING-5 / SERVER-18, #7691: the server kept a second,
case-sensitive copy, and processing searched the whole file, so ifc4
inside a GUID reported an IFC2X3 model as IFC4).
The rule is the TS parser’s detectSchemaVersion
(packages/parser/src/source-header.ts), pinned against it by the shared
vectors in rust/core/tests/fixtures/schema_version_vectors.json:
- The first
FILE_SCHEMAidentifier that names a family wins (SchemaFamily::detect, overfirst_declared_schema, the selection the decoder’s attribute layout uses too). The header reader is quote- and comment-aware, so text in DATA, header strings or comments does not count. - If none does (no, empty or unparseable declaration), the first 2000
bytes are searched for a schema token, ASCII case-insensitively. This
is a loose last resort: with no declaration it can match
ifc4inside a GUID in those bytes, exactly as the TS twin does (pinned by a shared vector, #7740). - Otherwise
"IFC4".