Clone wiki

delphi-yaml / Home

Delphi 7 compatible bindings for libyaml, YAML parser and emitter library implemented in C. Four layers of bindings are proposed:

ThinMere C exports, records, enumerationsComplete
IntermediateExposing libyaml entities in a high level language but still dealing with processes and eventsComplete, somewhat tested
ThickParsing and emitting CVariantsMedium completeness, can be used right now
RttiRTTI is another option for dealing with YAML. However, one of my goals is Delphi compatibility from 7 to XE2. Rtti.pas out-of-box appeared in Delphi 2010. Delphi 7 RTTI isn't fully accessible via standard units, however there is a nice separate package HVRTTIUtils by Hallvard Vassbotn. A bridge should be written that unifies HVRTTIUtils and Rtti.pas. Delphi 2009 is covered by neither HVRTTIUtils nor Rtti.pas. HVRTTIUtils should be extended to handle Delphi 2009.
Such a bridge already exists: ThorRTTI, but it lacks HVRTTIUtils features and probably has another defects.
On top of this bridge we can implement YAML loading/serialization.
Fragile future plans


YAML is a syntax and semantic superset of JSON. Every JSON document is a valid YAML document. It is likely to be possible to consume and produce JSON as well.


The LibYAML library is written by Kirill Simonov. LibYAML is released under the MIT license.

The Delphi-YAML library is written by Ivan Levashew. Delphi-YAML is released under the MIT license.