Phosphor
Qt6 / Wayland library suite for window-management tools
 
Loading...
Searching...
No Matches
PhosphorConfig::IGroupPathResolver Class Referenceabstract

Optional plug-in for custom group name semantics. More...

#include <phosphor-config/include/PhosphorConfig/IGroupPathResolver.h>

Public Member Functions

virtual ~IGroupPathResolver ()=default
 
virtual std::optional< QStringList > toJsonPath (const QString &groupName) const =0
 Map an external group name to its JSON path segments.
 
virtual QStringList reservedRootKeys () const
 Extra top-level JSON keys that this resolver owns.
 
virtual QStringList enumerate (const QJsonObject &) const
 Enumerate every external group name currently represented in the backing JSON document under this resolver's reserved keys.
 

Protected Member Functions

 IGroupPathResolver ()=default
 

Detailed Description

Optional plug-in for custom group name semantics.

PhosphorConfig's bundled backends understand two group forms out of the box:

  • Flat names: "General"
  • Dot-path names: "Snapping.Behavior.ZoneSpan" → nested JSON objects

Consumers that need additional name conventions (e.g. "ZoneSelector:ScreenId" for per-screen overrides) can register an IGroupPathResolver on the backend. The resolver intercepts group names before they reach storage and maps them to an internal JSON path, and vice versa for enumeration.

A resolver is queried first. If toJsonPath returns std::nullopt the backend falls back to the built-in dot-path resolution.

Constructor & Destructor Documentation

◆ ~IGroupPathResolver()

virtual PhosphorConfig::IGroupPathResolver::~IGroupPathResolver ( )
virtualdefault

◆ IGroupPathResolver()

PhosphorConfig::IGroupPathResolver::IGroupPathResolver ( )
protecteddefault

Member Function Documentation

◆ enumerate()

virtual QStringList PhosphorConfig::IGroupPathResolver::enumerate ( const QJsonObject &  ) const
inlinevirtual

Enumerate every external group name currently represented in the backing JSON document under this resolver's reserved keys.

Results are appended to IBackend::groupList() output.

◆ reservedRootKeys()

virtual QStringList PhosphorConfig::IGroupPathResolver::reservedRootKeys ( ) const
inlinevirtual

Extra top-level JSON keys that this resolver owns.

Excluded from the default dot-path enumeration so they don't appear twice in groupList().

◆ toJsonPath()

virtual std::optional< QStringList > PhosphorConfig::IGroupPathResolver::toJsonPath ( const QString &  groupName) const
pure virtual

Map an external group name to its JSON path segments.

Return std::nullopt to decline — the backend will use dot-path rules. Return an empty list to signal "malformed, refuse to read or write".


The documentation for this class was generated from the following file: