| Wireshark 4.7.3 The Wireshark network protocol analyzer

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

FilterValidator for Wireshark display filters. More...

`#include <display_filter_validator.h>`

Inheritance diagram for DisplayFilterValidator:

## Public Member Functions
| DisplayFilterValidator (QObject *parent=nullptr)
QValidator::State | validate (QString &input, int &pos) const override
| Validates `input` and updates the stashed Detail.
Detail | lastDetail () const override
| Returns the Detail produced by the most recent validate() call.
Public Member Functions inherited from FilterValidator
| FilterValidator (QObject *parent=nullptr)
QString | lastError () const
| Short error message from the last validation (Detail::errMsg).
QString | lastErrorFull (const QString &filter) const
| Full, location-annotated error message for `filter`.
QString | deprecatedToken () const
| The deprecated token from the last validation, or empty.

## Additional Inherited Members
Static Public Member Functions inherited from FilterValidator
static QString | createSyntaxErrorMessageFull (const QString &filter, const QString &err_msg, qsizetype loc_start, size_t loc_length)
| Builds a full, location-annotated error string.

## Detailed Description

FilterValidator for Wireshark display filters.

validate() compiles the expression with dfilter_compile_full() and maps the result to the FilterEdit syntax states:

- empty -> Acceptable (host shows Empty, no tint)
- compiles cleanly -> Acceptable (Valid)
- compiles with a warning or a deprecated token -> Acceptable with a non-empty Detail::deprecatedToken (host shows Deprecated/amber)
- fails with DF_ERROR_UNEXPECTED_END -> Intermediate (still typing; never red)
- fails otherwise -> Invalid, with the error message and location stashed in Detail so the host can render lastErrorFull().

Synchronous, like the capture validator: it runs on the host widget's debounce and reads lastDetail() immediately afterwards.

## Member Function Documentation

## ◆ lastDetail()

Detail DisplayFilterValidator::lastDetail | ( |  | ) | const
| inline override virtual

Returns the Detail produced by the most recent validate() call.

Implements FilterValidator.

## ◆ validate()

QValidator::State DisplayFilterValidator::validate | ( | QString & | input,
|  | int & | pos ) const
| override virtual

Validates `input` and updates the stashed Detail.

Parameters

  input | The text to validate; may be normalised in place.
  pos | In/out cursor position.

Returns
  Invalid, Intermediate, or Acceptable.

Implements FilterValidator.

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

- /builds/wireshark/wireshark/ui/qt/models/display_filter_validator.h
- /builds/wireshark/wireshark/ui/qt/models/display_filter_validator.cpp