My Project
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Types | Public Member Functions | Private Attributes | List of all members
DocInclude Class Reference

#include <docparser.h>

Inheritance diagram for DocInclude:
DocNode

Public Types

enum  Type {
  Include, DontInclude, VerbInclude, HtmlInclude,
  LatexInclude, IncWithLines, Snippet, IncludeDoc,
  SnippetDoc
}
 
- Public Types inherited from DocNode
enum  Kind {
  Kind_Root = 0, Kind_Word = 1, Kind_WhiteSpace = 2, Kind_Para = 3,
  Kind_AutoList = 4, Kind_AutoListItem = 5, Kind_Symbol = 6, Kind_URL = 7,
  Kind_StyleChange = 8, Kind_SimpleSect = 9, Kind_Title = 10, Kind_SimpleList = 11,
  Kind_SimpleListItem = 12, Kind_Section = 13, Kind_Verbatim = 14, Kind_XRefItem = 15,
  Kind_HtmlList = 16, Kind_HtmlListItem = 17, Kind_HtmlDescList = 18, Kind_HtmlDescData = 19,
  Kind_HtmlDescTitle = 20, Kind_HtmlTable = 21, Kind_HtmlRow = 22, Kind_HtmlCell = 23,
  Kind_HtmlCaption = 24, Kind_LineBreak = 25, Kind_HorRuler = 26, Kind_Anchor = 27,
  Kind_IndexEntry = 28, Kind_Internal = 29, Kind_HRef = 30, Kind_Include = 31,
  Kind_IncOperator = 32, Kind_HtmlHeader = 33, Kind_Image = 34, Kind_DotFile = 35,
  Kind_Link = 36, Kind_Ref = 37, Kind_Formula = 38, Kind_SecRefItem = 39,
  Kind_SecRefList = 40, Kind_SimpleSectSep = 41, Kind_LinkedWord = 42, Kind_ParamSect = 43,
  Kind_ParamList = 44, Kind_InternalRef = 45, Kind_Copy = 46, Kind_Text = 47,
  Kind_MscFile = 48, Kind_HtmlBlockQuote = 49, Kind_VhdlFlow = 50, Kind_ParBlock = 51,
  Kind_DiaFile = 52
}
 

Public Member Functions

 DocInclude (DocNode *parent, const QCString &file, const QCString context, Type t, bool isExample, const QCString exampleFile, const QCString blockId)
 
Kind kind () const
 
QCString file () const
 
QCString extension () const
 
Type type () const
 
QCString text () const
 
QCString context () const
 
QCString blockId () const
 
bool isExample () const
 
QCString exampleFile () const
 
void accept (DocVisitor *v)
 
void parse ()
 
- Public Member Functions inherited from DocNode
 DocNode ()
 
virtual ~DocNode ()
 
DocNodeparent () const
 
void setParent (DocNode *parent)
 
bool isPreformatted () const
 

Private Attributes

QCString m_file
 
QCString m_context
 
QCString m_text
 
Type m_type
 
bool m_isExample
 
QCString m_exampleFile
 
QCString m_blockId
 

Additional Inherited Members

- Protected Member Functions inherited from DocNode
void setInsidePreformatted (bool p)
 
- Protected Attributes inherited from DocNode
DocNodem_parent
 

Detailed Description

Node representing an included text block from file

Definition at line 483 of file docparser.h.

Member Enumeration Documentation

Enumerator
Include 
DontInclude 
VerbInclude 
HtmlInclude 
LatexInclude 
IncWithLines 
Snippet 
IncludeDoc 
SnippetDoc 

Definition at line 486 of file docparser.h.

Constructor & Destructor Documentation

DocInclude::DocInclude ( DocNode parent,
const QCString &  file,
const QCString  context,
Type  t,
bool  isExample,
const QCString  exampleFile,
const QCString  blockId 
)
inline

Member Function Documentation

void DocInclude::accept ( DocVisitor v)
inlinevirtual

Acceptor function for node visitors. Part of the visitor pattern.

Parameters
vAbstract visitor.

Implements DocNode.

Definition at line 508 of file docparser.h.

References DocVisitor::visit().

{ v->visit(this); }
QCString DocInclude::blockId ( ) const
inline
QCString DocInclude::context ( ) const
inline
QCString DocInclude::exampleFile ( ) const
inline
QCString DocInclude::extension ( ) const
inline

Definition at line 496 of file docparser.h.

References m_file.

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

{ int i=m_file.findRev('.');
if (i!=-1)
return m_file.right(m_file.length()-i);
else
return "";
}
QCString DocInclude::file ( ) const
inline
bool DocInclude::isExample ( ) const
inline
Kind DocInclude::kind ( ) const
inlinevirtual

Returns the kind of node. Provides runtime type information

Implements DocNode.

Definition at line 494 of file docparser.h.

References DocNode::Kind_Include.

{ return Kind_Include; }
void DocInclude::parse ( )

Definition at line 1909 of file docparser.cpp.

References DBG, doctokenizerYYlineno, DontInclude, err(), g_fileName, g_includeFileLength, g_includeFileOffset, g_includeFileText, HtmlInclude, Include, IncludeDoc, IncWithLines, LatexInclude, m_blockId, m_file, m_text, m_type, readTextFileByName(), Snippet, SnippetDoc, VerbInclude, and warn_doc_error().

Referenced by DocPara::handleInclude().

{
DBG(("DocInclude::parse(file=%s,text=%s)\n",qPrint(m_file),qPrint(m_text)));
switch(m_type)
{
// fall through
case Include:
// fall through
//printf("g_includeFile=<<%s>>\n",g_includeFileText.data());
break;
case VerbInclude:
// fall through
break;
break;
case Snippet:
// check here for the existence of the blockId inside the file, so we
// only generate the warning once.
int count;
if (!m_blockId.isEmpty() && (count=m_text.contains(m_blockId.data()))!=2)
{
warn_doc_error(g_fileName,doctokenizerYYlineno,"block marked with %s for \\snippet should appear twice in file %s, found it %d times\n",
m_blockId.data(),m_file.data(),count);
}
break;
err("Internal inconsistency: found switch SnippetDoc / IncludeDoc in file: %s"
"Please create a bug report\n",__FILE__);
break;
}
}
QCString DocInclude::text ( ) const
inline
Type DocInclude::type ( ) const
inline

Member Data Documentation

QCString DocInclude::m_blockId
private

Definition at line 518 of file docparser.h.

Referenced by blockId(), and parse().

QCString DocInclude::m_context
private

Definition at line 513 of file docparser.h.

Referenced by context().

QCString DocInclude::m_exampleFile
private

Definition at line 517 of file docparser.h.

Referenced by exampleFile().

QCString DocInclude::m_file
private

Definition at line 512 of file docparser.h.

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

bool DocInclude::m_isExample
private

Definition at line 516 of file docparser.h.

Referenced by isExample().

QCString DocInclude::m_text
private

Definition at line 514 of file docparser.h.

Referenced by parse(), and text().

Type DocInclude::m_type
private

Definition at line 515 of file docparser.h.

Referenced by parse(), and type().


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