DataConfig

INI file format config parser with similar functions to Python version except for multiline values.

Types

Parser* = POINTER TO ParserDesc;
ParserDesc* = RECORD
        sections* : Set.SetStr;
        entries* : Dictionary.DictionaryStrStr;
    END;

Procedures

InitParser

PROCEDURE InitParser*(parser : Parser);

Parser.Clear

Clear data

PROCEDURE (this : Parser) Clear*();

Parser.Get

Get config value. Return TRUE if success.

PROCEDURE (this : Parser) Get*(VAR value : String.STRING; section- : ARRAY OF CHAR; key- : ARRAY OF CHAR) : BOOLEAN;

Parser.Set

Set config value. Return TRUE if success.

PROCEDURE (this : Parser) Set*(section- : ARRAY OF CHAR; key- : ARRAY OF CHAR; value- : ARRAY OF CHAR) : BOOLEAN;

Parser.Delete

Delete config value. Return TRUE if success.

PROCEDURE (this : Parser) Delete*(section- : ARRAY OF CHAR; key- : ARRAY OF CHAR) : BOOLEAN;

Parser.DeleteSection

Delete config section and coresponding entries. Return TRUE if success.

PROCEDURE (this : Parser) DeleteSection*(section- : ARRAY OF CHAR) : BOOLEAN;

Parser.HasSection

Return TRUE if section exists

PROCEDURE (this : Parser) HasSection*(section- : ARRAY OF CHAR): BOOLEAN;

Parser.Sections

Extract Vector of sections

PROCEDURE (this : Parser) Sections*(): Vector.VectorOfString;

Parser.Write

Write data to Stream

PROCEDURE (this : Parser) Write*(fh : Object.Stream): BOOLEAN;

Parser.Read

Read from Stream. This operation will try to append the new data. Clear the data before operation if this is not intended.

PROCEDURE (this : Parser) Read*(fh : Object.Stream): LONGINT;