Doxygen
Loading...
Searching...
No Matches
DocInclude Class Reference

Node representing an included text block from file. More...

#include <src/docnode.h>

+ Inheritance diagram for DocInclude:
+ Collaboration diagram for DocInclude:

Public Types

enum  Type {
  Include , DontInclude , VerbInclude , HtmlInclude ,
  LatexInclude , IncWithLines , Snippet , SnippetWithLines ,
  DontIncWithLines , RtfInclude , ManInclude , DocbookInclude ,
  XmlInclude
}
 

Public Member Functions

 DocInclude (DocParser *parser, DocNodeVariant *parent, const QCString &file, const QCString &context, Type t, bool stripCodeComments, bool isExample, const QCString &exampleFile, const QCString &blockId, bool isBlock, bool trimLeft)
 
QCString file () const
 
QCString extension () const
 
Type type () const
 
QCString text () const
 
QCString context () const
 
QCString blockId () const
 
bool stripCodeComments () const
 
bool isExample () const
 
QCString exampleFile () const
 
bool isBlock () const
 
bool trimLeft () const
 
void parse ()
 
- Public Member Functions inherited from DocNode
 DocNode (DocParser *parser, DocNodeVariant *parent)
 
 ~DocNode ()=default
 
DocNodeVariantparent ()
 
const DocNodeVariantparent () const
 
DocNodeVariantthisVariant ()
 
const DocNodeVariantthisVariant () const
 
void setThisVariant (DocNodeVariant *thisVariant)
 
DocParserparser ()
 
const DocParserparser () const
 
void setParent (DocNodeVariant *parent)
 
bool isPreformatted () const
 

Private Attributes

QCString m_file
 
QCString m_context
 
QCString m_text
 
Type m_type
 
bool m_stripCodeComments
 
bool m_isExample
 
bool m_isBlock
 
bool m_trimLeft
 
QCString m_exampleFile
 
QCString m_blockId
 

Additional Inherited Members

- Protected Types inherited from DocNode
enum  RefType { Unknown , Anchor , Section , Table }
 
- Protected Member Functions inherited from DocNode
void setInsidePreformatted (bool p)
 

Detailed Description

Node representing an included text block from file.

Definition at line 429 of file docnode.h.

Member Enumeration Documentation

◆ Type

Enumerator
Include 
DontInclude 
VerbInclude 
HtmlInclude 
LatexInclude 
IncWithLines 
Snippet 
SnippetWithLines 
DontIncWithLines 
RtfInclude 
ManInclude 
DocbookInclude 
XmlInclude 

Definition at line 432 of file docnode.h.

Constructor & Destructor Documentation

◆ DocInclude()

DocInclude::DocInclude ( DocParser * parser,
DocNodeVariant * parent,
const QCString & file,
const QCString & context,
Type t,
bool stripCodeComments,
bool isExample,
const QCString & exampleFile,
const QCString & blockId,
bool isBlock,
bool trimLeft )
inline

Definition at line 436 of file docnode.h.

QCString blockId() const
Definition docnode.h:449
bool m_trimLeft
Definition docnode.h:465
QCString m_context
Definition docnode.h:459
bool isBlock() const
Definition docnode.h:453
Type m_type
Definition docnode.h:461
bool m_isExample
Definition docnode.h:463
bool m_isBlock
Definition docnode.h:464
bool stripCodeComments() const
Definition docnode.h:450
QCString m_blockId
Definition docnode.h:467
QCString exampleFile() const
Definition docnode.h:452
bool m_stripCodeComments
Definition docnode.h:462
QCString file() const
Definition docnode.h:444
QCString m_exampleFile
Definition docnode.h:466
bool trimLeft() const
Definition docnode.h:454
bool isExample() const
Definition docnode.h:451
QCString context() const
Definition docnode.h:448
QCString m_file
Definition docnode.h:458
DocNode(DocParser *parser, DocNodeVariant *parent)
Definition docnode.h:84
DocParser * parser()
Definition docnode.h:97
DocNodeVariant * parent()
Definition docnode.h:89

References blockId(), context(), DocNode::DocNode(), exampleFile(), file(), isBlock(), isExample(), m_blockId, m_context, m_exampleFile, m_file, m_isBlock, m_isExample, m_stripCodeComments, m_trimLeft, m_type, DocNode::parent(), DocNode::parser(), stripCodeComments(), and trimLeft().

Member Function Documentation

◆ blockId()

◆ context()

◆ exampleFile()

◆ extension()

QCString DocInclude::extension ( ) const
inline

Definition at line 445 of file docnode.h.

445{ int i=m_file.findRev('.'); return i!=-1 ? m_file.mid(i) : QCString(); }

References m_file.

Referenced by DocbookDocVisitor::operator()(), HtmlDocVisitor::operator()(), LatexDocVisitor::operator()(), ManDocVisitor::operator()(), RTFDocVisitor::operator()(), and XmlDocVisitor::operator()().

◆ file()

◆ isBlock()

bool DocInclude::isBlock ( ) const
inline

Definition at line 453 of file docnode.h.

453{ return m_isBlock; }

References m_isBlock.

Referenced by DocInclude(), HtmlDocVisitor::operator()(), PrintDocVisitor::operator()(), and XmlDocVisitor::operator()().

◆ isExample()

◆ parse()

void DocInclude::parse ( )

Definition at line 267 of file docnode.cpp.

268{
269 AUTO_TRACE("file={} text={}",m_file,Trace::trunc(m_text));
270 switch(m_type)
271 {
272 case DontIncWithLines:
273 // fall through
274 case IncWithLines:
275 // fall through
276 case Include:
277 // fall through
278 case DontInclude:
287 //printf("parser->context.includeFile=<<%s>>\n",qPrint(parser->context.includeFileText));
288 break;
289 case VerbInclude:
290 // fall through
291 case HtmlInclude:
292 case LatexInclude:
298 break;
299 case Snippet:
300 case SnippetWithLines:
302 // check here for the existence of the blockId inside the file, so we
303 // only generate the warning once.
304 int count = 0;
305 if (!m_blockId.isEmpty() && (count=m_text.contains(m_blockId.data()))!=2)
306 {
307 warn_doc_error(parser()->context.fileName,
308 parser()->tokenizer.getLineNr(),
309 "block marked with %s for \\snippet should appear twice in file %s, found it %d times",
310 qPrint(m_blockId),qPrint(m_file),count);
311 }
312 break;
313 }
314}
QCString m_text
Definition docnode.h:460
void readTextFileByName(const QCString &file, QCString &text)
DocParserContext context
#define AUTO_TRACE(...)
Definition docnode.cpp:46
#define warn_doc_error(file, line, fmt,...)
Definition message.h:74
QCString trunc(const QCString &s, size_t numChars=15)
Definition trace.h:56
const char * qPrint(const char *s)
Definition qcstring.h:672
bool includeFileShowLineNo
Definition docparser_p.h:89
size_t includeFileLength
Definition docparser_p.h:87
QCString includeFileText
Definition docparser_p.h:85
QCString includeFileName
Definition docparser_p.h:84
size_t includeFileOffset
Definition docparser_p.h:86

References AUTO_TRACE, context(), DocParser::context, DocbookInclude, DontInclude, DontIncWithLines, HtmlInclude, Include, DocParserContext::includeFileLength, DocParserContext::includeFileLine, DocParserContext::includeFileName, DocParserContext::includeFileOffset, DocParserContext::includeFileShowLineNo, DocParserContext::includeFileText, IncWithLines, LatexInclude, m_blockId, m_file, m_stripCodeComments, m_text, m_type, ManInclude, DocNode::parser(), qPrint(), DocParser::readTextFileByName(), RtfInclude, Snippet, SnippetWithLines, DocParserContext::stripCodeComments, Trace::trunc(), VerbInclude, warn_doc_error, and XmlInclude.

◆ stripCodeComments()

◆ text()

◆ trimLeft()

◆ type()

Member Data Documentation

◆ m_blockId

QCString DocInclude::m_blockId
private

Definition at line 467 of file docnode.h.

Referenced by blockId(), DocInclude(), and parse().

◆ m_context

QCString DocInclude::m_context
private

Definition at line 459 of file docnode.h.

Referenced by context(), and DocInclude().

◆ m_exampleFile

QCString DocInclude::m_exampleFile
private

Definition at line 466 of file docnode.h.

Referenced by DocInclude(), and exampleFile().

◆ m_file

QCString DocInclude::m_file
private

Definition at line 458 of file docnode.h.

Referenced by DocInclude(), extension(), file(), and parse().

◆ m_isBlock

bool DocInclude::m_isBlock
private

Definition at line 464 of file docnode.h.

Referenced by DocInclude(), and isBlock().

◆ m_isExample

bool DocInclude::m_isExample
private

Definition at line 463 of file docnode.h.

Referenced by DocInclude(), and isExample().

◆ m_stripCodeComments

bool DocInclude::m_stripCodeComments
private

Definition at line 462 of file docnode.h.

Referenced by DocInclude(), parse(), and stripCodeComments().

◆ m_text

QCString DocInclude::m_text
private

Definition at line 460 of file docnode.h.

Referenced by parse(), and text().

◆ m_trimLeft

bool DocInclude::m_trimLeft
private

Definition at line 465 of file docnode.h.

Referenced by DocInclude(), and trimLeft().

◆ m_type

Type DocInclude::m_type
private

Definition at line 461 of file docnode.h.

Referenced by DocInclude(), parse(), and type().


The documentation for this class was generated from the following files: