Skip to content

Deprecating XML .gbt format; refactoring XML reading #807

@tturocy

Description

@tturocy

We will be deprecating the .gbt XML-based format written by the graphical interface in favour of other formats. At present the plan is that tools may continue to read the .gbt files but no longer write them from Gambit 17.

These are XML-based files (with a schema that has always been implicitly defined). These have been read and written by embedding a separate library tinyxml into the source code.

Note that actually the payload of defining the game in a .gbt file is actually just the .efg or .nfg file format. XML is used entirely to store GUI state, not the game itself.

To remove the dependency on this library, we will do the following:

  • In the graphical interface, wxWidgets provides a collection of classes for dealing with XML documents; the reader and writer can be ported to use this for the graphical interface - which as noted above is the only substantive place this information is used anyway.
  • In C++, we can write a simple function that scans an XML file for the <efgfile> or <nfgfile> tags and attempts to extract the game from that segment. This would not do any parsing or validation of the whole file, but this would seem to be a small cost given our plans to move away from XML; if a file isn't valid XML but has a valid fragment that's an .efg or .nfg there's no reason not to be able to read it!
  • In Python, we can use Python XML libraries to handle the reading and writing if desired. This may not be necessary given the previous point.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions