Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions utils/config.simba
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,38 @@ begin
TJSONParser(Self.Data).Save(Self.Path, [EJSONFormatOption.USE_TABS, EJSONFormatOption.SINGLE_LINE_ARR], 1);
end;

procedure TConfigJSON.Put(const key: String; value: Int64); overload;
begin
if Self.Data.Has(key) then
Self.Data.Item[key].AsInt := value
else
Self.Data.AddInt(key, value);
end;

procedure TConfigJSON.Put(const key: String; value: Double); overload;
begin
if Self.Data.Has(key) then
Self.Data.Item[key].AsFloat := value
else
Self.Data.AddFloat(key, value);
end;

procedure TConfigJSON.Put(const key: String; value: Boolean); overload;
begin
if Self.Data.Has(key) then
Self.Data.Item[key].AsBool := value
else
Self.Data.AddBool(key, value);
end;

procedure TConfigJSON.Put(const key: String; value: String); overload;
begin
if Self.Data.Has(key) then
Self.Data.Item[key].AsString := value
else
Self.Data.AddString(key, value);
end;

(*
## TConfigINI
Type responsible for dealing with INI configuration files.
Expand Down