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
DocIncOperator Class Reference

#include <docparser.h>

Inheritance diagram for DocIncOperator:
DocNode

Public Types

enum  Type { Line, SkipLine, Skip, Until }
 
- 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

 DocIncOperator (DocNode *parent, Type t, const QCString &pat, const QCString &context, bool isExample, const QCString &exampleFile)
 
Kind kind () const
 
Type type () const
 
QCString text () const
 
QCString pattern () const
 
QCString context () const
 
void accept (DocVisitor *v)
 
bool isFirst () const
 
bool isLast () const
 
void markFirst (bool v=TRUE)
 
void markLast (bool v=TRUE)
 
bool isExample () const
 
QCString exampleFile () const
 
void parse ()
 
- Public Member Functions inherited from DocNode
 DocNode ()
 
virtual ~DocNode ()
 
DocNodeparent () const
 
void setParent (DocNode *parent)
 
bool isPreformatted () const
 

Private Attributes

Type m_type
 
QCString m_text
 
QCString m_pattern
 
QCString m_context
 
bool m_isFirst
 
bool m_isLast
 
bool m_isExample
 
QCString m_exampleFile
 

Additional Inherited Members

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

Detailed Description

Node representing a include/dontinclude operator block

Definition at line 522 of file docparser.h.

Member Enumeration Documentation

Enumerator
Line 
SkipLine 
Skip 
Until 

Definition at line 525 of file docparser.h.

Constructor & Destructor Documentation

DocIncOperator::DocIncOperator ( DocNode parent,
Type  t,
const QCString &  pat,
const QCString &  context,
bool  isExample,
const QCString &  exampleFile 
)
inline

Member Function Documentation

void DocIncOperator::accept ( DocVisitor v)
inlinevirtual

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

Parameters
vAbstract visitor.

Implements DocNode.

Definition at line 536 of file docparser.h.

References DocVisitor::visit().

{ v->visit(this); }
QCString DocIncOperator::context ( ) const
inline
QCString DocIncOperator::exampleFile ( ) const
inline
bool DocIncOperator::isExample ( ) const
inline
bool DocIncOperator::isFirst ( ) const
inline
bool DocIncOperator::isLast ( ) const
inline
Kind DocIncOperator::kind ( ) const
inlinevirtual

Returns the kind of node. Provides runtime type information

Implements DocNode.

Definition at line 531 of file docparser.h.

References DocNode::Kind_IncOperator.

{ return Kind_IncOperator; }
void DocIncOperator::markFirst ( bool  v = TRUE)
inline

Definition at line 539 of file docparser.h.

References m_isFirst.

Referenced by DocPara::handleIncludeOperator().

{ m_isFirst = v; }
void DocIncOperator::markLast ( bool  v = TRUE)
inline

Definition at line 540 of file docparser.h.

References m_isLast.

Referenced by DocPara::handleIncludeOperator().

{ m_isLast = v; }
void DocIncOperator::parse ( )

Definition at line 1954 of file docparser.cpp.

References DBG, g_includeFileLength, g_includeFileOffset, g_includeFileText, Line, m_pattern, m_text, Skip, SkipLine, type(), and Until.

Referenced by DocPara::handleIncludeOperator().

{
const char *p = g_includeFileText;
DBG(("DocIncOperator::parse() text=%s off=%d len=%d\n",qPrint(p),o,l));
uint so = o,bo;
bool nonEmpty = FALSE;
switch(type())
{
case Line:
while (o<l)
{
char c = p[o];
if (c=='\n')
{
if (nonEmpty) break; // we have a pattern to match
so=o+1; // no pattern, skip empty line
}
else if (!isspace((uchar)c)) // no white space char
{
nonEmpty=TRUE;
}
o++;
}
if (g_includeFileText.mid(so,o-so).find(m_pattern)!=-1)
{
m_text = g_includeFileText.mid(so,o-so);
DBG(("DocIncOperator::parse() Line: %s\n",qPrint(m_text)));
}
g_includeFileOffset = QMIN(l,o+1); // set pointer to start of new line
break;
case SkipLine:
while (o<l)
{
so=o;
while (o<l)
{
char c = p[o];
if (c=='\n')
{
if (nonEmpty) break; // we have a pattern to match
so=o+1; // no pattern, skip empty line
}
else if (!isspace((uchar)c)) // no white space char
{
nonEmpty=TRUE;
}
o++;
}
if (g_includeFileText.mid(so,o-so).find(m_pattern)!=-1)
{
m_text = g_includeFileText.mid(so,o-so);
DBG(("DocIncOperator::parse() SkipLine: %s\n",qPrint(m_text)));
break;
}
o++; // skip new line
}
g_includeFileOffset = QMIN(l,o+1); // set pointer to start of new line
break;
case Skip:
while (o<l)
{
so=o;
while (o<l)
{
char c = p[o];
if (c=='\n')
{
if (nonEmpty) break; // we have a pattern to match
so=o+1; // no pattern, skip empty line
}
else if (!isspace((uchar)c)) // no white space char
{
nonEmpty=TRUE;
}
o++;
}
if (g_includeFileText.mid(so,o-so).find(m_pattern)!=-1)
{
break;
}
o++; // skip new line
}
g_includeFileOffset = so; // set pointer to start of new line
break;
case Until:
bo=o;
while (o<l)
{
so=o;
while (o<l)
{
char c = p[o];
if (c=='\n')
{
if (nonEmpty) break; // we have a pattern to match
so=o+1; // no pattern, skip empty line
}
else if (!isspace((uchar)c)) // no white space char
{
nonEmpty=TRUE;
}
o++;
}
if (g_includeFileText.mid(so,o-so).find(m_pattern)!=-1)
{
m_text = g_includeFileText.mid(bo,o-bo);
DBG(("DocIncOperator::parse() Until: %s\n",qPrint(m_text)));
break;
}
o++; // skip new line
}
g_includeFileOffset = QMIN(l,o+1); // set pointer to start of new line
break;
}
}
QCString DocIncOperator::pattern ( ) const
inline

Definition at line 534 of file docparser.h.

References m_pattern.

Referenced by PrintDocVisitor::visit().

{ return m_pattern; }
QCString DocIncOperator::text ( ) const
inline
Type DocIncOperator::type ( ) const
inline

Member Data Documentation

QCString DocIncOperator::m_context
private

Definition at line 549 of file docparser.h.

Referenced by context().

QCString DocIncOperator::m_exampleFile
private

Definition at line 553 of file docparser.h.

Referenced by exampleFile().

bool DocIncOperator::m_isExample
private

Definition at line 552 of file docparser.h.

Referenced by isExample().

bool DocIncOperator::m_isFirst
private

Definition at line 550 of file docparser.h.

Referenced by isFirst(), and markFirst().

bool DocIncOperator::m_isLast
private

Definition at line 551 of file docparser.h.

Referenced by isLast(), and markLast().

QCString DocIncOperator::m_pattern
private

Definition at line 548 of file docparser.h.

Referenced by parse(), and pattern().

QCString DocIncOperator::m_text
private

Definition at line 547 of file docparser.h.

Referenced by parse(), and text().

Type DocIncOperator::m_type
private

Definition at line 546 of file docparser.h.

Referenced by type().


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