| Wireshark 4.7.3 The Wireshark network protocol analyzer

Loading...
Searching...
No Matches
Classes | Public Member Functions | List of all members
ThemeParser Class Reference

`#include <theme_parser.h>`

## Classes
struct | Result

## Public Member Functions
| ThemeParser (const QHash< QString, ThemeSectionInfo > &sections, const QHash< QString, ThemeManager::ThemeToken > &roleCache)
bool | parse (const QString &internalName, const QString &resourcePath, Result &out)

## Detailed Description

Companion parser for ThemeManager. Handles every aspect of reading a theme.jsonc file: comment stripping, JSON parsing, section/role/color decoding, graph colors, font hints. Has no opinion on palette application, derived tokens, stylesheets, or runtime mode — those remain ThemeManager's responsibility.

Constructed with const references to the section definitions and the role-name → ThemeToken cache owned by ThemeManager; never modifies them. A single ThemeParser instance can parse successive themes.

Private to the theme subsystem. Outside callers should go through ThemeManager.

## Member Function Documentation

## ◆ parse()

bool ThemeParser::parse | ( | const QString & | internalName,
|  | const QString & | resourcePath,
|  | Result & | out )

Reads and parses the theme JSONC at the given Qt resource path.

Parameters

  internalName | short name (e.g. "default"); stored on the result.
  resourcePath | full Qt resource URL (e.g. ":/themes/default/theme.jsonc").
  out | populated on success.

Returns
  true on a usable parse, false on a hard error (file missing, invalid JSON, required section missing).

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

- /builds/wireshark/wireshark/ui/qt/utils/themes/theme_parser.h
- /builds/wireshark/wireshark/ui/qt/utils/themes/theme_parser.cpp