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 |
| MD::FensedCodeSymbol | fensedCodeSymbol() const |
| bool | isFensedCode() const |
| bool | isInline() const |
| const QString & | markdownContent() const |
| void | setEndDelim(const MD::WithPosition &d) |
| void | setFensedCode(bool on = true) |
| void | setFensedCodeSymbol(MD::FensedCodeSymbol s) |
| void | setInline(bool on = true) |
| void | setMarkdownContent(const QString &v) |
| 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 Item::SharedPointer | clone(MD::Document *doc = nullptr) const override |
| virtual MD::ItemType | type() const override |
| virtual void | write(QTextStream &stream, MD::SerialiseHelper *helper) 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] Item::SharedPointer 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().
MD::FensedCodeSymbol Code::fensedCodeSymbol() const
Returns fensed code symbol.
See also setFensedCodeSymbol().
bool Code::isFensedCode() const
Returns whether this a fensed code block?
bool Code::isInline() const
Returns whether this code inline?
const QString &Code::markdownContent() const
Returns original Markdown content.
See also setMarkdownContent().
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::setFensedCodeSymbol(MD::FensedCodeSymbol s)
Set fensed code symbol.
s Symbol.
See also fensedCodeSymbol().
void Code::setInline(bool on = true)
Set this code to be inline.
on New value.
See also isInline().
void Code::setMarkdownContent(const QString &v)
Set original Markdown content.
v New value.
See also markdownContent().
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.
[override virtual] void Code::write(QTextStream &stream, MD::SerialiseHelper *helper) const
Reimplements: Item::write(QTextStream &stream, MD::SerialiseHelper *helper) const.
Serialise item into Markdown.
stream Stream.
helper Serialisation helper.