Doxygen
DocIncOperator类 参考

Node representing a include/dontinclude operator block 更多...

#include <docparser.h>

+ 类 DocIncOperator 继承关系图:
+ DocIncOperator 的协作图:

Public 类型

enum  Type { Line, SkipLine, Skip, Until }
 
- Public 类型 继承自 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, Kind_Emoji = 53, Kind_Sep = 54
}
 

Public 成员函数

 DocIncOperator (DocParser &parser, DocNode *parent, Type t, const QCString &pat, const QCString &context, bool isExample, const QCString &exampleFile)
 
Kind kind () const override
 
Type type () const
 
const char * typeAsString () const
 
int line () const
 
bool showLineNo () const
 
QCString text () const
 
QCString pattern () const
 
QCString context () const
 
void accept (DocVisitor *v) override
 
bool isFirst () const
 
bool isLast () const
 
void markFirst (bool v=TRUE)
 
void markLast (bool v=TRUE)
 
bool isExample () const
 
QCString exampleFile () const
 
QCString includeFileName () const
 
void parse ()
 
- Public 成员函数 继承自 DocNode
 DocNode (DocParser &parser)
 
virtual ~DocNode ()
 
DocNodeparent () const
 
void setParent (DocNode *parent)
 
bool isPreformatted () const
 

Private 属性

Type m_type = Line
 
int m_line = 0
 
bool m_showLineNo = false
 
QCString m_text
 
QCString m_pattern
 
QCString m_context
 
bool m_isFirst = false
 
bool m_isLast = false
 
bool m_isExample = false
 
QCString m_exampleFile
 
QCString m_includeFileName
 

额外继承的成员函数

- Protected 类型 继承自 DocNode
enum  RefType { Unknown, Anchor, Section, Table }
 
- Protected 成员函数 继承自 DocNode
void setInsidePreformatted (bool p)
 
- Protected 属性 继承自 DocNode
DocNodem_parent = 0
 
DocParserm_parser
 

详细描述

Node representing a include/dontinclude operator block

在文件 docparser.h606 行定义.

成员枚举类型说明

◆ Type

枚举值
Line 
SkipLine 
Skip 
Until 

在文件 docparser.h609 行定义.

609 { Line, SkipLine, Skip, Until };

构造及析构函数说明

◆ DocIncOperator()

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

在文件 docparser.h610 行定义.

引用了 DocNode::m_parent , 以及 DocNode::parent().

成员函数说明

◆ accept()

void DocIncOperator::accept ( DocVisitor v)
inlineoverridevirtual

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

参数
vAbstract visitor.

实现了 DocNode.

在文件 docparser.h633 行定义.

633 { v->visit(this); }

引用了 DocVisitor::visit().

◆ context()

QCString DocIncOperator::context ( ) const
inline

◆ exampleFile()

QCString DocIncOperator::exampleFile ( ) const
inline

◆ includeFileName()

QCString DocIncOperator::includeFileName ( ) const
inline

◆ isExample()

bool DocIncOperator::isExample ( ) const
inline

◆ isFirst()

bool DocIncOperator::isFirst ( ) const
inline

◆ isLast()

bool DocIncOperator::isLast ( ) const
inline

◆ kind()

Kind DocIncOperator::kind ( ) const
inlineoverridevirtual

Returns the kind of node. Provides runtime type information

实现了 DocNode.

在文件 docparser.h615 行定义.

615 { return Kind_IncOperator; }

引用了 DocNode::Kind_IncOperator.

◆ line()

int DocIncOperator::line ( ) const
inline

◆ markFirst()

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

在文件 docparser.h636 行定义.

636 { m_isFirst = v; }

引用了 m_isFirst.

被这些函数引用 DocPara::handleIncludeOperator().

◆ markLast()

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

在文件 docparser.h637 行定义.

637 { m_isLast = v; }

引用了 m_isLast.

被这些函数引用 DocPara::handleIncludeOperator().

◆ parse()

void DocIncOperator::parse ( )

在文件 docparser.cpp1978 行定义.

1979 {
1981  {
1983  "No previous '\\include' or '\\dontinclude' command for '\\%s' present",
1984  typeAsString());
1985  }
1986 
1988  const char *p = m_parser.context.includeFileText.data();
1991  int il = m_parser.context.includeFileLine;
1992  DBG(("DocIncOperator::parse() text=%s off=%d len=%d\n",p,o,l));
1993  uint so = o,bo;
1994  bool nonEmpty = FALSE;
1995  switch(type())
1996  {
1997  case Line:
1998  while (o<l)
1999  {
2000  char c = p[o];
2001  if (c=='\n')
2002  {
2004  if (nonEmpty) break; // we have a pattern to match
2005  so=o+1; // no pattern, skip empty line
2006  }
2007  else if (!isspace((uchar)c)) // no white space char
2008  {
2009  nonEmpty=TRUE;
2010  }
2011  o++;
2012  }
2013  if (m_parser.context.includeFileText.mid(so,o-so).find(m_pattern)!=-1)
2014  {
2015  m_line = il;
2017  DBG(("DocIncOperator::parse() Line: %s\n",qPrint(m_text)));
2018  }
2019  m_parser.context.includeFileOffset = std::min(l,o+1); // set pointer to start of new line
2021  break;
2022  case SkipLine:
2023  while (o<l)
2024  {
2025  so=o;
2026  while (o<l)
2027  {
2028  char c = p[o];
2029  if (c=='\n')
2030  {
2032  if (nonEmpty) break; // we have a pattern to match
2033  so=o+1; // no pattern, skip empty line
2034  }
2035  else if (!isspace((uchar)c)) // no white space char
2036  {
2037  nonEmpty=TRUE;
2038  }
2039  o++;
2040  }
2041  if (m_parser.context.includeFileText.mid(so,o-so).find(m_pattern)!=-1)
2042  {
2043  m_line = il;
2045  DBG(("DocIncOperator::parse() SkipLine: %s\n",qPrint(m_text)));
2046  break;
2047  }
2048  o++; // skip new line
2049  }
2050  m_parser.context.includeFileOffset = std::min(l,o+1); // set pointer to start of new line
2052  break;
2053  case Skip:
2054  while (o<l)
2055  {
2056  so=o;
2057  while (o<l)
2058  {
2059  char c = p[o];
2060  if (c=='\n')
2061  {
2063  if (nonEmpty) break; // we have a pattern to match
2064  so=o+1; // no pattern, skip empty line
2065  }
2066  else if (!isspace((uchar)c)) // no white space char
2067  {
2068  nonEmpty=TRUE;
2069  }
2070  o++;
2071  }
2072  if (m_parser.context.includeFileText.mid(so,o-so).find(m_pattern)!=-1)
2073  {
2074  break;
2075  }
2076  o++; // skip new line
2077  }
2078  m_parser.context.includeFileOffset = so; // set pointer to start of new line
2080  break;
2081  case Until:
2082  bo=o;
2083  while (o<l)
2084  {
2085  so=o;
2086  while (o<l)
2087  {
2088  char c = p[o];
2089  if (c=='\n')
2090  {
2092  if (nonEmpty) break; // we have a pattern to match
2093  so=o+1; // no pattern, skip empty line
2094  }
2095  else if (!isspace((uchar)c)) // no white space char
2096  {
2097  nonEmpty=TRUE;
2098  }
2099  o++;
2100  }
2101  if (m_parser.context.includeFileText.mid(so,o-so).find(m_pattern)!=-1)
2102  {
2103  m_line = il;
2105  DBG(("DocIncOperator::parse() Until: %s\n",qPrint(m_text)));
2106  break;
2107  }
2108  o++; // skip new line
2109  }
2110  m_parser.context.includeFileOffset = std::min(l,o+1); // set pointer to start of new line
2112  break;
2113  }
2114 }

引用了 DocParser::context, QCString::data(), DBG, FALSE, DocParserContext::fileName, QCString::find(), DocTokenizer::getLineNr(), DocParserContext::includeFileLength, DocParserContext::includeFileLine, DocParserContext::includeFileName, DocParserContext::includeFileOffset, DocParserContext::includeFileShowLineNo, DocParserContext::includeFileText, QCString::isEmpty(), reg::isspace(), Line, m_includeFileName, m_line, DocNode::m_parser, m_pattern, m_showLineNo, m_text, QCString::mid(), qPrint(), Skip, SkipLine, DocParser::tokenizer, TRUE, type(), typeAsString(), Until , 以及 warn_doc_error().

被这些函数引用 DocPara::handleIncludeOperator().

◆ pattern()

QCString DocIncOperator::pattern ( ) const
inline

在文件 docparser.h631 行定义.

631 { return m_pattern; }

引用了 m_pattern.

◆ showLineNo()

bool DocIncOperator::showLineNo ( ) const
inline

◆ text()

QCString DocIncOperator::text ( ) const
inline

◆ type()

Type DocIncOperator::type ( ) const
inline

◆ typeAsString()

const char* DocIncOperator::typeAsString ( ) const
inline

在文件 docparser.h617 行定义.

618  {
619  switch(m_type)
620  {
621  case Line: return "line";
622  case SkipLine: return "skipline";
623  case Skip: return "skip";
624  case Until: return "until";
625  }
626  return "";
627  }

引用了 Line, m_type, Skip, SkipLine , 以及 Until.

被这些函数引用 parse().

类成员变量说明

◆ m_context

QCString DocIncOperator::m_context
private

在文件 docparser.h649 行定义.

被这些函数引用 context().

◆ m_exampleFile

QCString DocIncOperator::m_exampleFile
private

在文件 docparser.h653 行定义.

被这些函数引用 exampleFile().

◆ m_includeFileName

QCString DocIncOperator::m_includeFileName
private

在文件 docparser.h654 行定义.

被这些函数引用 includeFileName() , 以及 parse().

◆ m_isExample

bool DocIncOperator::m_isExample = false
private

在文件 docparser.h652 行定义.

被这些函数引用 isExample().

◆ m_isFirst

bool DocIncOperator::m_isFirst = false
private

在文件 docparser.h650 行定义.

被这些函数引用 isFirst() , 以及 markFirst().

◆ m_isLast

bool DocIncOperator::m_isLast = false
private

在文件 docparser.h651 行定义.

被这些函数引用 isLast() , 以及 markLast().

◆ m_line

int DocIncOperator::m_line = 0
private

在文件 docparser.h645 行定义.

被这些函数引用 line() , 以及 parse().

◆ m_pattern

QCString DocIncOperator::m_pattern
private

在文件 docparser.h648 行定义.

被这些函数引用 parse() , 以及 pattern().

◆ m_showLineNo

bool DocIncOperator::m_showLineNo = false
private

在文件 docparser.h646 行定义.

被这些函数引用 parse() , 以及 showLineNo().

◆ m_text

QCString DocIncOperator::m_text
private

在文件 docparser.h647 行定义.

被这些函数引用 parse() , 以及 text().

◆ m_type

Type DocIncOperator::m_type = Line
private

在文件 docparser.h644 行定义.

被这些函数引用 type() , 以及 typeAsString().


该类的文档由以下文件生成:
DocParser::context
DocParserContext context
Definition: docparser.cpp:175
DocVisitor::visit
virtual void visit(DocWord *)=0
DocIncOperator::m_context
QCString m_context
Definition: docparser.h:649
DocIncOperator::m_includeFileName
QCString m_includeFileName
Definition: docparser.h:654
QCString::isEmpty
bool isEmpty() const
Returns TRUE iff the string is empty
Definition: qcstring.h:144
DocIncOperator::m_exampleFile
QCString m_exampleFile
Definition: docparser.h:653
DocParserContext::includeFileShowLineNo
bool includeFileShowLineNo
Definition: docparser.cpp:127
DocParser::tokenizer
DocTokenizer tokenizer
Definition: docparser.cpp:176
DocIncOperator::exampleFile
QCString exampleFile() const
Definition: docparser.h:639
warn_doc_error
void warn_doc_error(const QCString &file, int line, const char *fmt,...)
Definition: message.cpp:186
QCString::find
int find(char c, int index=0, bool cs=TRUE) const
Definition: qcstring.cpp:38
DocIncOperator::m_isLast
bool m_isLast
Definition: docparser.h:651
DocNode::Kind_IncOperator
@ Kind_IncOperator
Definition: docparser.h:132
DocParserContext::includeFileLine
int includeFileLine
Definition: docparser.cpp:126
uint
unsigned uint
Definition: qcstring.h:40
DocIncOperator::m_type
Type m_type
Definition: docparser.h:644
DocParserContext::fileName
QCString fileName
Definition: docparser.cpp:110
DocIncOperator::m_showLineNo
bool m_showLineNo
Definition: docparser.h:646
reg::isspace
static bool isspace(char c)
Definition: regex.cpp:33
uchar
unsigned char uchar
Definition: qcstring.h:38
DocParserContext::includeFileOffset
uint includeFileOffset
Definition: docparser.cpp:124
DocIncOperator::Until
@ Until
Definition: docparser.h:609
DocIncOperator::isExample
bool isExample() const
Definition: docparser.h:638
DocIncOperator::typeAsString
const char * typeAsString() const
Definition: docparser.h:617
DocIncOperator::m_line
int m_line
Definition: docparser.h:645
DocIncOperator::Skip
@ Skip
Definition: docparser.h:609
DocNode::m_parser
DocParser & m_parser
Definition: docparser.h:184
DocTokenizer::getLineNr
int getLineNr(void)
TRUE
#define TRUE
Definition: qcstring.h:36
DocIncOperator::SkipLine
@ SkipLine
Definition: docparser.h:609
DocParserContext::includeFileLength
uint includeFileLength
Definition: docparser.cpp:125
QCString::mid
QCString mid(size_t index, size_t len=static_cast< size_t >(-1)) const
Definition: qcstring.h:224
DocIncOperator::type
Type type() const
Definition: docparser.h:616
DocIncOperator::m_isExample
bool m_isExample
Definition: docparser.h:652
DocIncOperator::Line
@ Line
Definition: docparser.h:609
DocParserContext::includeFileName
QCString includeFileName
Definition: docparser.cpp:122
qPrint
const char * qPrint(const char *s)
Definition: qcstring.h:589
QCString::data
const char * data() const
Returns a pointer to the contents of the string in the form of a 0-terminated C string
Definition: qcstring.h:153
DocParserContext::includeFileText
QCString includeFileText
Definition: docparser.cpp:123
DocIncOperator::context
QCString context() const
Definition: docparser.h:632
DocNode::DocNode
DocNode(DocParser &parser)
Definition: docparser.h:157
DocNode::parent
DocNode * parent() const
Definition: docparser.h:166
DocIncOperator::m_pattern
QCString m_pattern
Definition: docparser.h:648
DBG
#define DBG(x)
Definition: docparser.cpp:58
DocIncOperator::m_text
QCString m_text
Definition: docparser.h:647
DocIncOperator::m_isFirst
bool m_isFirst
Definition: docparser.h:650
DocNode::m_parent
DocNode * m_parent
Definition: docparser.h:182
FALSE
#define FALSE
Definition: qcstring.h:33