MD::ReverseSolidusHandler Class

class MD::ReverseSolidusHandler

Helper for process reverse solidus characters. More...

Header: #include <md4qt/reverse_solidus.h>
CMake: find_package(md4qt REQUIRED COMPONENTS md4qt)
target_link_libraries(mytarget PRIVATE md4qt::md4qt)

Public Functions

void clear()
bool isEscaped(const QChar &ch, bool additionalRule = true)
bool isNotEscaped(const QChar &ch, bool additionalRule = true)
bool isPrevReverseSolidus() const
void next()
bool process(const QChar &ch, bool additionalRule = true)

Detailed Description

Simplifier for algorithms that handles reverse solidus characters.

Member Function Documentation

void ReverseSolidusHandler::clear()

Clear state.

bool ReverseSolidusHandler::isEscaped(const QChar &ch, bool additionalRule = true)

Combination of processing of current character and checking that previous was a reverse solidus character.

Returns true if current character WAS NOT recognized as reverse solidus and previous character WAS a reverse solidus (i.e escaped and not reverse solidus), false otherwise.

ch Current character.

additionalRule Additional boolean value that should be true to recognize current character as reverse solidus.

bool ReverseSolidusHandler::isNotEscaped(const QChar &ch, bool additionalRule = true)

Combination of processing of current character and checking that previous WAS NOT a reverse solidus character.

Returns true if current character WAS NOT recognized as reverse solidus and previous character WAS NOT a reverse solidus (i.e not escaped and not reverse solidus), false otherwise.

ch Current character.

additionalRule Additional boolean value that should be true to recognize current character as reverse solidus.

bool ReverseSolidusHandler::isPrevReverseSolidus() const

Return whether previous character was reverse solidus.

void ReverseSolidusHandler::next()

Should be invoked after processing of current character and all logic with current character.

bool ReverseSolidusHandler::process(const QChar &ch, bool additionalRule = true)

Process current character.

Returns true if current character was recognized as reverse solidus, false otherwise.

ch Current character.

additionalRule Additional boolean value that should be true to recognize current character as reverse solidus.