Phosphor
Qt6 / Wayland library suite for window-management tools
 
Loading...
Searching...
No Matches
JsonSurfaceStore.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: 2026 fuddlesworth
2// SPDX-License-Identifier: LGPL-2.1-or-later
3
4#pragma once
5
7#include <PhosphorLayer/phosphorlayer_export.h>
8
9#include <memory>
10
11QT_BEGIN_NAMESPACE
12class QString;
13QT_END_NAMESPACE
14
15namespace PhosphorLayer {
16
42class PHOSPHORLAYER_EXPORT JsonSurfaceStore : public ISurfaceStore
43{
44public:
45 explicit JsonSurfaceStore(QString filePath);
47
48 bool save(const QString& key, const QJsonObject& data) override;
49 QJsonObject load(const QString& key) const override;
50 bool has(const QString& key) const override;
51 void remove(const QString& key) override;
52
54 QString filePath() const;
55
56private:
57 class Impl;
58 std::unique_ptr<Impl> m_impl;
59};
60
61} // namespace PhosphorLayer
Key-value JSON store for surface-related persistence.
Definition ISurfaceStore.h:32
File-backed ISurfaceStore — one JSON document on disk.
Definition JsonSurfaceStore.h:43
QJsonObject load(const QString &key) const override
Load the JSON object previously stored under key.
bool has(const QString &key) const override
True if key exists in the store.
QString filePath() const
File path this store reads from / writes to.
void remove(const QString &key) override
Remove the entry for key (no-op if absent).
bool save(const QString &key, const QJsonObject &data) override
Persist data under key.
JsonSurfaceStore(QString filePath)
Definition SurfaceAnimator.h:26