StyleAnalyzer.h header
#include <ew/app/StyleAnalyzer.h>
Namespace ew::app
StyleAnalyzer class
class ew::app::StyleAnalyzer
Runs a set of style rules over text and returns their combined diagnostics. The analyzer owns its rules, so a "style profile" is just the set of rules it holds; defaultProfile() builds one preloaded with the standard rule set.
Members
ew::app::StyleAnalyzer::StyleAnalyzer()
Constructs an empty analyzer holding no rules.
ew::app::StyleAnalyzer::~StyleAnalyzer()
Destroys the analyzer and the rules it owns.
ew::app::StyleAnalyzer::StyleAnalyzer(const StyleAnalyzer &)=delete
Not copyable.
ew::app::StyleAnalyzer::StyleAnalyzer(StyleAnalyzer &&) noexcept
Move-constructible.
StyleAnalyzer & ew::app::StyleAnalyzer::operator=(const StyleAnalyzer &)=delete
Not copyable.
StyleAnalyzer & ew::app::StyleAnalyzer::operator=(StyleAnalyzer &&) noexcept
Move-assignable.
void ew::app::StyleAnalyzer::addRule(std::unique_ptr< StyleRule > rule)
Adds rule to the set this analyzer runs; a null rule is ignored.
std::size_t ew::app::StyleAnalyzer::ruleCount() const
Returns the number of rules currently held.
std::vector< StyleDiagnostic > ew::app::StyleAnalyzer::analyze(QStringView text) const
Runs every rule over text and returns all diagnostics ordered by offset (ties broken by the shorter span first), so callers can present them in reading order.
static StyleAnalyzer ew::app::StyleAnalyzer::defaultProfile()
Builds an analyzer preloaded with the standard rule set.