Configuration Parser
From ZDLSharp
This page describes the features of the configuration parser in ZDLSharp and qZDL.
Contents |
[edit] Introduction
The original ZDL and ZDLSharp 3.0.5.3 and earlier featured a very basic parsing engine that rewrote the entire file from scratch. This had poor compatibility with other launchers anything that was not understood (or commented out) would be overwritten. There were plans for an improved parser in ZDLSharp 3.0.5.3, however, it was scrapped. Testing and plans started on a small utility that would provide cross platform and flexible usage for thumb drives. This code featured a configuration file backend that would eliminate the short comings of previous parsers. When work started on ZDLSharp 3.0.5.3q, the code was merged in as the foundation of the project.
[edit] How it works
When an object wants to access a configuration file, it first requests the configuration file from a central object. This central object has a reference to the active configuration. The object is then free to get values, write values, read files, and write files. For example, when ZDLSharp first launches, it creates a new blank configuration, then loads the configuration file, and then sets that configuration as the current application-wide configuration. When the tabs change, the application closes, or a launch is started, a signal is sent to all components in the application, where they modify their appropriate configuration settings. For performance reasons, configurations aren't written back to the application-wide configuration or to the file as soon as an edit is made (with some exceptions).
[edit] Version History
[edit] v1.0
This version is currently in development and may not reflect the final product
[edit] Transparent Configuration
When a ZDL Configuration object is created, it creates a variable resolver. When a request is made, the configuration forwards the request to the variable resolver, which does parsing on the object, and then if there are no matches, it starts looking through the main configuration for matches.
