forked from lucretius/SilentDragonLite
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
36 lines
776 B
36 lines
776 B
// Copyright 2019-2023 The Hush developers
|
|
// Released under the GPLv3
|
|
#ifndef CONTACTDATASTORE_H
|
|
#define CONTACTDATASTORE_H
|
|
#include "../Model/ContactItem.h"
|
|
#include <string>
|
|
using json = nlohmann::json;
|
|
|
|
class ContactDataStore
|
|
{
|
|
private:
|
|
static bool instanced;
|
|
static ContactDataStore* instance;
|
|
std::map<QString, ContactItem> data;
|
|
ContactDataStore()
|
|
{
|
|
|
|
}
|
|
|
|
public:
|
|
static ContactDataStore* getInstance();
|
|
void clear();
|
|
void setData(QString key, ContactItem value);
|
|
ContactItem getData(QString key);
|
|
QString dump();
|
|
|
|
~ContactDataStore()
|
|
{
|
|
ContactDataStore::instanced = false;
|
|
ContactDataStore::instance = nullptr;
|
|
}
|
|
};
|
|
|
|
|
|
|
|
#endif
|
|
|