diagram_io/src/props.rs#
Source: lib/diagram_io/src/props.rs
props -- the document properties of a drawing (DF-09): docProps/core.xml, app.xml, custom.xml
props::read(&doc) -> Props what the three parts say ("" where an entry is missing)
props::write(&mut doc, &props) the parts made to say it: a part is only touched when one
of its own entries changed, so an unchanged file keeps its
bytes; a missing part is created, a custom part without
entries is removed
Custom { name, kind, value } a custom property: kind is the vt element ("lpwstr",
"i4", "r8", "bool", "filetime" ...), value its text
The parts are found by their content type (OPC names them freely). core.xml is written anew
from Props in the order Office writes it; app.xml keeps everything it had (Visio's page and
master lists, the version) and only gets the four entries Props names (Template, Company,
Manager, HyperlinkBase) replaced or added; custom.xml is written anew from the list. Dates
stay the W3CDTF text the file had ("2026-11-14T18:04:59Z"); nothing here reads a clock.
Reading is bounded like every part (vsdx::Limits::VSDX's XML bounds) and never fails: a part
that is no XML reads as empty.
/// the content type of docProps/core.xml
CT_CORE: &str = "application/vnd.openxmlformats-package.core-properties+xml"
/// the content type of docProps/app.xml
CT_APP: &str = "application/vnd.openxmlformats-officedocument.extended-p ...
/// the content type of docProps/custom.xml
CT_CUSTOM: &str = "application/vnd.openxmlformats-officedocument.custom-pro ...
struct Customone custom propertyname: String-- its namekind: String-- the vt element of its value: "lpwstr", "i4", "r8", "bool", "filetime", "date" ...value: String-- the value as text
struct Propsthe document properties; "" where the file has nonetitle: String-- Titel (dc:title)subject: String-- Thema (dc:subject)creator: String-- Autor (dc:creator)keywords: String-- Stichwörter (cp:keywords)description: String-- Kommentare (dc:description)category: String-- Kategorie (cp:category)language: String-- Sprache (dc:language)last_modified_by: String-- zuletzt geändert von (cp:lastModifiedBy)content_status: String-- Status (cp:contentStatus)revision: String-- Revision (cp:revision)created: String-- erstellt (dcterms:created, W3CDTF)modified: String-- geändert (dcterms:modified, W3CDTF)last_printed: String-- zuletzt gedruckt (cp:lastPrinted, W3CDTF)template: String-- Vorlage (app.xml Template)company: String-- Firma (app.xml Company)manager: String-- Manager (app.xml Manager)hyperlink_base: String-- Hyperlinkbasis (app.xml HyperlinkBase)application: String-- the program that wrote the file (app.xml Application; read only)custom: Vec<Custom>-- the custom properties in file order
fn read(doc: &Document) -> Propswhat the document's property parts sayfn write(doc: &mut Document, p: &Props)make the property parts sayp(see the module comment); parts whose entries did not change keep their bytes