Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deserialize designspace lib fields #311

Merged
merged 1 commit into from
Jul 28, 2023
Merged

Deserialize designspace lib fields #311

merged 1 commit into from
Jul 28, 2023

Commits on Jul 26, 2023

  1. [designspace] Deserialize lib fields

    This was about as painful as expected, and requires us to manually glue
    together the xml data model with the plist model, using serde.
    
    To briefly summarize the problem: XML data, by definition, does not have
    any defined semantics. Semantics are added on top of XML on a per-case
    basis, by indicating the document type inline
    (<https://en.wikipedia.org/wiki/Document_type_declaration>).
    
    The plist crate does implement derive for plist types, but they are based on the
    assumption that type information is being provided by some deserializer
    (e.g. for a specific file format). This is the right thing for the plist
    crate to do. Unfortunately quick_xml cannot provide this type
    information, since quick_xml does not know that we are deserializing a
    plist.
    
    To make this all work, I have added a bunch of manual deserialize code.
    This code will only work when deserializing from XML; if in the future
    we wish to serialize to other formats, we will need to revise it.
    
    Some notes:
    
    - This only implements deserialization, not serialization. (This is
      fine, since we do not currently serialize anyway, but we'll have to
      figure that out eventually)
    - this does not support the UID type, which is not accepted in XML
      plists
    cmyr committed Jul 26, 2023
    Configuration menu
    Copy the full SHA
    0fc1096 View commit details
    Browse the repository at this point in the history