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

Definition at line 526 of file docparser.h.

527  :
528  m_type(t), m_pattern(pat), m_context(context),
530  m_isExample(isExample), m_exampleFile(exampleFile) { m_parent = parent; }
DocNode * parent() const
Definition: docparser.h:147
const bool FALSE
Definition: qglobal.h:370
DocNode * m_parent
Definition: docparser.h:163
bool isExample() const
Definition: docparser.h:541
QCString m_pattern
Definition: docparser.h:548
QCString m_context
Definition: docparser.h:549
bool m_isExample
Definition: docparser.h:552
QCString m_exampleFile
Definition: docparser.h:553

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.

536 { v->visit(this); }
virtual void visit(DocWord *)=0
QCString DocIncOperator::context ( ) const
inline

Definition at line 535 of file docparser.h.

535 { return m_context; }
QCString m_context
Definition: docparser.h:549
QCString DocIncOperator::exampleFile ( ) const
inline

Definition at line 542 of file docparser.h.

542 { return m_exampleFile; }
QCString m_exampleFile
Definition: docparser.h:553
bool DocIncOperator::isExample ( ) const
inline

Definition at line 541 of file docparser.h.

541 { return m_isExample; }
bool m_isExample
Definition: docparser.h:552
bool DocIncOperator::isFirst ( ) const
inline

Definition at line 537 of file docparser.h.

537 { return m_isFirst; }
bool DocIncOperator::isLast ( ) const
inline

Definition at line 538 of file docparser.h.

538 { return m_isLast; }
Kind DocIncOperator::kind ( ) const
inlinevirtual

Returns the kind of node. Provides runtime type information

Implements DocNode.

Definition at line 531 of file docparser.h.

void DocIncOperator::markFirst ( bool  v = TRUE)
inline

Definition at line 539 of file docparser.h.

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

Definition at line 540 of file docparser.h.

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

Definition at line 1939 of file docparser.cpp.

1940 {
1941  const char *p = g_includeFileText;
1944  DBG(("DocIncOperator::parse() text=%s off=%d len=%d\n",qPrint(p),o,l));
1945  uint so = o,bo;
1946  bool nonEmpty = FALSE;
1947  switch(type())
1948  {
1949  case Line:
1950  while (o<l)
1951  {
1952  char c = p[o];
1953  if (c=='\n')
1954  {
1955  if (nonEmpty) break; // we have a pattern to match
1956  so=o+1; // no pattern, skip empty line
1957  }
1958  else if (!isspace((uchar)c)) // no white space char
1959  {
1960  nonEmpty=TRUE;
1961  }
1962  o++;
1963  }
1964  if (g_includeFileText.mid(so,o-so).find(m_pattern)!=-1)
1965  {
1966  m_text = g_includeFileText.mid(so,o-so);
1967  DBG(("DocIncOperator::parse() Line: %s\n",qPrint(m_text)));
1968  }
1969  g_includeFileOffset = QMIN(l,o+1); // set pointer to start of new line
1970  break;
1971  case SkipLine:
1972  while (o<l)
1973  {
1974  so=o;
1975  while (o<l)
1976  {
1977  char c = p[o];
1978  if (c=='\n')
1979  {
1980  if (nonEmpty) break; // we have a pattern to match
1981  so=o+1; // no pattern, skip empty line
1982  }
1983  else if (!isspace((uchar)c)) // no white space char
1984  {
1985  nonEmpty=TRUE;
1986  }
1987  o++;
1988  }
1989  if (g_includeFileText.mid(so,o-so).find(m_pattern)!=-1)
1990  {
1991  m_text = g_includeFileText.mid(so,o-so);
1992  DBG(("DocIncOperator::parse() SkipLine: %s\n",qPrint(m_text)));
1993  break;
1994  }
1995  o++; // skip new line
1996  }
1997  g_includeFileOffset = QMIN(l,o+1); // set pointer to start of new line
1998  break;
1999  case Skip:
2000  while (o<l)
2001  {
2002  so=o;
2003  while (o<l)
2004  {
2005  char c = p[o];
2006  if (c=='\n')
2007  {
2008  if (nonEmpty) break; // we have a pattern to match
2009  so=o+1; // no pattern, skip empty line
2010  }
2011  else if (!isspace((uchar)c)) // no white space char
2012  {
2013  nonEmpty=TRUE;
2014  }
2015  o++;
2016  }
2017  if (g_includeFileText.mid(so,o-so).find(m_pattern)!=-1)
2018  {
2019  break;
2020  }
2021  o++; // skip new line
2022  }
2023  g_includeFileOffset = so; // set pointer to start of new line
2024  break;
2025  case Until:
2026  bo=o;
2027  while (o<l)
2028  {
2029  so=o;
2030  while (o<l)
2031  {
2032  char c = p[o];
2033  if (c=='\n')
2034  {
2035  if (nonEmpty) break; // we have a pattern to match
2036  so=o+1; // no pattern, skip empty line
2037  }
2038  else if (!isspace((uchar)c)) // no white space char
2039  {
2040  nonEmpty=TRUE;
2041  }
2042  o++;
2043  }
2044  if (g_includeFileText.mid(so,o-so).find(m_pattern)!=-1)
2045  {
2046  m_text = g_includeFileText.mid(bo,o-bo);
2047  DBG(("DocIncOperator::parse() Until: %s\n",qPrint(m_text)));
2048  break;
2049  }
2050  o++; // skip new line
2051  }
2052  g_includeFileOffset = QMIN(l,o+1); // set pointer to start of new line
2053  break;
2054  }
2055 }
Type type() const
Definition: docparser.h:532
static QCString g_includeFileText
Definition: docparser.cpp:107
#define DBG(x)
Definition: docparser.cpp:59
const bool FALSE
Definition: qglobal.h:370
int find(char c, int index=0, bool cs=TRUE) const
Definition: qcstring.cpp:41
static QStrList * l
Definition: config.cpp:1044
unsigned char uchar
Definition: nybbler.cc:11
#define QMIN(a, b)
Definition: qglobal.h:391
static uint g_includeFileLength
Definition: docparser.cpp:109
p
Definition: test.py:223
QCString m_pattern
Definition: docparser.h:548
QCString mid(uint index, uint len=0xffffffff) const
Definition: qcstring.cpp:246
QCString m_text
Definition: docparser.h:547
unsigned uint
Definition: qglobal.h:351
static uint g_includeFileOffset
Definition: docparser.cpp:108
const char * qPrint(const char *s)
Definition: qcstring.h:797
const bool TRUE
Definition: qglobal.h:371
QCString DocIncOperator::pattern ( ) const
inline

Definition at line 534 of file docparser.h.

534 { return m_pattern; }
QCString m_pattern
Definition: docparser.h:548
QCString DocIncOperator::text ( ) const
inline

Definition at line 533 of file docparser.h.

533 { return m_text; }
QCString m_text
Definition: docparser.h:547
Type DocIncOperator::type ( ) const
inline

Definition at line 532 of file docparser.h.

532 { return m_type; }

Member Data Documentation

QCString DocIncOperator::m_context
private

Definition at line 549 of file docparser.h.

QCString DocIncOperator::m_exampleFile
private

Definition at line 553 of file docparser.h.

bool DocIncOperator::m_isExample
private

Definition at line 552 of file docparser.h.

bool DocIncOperator::m_isFirst
private

Definition at line 550 of file docparser.h.

bool DocIncOperator::m_isLast
private

Definition at line 551 of file docparser.h.

QCString DocIncOperator::m_pattern
private

Definition at line 548 of file docparser.h.

QCString DocIncOperator::m_text
private

Definition at line 547 of file docparser.h.

Type DocIncOperator::m_type
private

Definition at line 546 of file docparser.h.


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