Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Catalog · How the catalog works

Random project

CCR.PrefsIniFile

TCustomIniFile decendants for Delphi wrapping the Android, iOS and OS X Preferences APIs

View on GitHub

Anyone may press Interesting, signed in or not. It helps others find this project.

Member rating

No ratings yet.

Sign in to rate this project.

README

CCR.PrefsIniFile

Implements TCustomIniFile descendants (TAndroidPreferencesIniFile and TApplePreferencesIniFile) that delegate to the native app preferences API on Android, iOS and OS X. A factory function is also provided to allow easily creating a TCustomIniFile instance without worrying about the platform (Android/iOS/OS X/Windows).

Usage

pascal
uses
  System.IniFiles, CCR.PrefsIniFile;
pascal
procedure ReadTest;
var
  Settings: TCustomIniFile;
  Flag: Boolean;
begin
  Settings := CreateUserPreferencesIniFile;
  try
    Flag := Settings.ReadBool('General', 'NeverShowSaveConfirmationPrompt', False);
    if Flag then //...
  finally
    Settings.Free;
  end;
end;
pascal
procedure WriteTest;
var
  Settings: TCustomIniFile;
begin
  Settings := CreateUserPreferencesIniFile;
  try
    Settings.WriteBool('General', 'NeverShowSaveConfirmationPrompt', True);
  finally
    Settings.Free;
  end;
end;