MD::Code Class
class MD::CodeCode. More...
| Header: | #include <md4qt/doc.h> |
| CMake: | find_package(md4qt REQUIRED COMPONENTS md4qt)target_link_libraries(mytarget PRIVATE md4qt::md4qt) |
| Inherits: | MD::ItemWithOpts |
| Inherited By: |
Public Functions
| Code(const QString &t, bool fensedCode, bool inl) | |
| void | applyCode(const MD::Code &other) |
| const MD::WithPosition & | endDelim() const |
| bool | isFensedCode() const |
| bool | isInline() const |
| void | setEndDelim(const MD::WithPosition &d) |
| void | setFensedCode(bool on = true) |
| void | setInline(bool on = true) |
| void | setStartDelim(const MD::WithPosition &d) |
| void | setSyntax(const QString &s) |
| void | setSyntaxPos(const MD::WithPosition &p) |
| void | setText(const QString &t) |
| const MD::WithPosition & | startDelim() const |
| const QString & | syntax() const |
| const MD::WithPosition & | syntaxPos() const |
| const QString & | text() const |
Reimplemented Public Functions
| virtual QSharedPointer<MD::Item> | clone(MD::Document *doc = nullptr) const override |
| virtual MD::ItemType | type() const override |
Detailed Description
Block of code in Markdown. Used not only for fenced code blocks, indented code blocks, but for code spans too.
Member Function Documentation
Code::Code(const QString &t, bool fensedCode, bool inl)
Initializing constructor.
t Code's text.
fensedCode Whether this code is a fensed code block.
inl Whether this code is an inline code.
void Code::applyCode(const MD::Code &other)
Apply other code to this.
other Value to apply.
[override virtual] QSharedPointer<MD::Item> Code::clone(MD::Document *doc = nullptr) const
Reimplements: Item::clone(MD::Document *doc) const.
Clone this code.
doc Parent of new item.
const MD::WithPosition &Code::endDelim() const
Returns position of the ending service characters.
See also setEndDelim().
bool Code::isFensedCode() const
Returns whether this a fensed code block?
bool Code::isInline() const
Returns whether this code inline?
void Code::setEndDelim(const MD::WithPosition &d)
Set position of the ending service characters.
d New value.
See also endDelim().
void Code::setFensedCode(bool on = true)
Set this code block to be a fensed code block.
on New value.
See also isFensedCode().
void Code::setInline(bool on = true)
Set this code to be inline.
on New value.
See also isInline().
void Code::setStartDelim(const MD::WithPosition &d)
Set position of the start service characters.
d New value.
See also startDelim().
void Code::setSyntax(const QString &s)
Set syntax of the fensed code block.
s New value.
See also syntax().
void Code::setSyntaxPos(const MD::WithPosition &p)
Set position of the syntax of the fensed code block.
p New value.
See also syntaxPos().
void Code::setText(const QString &t)
Set content of the code.
t New value.
See also text().
const MD::WithPosition &Code::startDelim() const
Returns position of the start service characters.
See also setStartDelim().
const QString &Code::syntax() const
Returns syntax of the fensed code block.
See also setSyntax().
const MD::WithPosition &Code::syntaxPos() const
Returns position of the syntax of the fensed code block.
See also setSyntaxPos().
const QString &Code::text() const
Returns content of the code.
See also setText().
[override virtual] MD::ItemType Code::type() const
Reimplements: Item::type() const.
Returns type of the item.