Catalog · How the catalog works
LocalStorage4Pascal
Pequena biblioteca que simula o LocalStorage do Browser no Delphi para aplicações Desktop e Mobile
- ★ 6 on GitHub
Anyone may press Interesting, signed in or not. It helps others find this project.
README
LocalStorage4Pascal
LocalStorage4Pascal é uma biblioteca para Delphi e Lazarus que implementa uma função semelhante ao LocalStorage de navegadores, permitindo o armazenamento persistente de dados em aplicações desktop e mobile. Por que usar SQLite para guardar dados, especialmente para cache de resultados de consultas a API se podes salvar como se estivesse no Browser. Guarde Token, preferência de tema e dados não sensíveis num arquivo no formato JSON e leia seus valores de forma prática, com métodos que retornam não só string, mas também boolean, double, integer, int64, TJsonObject e TJsonArray.
🌟 Recursos
- Compatível com Windows, macOS, Linux, Android e iOS.
- Suporte para Delphi XE2+ e Lazarus 2+.
- Armazenamento de dados persistente usando um sistema leve e eficiente.
📦 Instalação
🔹 Opção 1: Instalação Manual
- Copie os arquivos da pasta
srcpara o seu projeto. - Inclua as units no seu projeto.
🔹 Opção 2: Instalação com BOSS (Delphi e Lazarus)
O BOSS é um gerenciador de pacotes para Delphi e Lazarus.
- Instale o BOSS se ainda não tiver:
pip install boss-delphi - No terminal, dentro do diretório do seu projeto, execute:
boss install https://github.com/rafael-figueiredo-alves/LocalStorage4Pascal
🚀 Como Usar
- Inicialize a biblioteca no arquivo principal do projeto:
- Delphi (dpr):
uses LocalStorage4Pascal; begin InitLocalStorage4Pascal('projeto.json'); end. - Lazarus:
uses LocalStorage4Pascal; begin InitLocalStorage4Pascal('projeto.json'); end.
- Delphi (dpr):
- Acesse o armazenamento local:
- Delphi:
LocalStorage4Delphi.SetValue('username', 'Rafael'); ShowMessage(LocalStorage4Delphi.GetValue('username')); - Lazarus:
LocalStorage4Lazarus.SetValue('username', 'Rafael'); ShowMessage(LocalStorage4Lazarus.GetValue('username'));
- Delphi:
LocalStorage4Pascal (English)
LocalStorage4Pascal is a library for Delphi and Lazarus that implements a LocalStorage-like feature, allowing persistent data storage in desktop and mobile applications. Why use SQLite to store data, especially for caching API query results, if you can save it as if it were in the browser. Store Token, theme preference and non-sensitive data in a JSON file and read their values conveniently, with methods that return not only string, but also boolean, double, integer, int64, TJsonObject and TJsonArray.
🌟 Features
- Compatible with Windows, macOS, Linux, Android, and iOS.
- Supports Delphi XE2+ and Lazarus 2+.
- Lightweight and efficient persistent data storage.
📦 Installation
🔹 Option 1: Manual Installation
- Copy the
srcfolder files into your project. - Include the units in your project.
🔹 Option 2: Install with BOSS (Delphi & Lazarus)
BOSS is a package manager for Delphi and Lazarus.
- Install BOSS if you haven't already:
pip install boss-delphi - Inside your project directory, run:
boss install https://github.com/rafael-figueiredo-alves/LocalStorage4Pascal
🚀 How to Use
- Initialize the library in the main project file:
- Delphi (dpr):
uses LocalStorage4Pascal; begin InitLocalStorage4Pascal('projeto.json'); end. - Lazarus:
uses LocalStorage4Pascal; begin InitLocalStorage4Pascal('projeto.json'); end.
- Delphi (dpr):
- Access local storage:
- Delphi:
LocalStorage4Delphi.SetValue('username', 'Rafael'); ShowMessage(LocalStorage4Delphi.GetValue('username')); - Lazarus:
LocalStorage4Lazarus.SetValue('username', 'Rafael'); ShowMessage(LocalStorage4Lazarus.GetValue('username'));
- Delphi:

