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
}
 
- 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 

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

Definition at line 487 of file docparser.h.

490  :
491  m_file(file), m_context(context), m_type(t),
492  m_isExample(isExample), m_exampleFile(exampleFile),
493  m_blockId(blockId) { m_parent = parent; }
DocNode * parent() const
Definition: docparser.h:147
Type m_type
Definition: docparser.h:515
QCString m_file
Definition: docparser.h:512
DocNode * m_parent
Definition: docparser.h:163
QCString m_blockId
Definition: docparser.h:518
bool isExample() const
Definition: docparser.h:506
bool m_isExample
Definition: docparser.h:516
QCString m_context
Definition: docparser.h:513
QCString m_exampleFile
Definition: docparser.h:517

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.

508 { v->visit(this); }
virtual void visit(DocWord *)=0
QCString DocInclude::blockId ( ) const
inline

Definition at line 505 of file docparser.h.

505 { return m_blockId; }
QCString m_blockId
Definition: docparser.h:518
QCString DocInclude::context ( ) const
inline

Definition at line 504 of file docparser.h.

504 { return m_context; }
QCString m_context
Definition: docparser.h:513
QCString DocInclude::exampleFile ( ) const
inline

Definition at line 507 of file docparser.h.

507 { return m_exampleFile; }
QCString m_exampleFile
Definition: docparser.h:517
QCString DocInclude::extension ( ) const
inline

Definition at line 496 of file docparser.h.

496  { int i=m_file.findRev('.');
497  if (i!=-1)
498  return m_file.right(m_file.length()-i);
499  else
500  return "";
501  }
uint length() const
Definition: qcstring.h:195
QCString m_file
Definition: docparser.h:512
int findRev(char c, int index=-1, bool cs=TRUE) const
Definition: qcstring.cpp:95
QCString right(uint len) const
Definition: qcstring.cpp:231
QCString DocInclude::file ( ) const
inline

Definition at line 495 of file docparser.h.

495 { return m_file; }
QCString m_file
Definition: docparser.h:512
bool DocInclude::isExample ( ) const
inline

Definition at line 506 of file docparser.h.

506 { return m_isExample; }
bool m_isExample
Definition: docparser.h:516
Kind DocInclude::kind ( ) const
inlinevirtual

Returns the kind of node. Provides runtime type information

Implements DocNode.

Definition at line 494 of file docparser.h.

void DocInclude::parse ( )

Definition at line 1899 of file docparser.cpp.

1900 {
1901  DBG(("DocInclude::parse(file=%s,text=%s)\n",qPrint(m_file),qPrint(m_text)));
1902  switch(m_type)
1903  {
1904  case IncWithLines:
1905  // fall through
1906  case Include:
1907  // fall through
1908  case DontInclude:
1911  g_includeFileOffset = 0;
1913  //printf("g_includeFile=<<%s>>\n",g_includeFileText.data());
1914  break;
1915  case VerbInclude:
1916  // fall through
1917  case HtmlInclude:
1919  break;
1920  case LatexInclude:
1922  break;
1923  case Snippet:
1925  // check here for the existence of the blockId inside the file, so we
1926  // only generate the warning once.
1927  int count;
1928  if (!m_blockId.isEmpty() && (count=m_text.contains(m_blockId.data()))!=2)
1929  {
1930  warn_doc_error(g_fileName,doctokenizerYYlineno,"block marked with %s for \\snippet should appear twice in file %s, found it %d times\n",
1932  }
1933  break;
1934  }
1935 }
static QCString g_fileName
Definition: docparser.cpp:95
static QCString g_includeFileText
Definition: docparser.cpp:107
bool isEmpty() const
Definition: qcstring.h:189
uint length() const
Definition: qcstring.h:195
int contains(char c, bool cs=TRUE) const
Definition: qcstring.cpp:153
Type m_type
Definition: docparser.h:515
QCString m_file
Definition: docparser.h:512
#define DBG(x)
Definition: docparser.cpp:59
int doctokenizerYYlineno
void warn_doc_error(const char *file, int line, const char *fmt,...)
Definition: message.cpp:210
static uint g_includeFileLength
Definition: docparser.cpp:109
QCString m_blockId
Definition: docparser.h:518
const char * data() const
Definition: qcstring.h:207
static void readTextFileByName(const QCString &file, QCString &text)
Definition: docparser.cpp:1756
QCString m_text
Definition: docparser.h:514
static uint g_includeFileOffset
Definition: docparser.cpp:108
const char * qPrint(const char *s)
Definition: qcstring.h:797
QCString DocInclude::text ( ) const
inline

Definition at line 503 of file docparser.h.

503 { return m_text; }
QCString m_text
Definition: docparser.h:514
Type DocInclude::type ( ) const
inline

Definition at line 502 of file docparser.h.

502 { return m_type; }
Type m_type
Definition: docparser.h:515

Member Data Documentation

QCString DocInclude::m_blockId
private

Definition at line 518 of file docparser.h.

QCString DocInclude::m_context
private

Definition at line 513 of file docparser.h.

QCString DocInclude::m_exampleFile
private

Definition at line 517 of file docparser.h.

QCString DocInclude::m_file
private

Definition at line 512 of file docparser.h.

bool DocInclude::m_isExample
private

Definition at line 516 of file docparser.h.

QCString DocInclude::m_text
private

Definition at line 514 of file docparser.h.

Type DocInclude::m_type
private

Definition at line 515 of file docparser.h.


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