StyleRule.h header

#include <ew/app/StyleRule.h>

Namespace ew::app

StyleRule class

class ew::app::StyleRule

A single writing-style check. Given a run of text it returns zero or more diagnostics, each flagging a span with an explanation. Rules are stateless, reusable, and independent of one another, so a StyleAnalyzer can run them in any order; a "style profile" is simply which rules the analyzer holds.

Members

ew::app::StyleRule::StyleRule()=default

Defaulted.

virtual ew::app::StyleRule::~StyleRule()=default

Defaulted.

ew::app::StyleRule::StyleRule(const StyleRule &)=delete

Not copyable.

ew::app::StyleRule::StyleRule(StyleRule &&)=delete

Not movable.

StyleRule & ew::app::StyleRule::operator=(const StyleRule &)=delete

Not copyable.

StyleRule & ew::app::StyleRule::operator=(StyleRule &&)=delete

Not movable.

virtual QString ew::app::StyleRule::id() const =0

A stable identifier for this rule (e.g. "repeated-word"), used to enable or disable it in a profile and to refer to it in tests.

virtual StyleCategory ew::app::StyleRule::category() const =0

The category of issue this rule reports.

virtual std::vector< StyleDiagnostic > ew::app::StyleRule::analyze(QStringView text) const =0

Returns every issue this rule finds in text, with offsets measured into text.