Skip to content
This repository has been archived by the owner on Dec 11, 2023. It is now read-only.
/ perst Public archive

Interface for persistent storage and simple implementations

Notifications You must be signed in to change notification settings

pile-contributors/perst

Repository files navigation

PerSt

Persistent storage pile used for storing key/value pairs on different underlying objects.

The pile provides an interface in the form of [perst] class and a number of providers:

  • registry - based on QSettings and registry
  • config - based on QSettings and file system
  • xml - based on an XML file

Instantiating and general management is performed through [perstFactory] class and it also allows custom providers to be added.

Usage

Initialization and termination needs to be done once per application:

PerStFactory::init ();
// ...
PerStFactory::end ();

To create a new file-based instance with QSettings back-end and read the content if the file "config.ini" exists use:

PerSt * result = PerStFactory::create (
    "config",
    "config.ini");
result->beginGroup ("general");
int port = result->valueInt ("in_port");
++port;
result->setValue ("out_port", port);
result->endGroup ("general");
// ...
delete result;

Dependencies

  • Qt (either 4.X or 5.X) is optional (the pile uses QString used for strings but it may also use std::string);
  • UserMsg pile

[perst]: @ref PerSt "PerSt" [perstFactory]: @ref PerStFactory "PerStFactory"

About

Interface for persistent storage and simple implementations

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published