LogViewer
A modern log viewer with AI-assisted analysis (Qt 6)
Loading...
Searching...
No Matches
ui::qt::ActorKey Struct Reference

Type-safe composite key identifying a single actor row in ActorsPanel. More...

#include <ActorDefinition.hpp>

Collaboration diagram for ui::qt::ActorKey:
Collaboration graph

Static Public Member Functions

static std::string Encode (std::string_view defName, std::string_view actorName)
 Encodes defName and actorName into a single opaque key string.
 
static ActorKey Decode (const std::string &key)
 

Public Attributes

std::string defName
 Name of the owning ActorDefinition.
 
std::string actorName
 Matched actor name (or capture-group value)
 

Detailed Description

Type-safe composite key identifying a single actor row in ActorsPanel.

An actor row is uniquely identified by the pair *(definition name, actor name)*. The keys are stored in ActorsPanel::m_uncheckedActors and FilterProfile::uncheckedActors as plain strings so that they can be serialised to JSON without extra ceremony.

Encoding format

The two components are joined with a NUL character (\\0) which cannot appear in either name (names come from QRegularExpression capture groups and user-entered strings, neither of which allows NUL).

Usage
// Build a key from two strings:
std::string key = ActorKey::Encode("MyDef", "Server");
// Decompose a stored key:
static ActorKey Decode(const std::string &key)
Definition ActorDefinition.hpp:144
std::string defName
Name of the owning ActorDefinition.
Definition ActorDefinition.hpp:127
std::string actorName
Matched actor name (or capture-group value)
Definition ActorDefinition.hpp:128
static std::string Encode(std::string_view defName, std::string_view actorName)
Encodes defName and actorName into a single opaque key string.
Definition ActorDefinition.hpp:131

Member Function Documentation

◆ Decode()

static ActorKey ui::qt::ActorKey::Decode ( const std::string &  key)
inlinestatic

Decodes an opaque key string produced by Encode(). Returns a default-constructed ActorKey if key is malformed.

◆ Encode()

static std::string ui::qt::ActorKey::Encode ( std::string_view  defName,
std::string_view  actorName 
)
inlinestatic

Encodes defName and actorName into a single opaque key string.

Here is the caller graph for this function:

Member Data Documentation

◆ actorName

std::string ui::qt::ActorKey::actorName

Matched actor name (or capture-group value)

◆ defName

std::string ui::qt::ActorKey::defName

Name of the owning ActorDefinition.


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