Doxygen
EclipseHelp类 参考

Generator for Eclipse help files. 更多...

#include <eclipsehelp.h>

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

Public 成员函数

 EclipseHelp ()
 
virtual ~EclipseHelp ()
 
virtual void initialize ()
 Initialize the Eclipse generator 更多...
 
virtual void finalize ()
 Finish generation of the Eclipse specific help files 更多...
 
virtual void incContentsDepth ()
 Increase the level of content hierarchy 更多...
 
virtual void decContentsDepth ()
 Decrease the level of content hierarchy 更多...
 
virtual void addContentsItem (bool isDir, const QCString &name, const QCString &ref, const QCString &file, const QCString &anchor, bool separateIndex, bool addToNavIndex, const Definition *def)
 Add an item to the content 更多...
 
virtual void addIndexItem (const Definition *context, const MemberDef *md, const QCString &sectionAnchor, const QCString &title)
 
virtual void addIndexFile (const QCString &name)
 
virtual void addImageFile (const QCString &name)
 
virtual void addStyleSheetFile (const QCString &name)
 
- Public 成员函数 继承自 IndexIntf
virtual ~IndexIntf ()
 

Private 成员函数

 EclipseHelp (const EclipseHelp &)
 
EclipseHelpoperator= (const EclipseHelp &)
 
void indent ()
 
void closedTag ()
 
void openedTag ()
 

Private 属性

int m_depth
 
bool m_endtag
 
int m_openTags
 
std::ofstream m_tocstream
 
QCString m_pathprefix
 

详细描述

Generator for Eclipse help files.

This class generates the Eclipse specific help files. These files can be used to generate a help plugin readable by the Eclipse IDE.

在文件 eclipsehelp.h40 行定义.

构造及析构函数说明

◆ EclipseHelp() [1/2]

EclipseHelp::EclipseHelp ( )

在文件 eclipsehelp.cpp21 行定义.

21  : m_depth(0), m_endtag(FALSE), m_openTags(0)
22 {
23 }

◆ ~EclipseHelp()

EclipseHelp::~EclipseHelp ( )
virtual

在文件 eclipsehelp.cpp25 行定义.

26 {
27 }

◆ EclipseHelp() [2/2]

EclipseHelp::EclipseHelp ( const EclipseHelp )
private

成员函数说明

◆ addContentsItem()

void EclipseHelp::addContentsItem ( bool  isDir,
const QCString name,
const QCString ref,
const QCString file,
const QCString anchor,
bool  separateIndex,
bool  addToNavIndex,
const Definition def 
)
virtual

Add an item to the content

参数
isDirFlag whether the argument file is a directory or a file entry
nameName of the item
refURL of the item
fileName of a file which the item is defined in (without extension)
anchorName of an anchor of the item.
separateIndexnot used.
addToNavIndexnot used.
defnot used.

实现了 IndexIntf.

在文件 eclipsehelp.cpp160 行定义.

169 {
170  // -- write the topic tag
171  closedTag();
172  if (!file.isEmpty())
173  {
174  switch (file[0]) // check for special markers (user defined URLs)
175  {
176  case '^':
177  // URL not supported by eclipse toc.xml
178  break;
179 
180  case '!':
181  indent();
182  m_tocstream << "<topic label=\"" << convertToXML(name) << "\"";
183  m_tocstream << " href=\"" << convertToXML(m_pathprefix) << &file[1] << "\"";
184  m_endtag = TRUE;
185  break;
186 
187  default:
188  indent();
189  m_tocstream << "<topic label=\"" << convertToXML(name) << "\"";
190  m_tocstream << " href=\"" << convertToXML(m_pathprefix)
191  << addHtmlExtensionIfMissing(file);
192  if (!anchor.isEmpty())
193  {
194  m_tocstream << "#" << anchor;
195  }
196  m_tocstream << "\"";
197  m_endtag = TRUE;
198  break;
199  }
200  }
201  else
202  {
203  indent();
204  m_tocstream << "<topic label=\"" << convertToXML(name) << "\"";
205  m_endtag = TRUE;
206  }
207 }

引用了 addHtmlExtensionIfMissing(), closedTag(), convertToXML(), indent(), QCString::isEmpty(), m_endtag, m_pathprefix, m_tocstream , 以及 TRUE.

◆ addImageFile()

void EclipseHelp::addImageFile ( const QCString name)
virtual

实现了 IndexIntf.

在文件 eclipsehelp.cpp221 行定义.

222 {
223 }

◆ addIndexFile()

void EclipseHelp::addIndexFile ( const QCString name)
virtual

实现了 IndexIntf.

在文件 eclipsehelp.cpp217 行定义.

218 {
219 }

◆ addIndexItem()

void EclipseHelp::addIndexItem ( const Definition context,
const MemberDef md,
const QCString sectionAnchor,
const QCString title 
)
virtual

实现了 IndexIntf.

在文件 eclipsehelp.cpp209 行定义.

214 {
215 }

◆ addStyleSheetFile()

void EclipseHelp::addStyleSheetFile ( const QCString name)
virtual

实现了 IndexIntf.

在文件 eclipsehelp.cpp225 行定义.

226 {
227 }

◆ closedTag()

void EclipseHelp::closedTag ( )
private

在文件 eclipsehelp.cpp38 行定义.

39 {
40  if (m_endtag)
41  {
42  m_tocstream << "/>\n";
43  m_endtag = FALSE;
44  }
45 }

引用了 FALSE, m_endtag , 以及 m_tocstream.

被这些函数引用 addContentsItem(), decContentsDepth() , 以及 finalize().

◆ decContentsDepth()

void EclipseHelp::decContentsDepth ( )
virtual

Decrease the level of content hierarchy

It closes currently opened topic tag.

实现了 IndexIntf.

在文件 eclipsehelp.cpp134 行定义.

135 {
136  // -- end of the opened topic
137  closedTag();
138  --m_depth;
139 
140  if (m_openTags==m_depth)
141  {
142  --m_openTags;
143  indent();
144  m_tocstream << "</topic>\n";
145  }
146 }

引用了 closedTag(), indent(), m_depth, m_openTags , 以及 m_tocstream.

◆ finalize()

void EclipseHelp::finalize ( )
virtual

Finish generation of the Eclipse specific help files

This method writes footers of the files and closes them.

参见
initialize()

实现了 IndexIntf.

在文件 eclipsehelp.cpp95 行定义.

96 {
97  closedTag(); // -- close previous tag
98 
99  // -- write ending tag
100  --m_depth;
101  m_tocstream << "</toc>\n";
102 
103  // -- close the content file
104  m_tocstream.close();
105 
106  QCString name = Config_getString(HTML_OUTPUT) + "/plugin.xml";
107  std::ofstream t(name.str(),std::ofstream::out | std::ofstream::binary);
108  if (t.is_open())
109  {
110  QCString docId = Config_getString(ECLIPSE_DOC_ID);
111  t << "<plugin name=\"" << docId << "\" id=\"" << docId << "\"\n";
112  t << " version=\"1.0.0\" provider-name=\"Doxygen\">\n";
113  t << " <extension point=\"org.eclipse.help.toc\">\n";
114  t << " <toc file=\"toc.xml\" primary=\"true\" />\n";
115  t << " </extension>\n";
116  t << "</plugin>\n";
117  }
118 }

引用了 closedTag(), Config_getString, m_depth, m_tocstream , 以及 QCString::str().

◆ incContentsDepth()

void EclipseHelp::incContentsDepth ( )
virtual

Increase the level of content hierarchy

实现了 IndexIntf.

在文件 eclipsehelp.cpp123 行定义.

124 {
125  openedTag();
126  ++m_depth;
127 }

引用了 m_depth , 以及 openedTag().

◆ indent()

void EclipseHelp::indent ( )
private

在文件 eclipsehelp.cpp29 行定义.

30 {
31  int i;
32  for (i=0; i<m_depth; i++)
33  {
34  m_tocstream << " ";
35  }
36 }

引用了 m_depth , 以及 m_tocstream.

被这些函数引用 addContentsItem() , 以及 decContentsDepth().

◆ initialize()

void EclipseHelp::initialize ( )
virtual

Initialize the Eclipse generator

This method opens the XML TOC file and writes headers of the files.

参见
finalize()

实现了 IndexIntf.

在文件 eclipsehelp.cpp63 行定义.

64 {
65  // -- read path prefix from the configuration
66  //m_pathprefix = Config_getString(ECLIPSE_PATHPREFIX);
67  //if (m_pathprefix.isEmpty()) m_pathprefix = "html/";
68 
69  // -- open the contents file
70  QCString name = Config_getString(HTML_OUTPUT) + "/toc.xml";
71  m_tocstream.open(name.str(), std::ofstream::out | std::ofstream::binary);
72  if (!m_tocstream.is_open())
73  {
74  term("Could not open file %s for writing\n", qPrint(name));
75  }
76 
77  // -- write the opening tag
78  QCString title = Config_getString(PROJECT_NAME);
79  if (title.isEmpty())
80  {
81  title = "Doxygen generated documentation";
82  }
83  m_tocstream << "<toc label=\"" << convertToXML(title)
84  << "\" topic=\"" << convertToXML(m_pathprefix)
85  << "index" << Doxygen::htmlFileExtension << "\">\n";
86  ++ m_depth;
87 }

引用了 Config_getString, convertToXML(), Doxygen::htmlFileExtension, QCString::isEmpty(), m_depth, m_pathprefix, m_tocstream, qPrint(), QCString::str() , 以及 term().

◆ openedTag()

void EclipseHelp::openedTag ( )
private

在文件 eclipsehelp.cpp47 行定义.

48 {
49  if (m_endtag)
50  {
51  m_tocstream << ">\n";
52  m_endtag = FALSE;
53  ++m_openTags;
54  }
55 }

引用了 FALSE, m_endtag, m_openTags , 以及 m_tocstream.

被这些函数引用 incContentsDepth().

◆ operator=()

EclipseHelp& EclipseHelp::operator= ( const EclipseHelp )
private

类成员变量说明

◆ m_depth

int EclipseHelp::m_depth
private

在文件 eclipsehelp.h61 行定义.

被这些函数引用 decContentsDepth(), finalize(), incContentsDepth(), indent() , 以及 initialize().

◆ m_endtag

bool EclipseHelp::m_endtag
private

在文件 eclipsehelp.h62 行定义.

被这些函数引用 addContentsItem(), closedTag() , 以及 openedTag().

◆ m_openTags

int EclipseHelp::m_openTags
private

在文件 eclipsehelp.h63 行定义.

被这些函数引用 decContentsDepth() , 以及 openedTag().

◆ m_pathprefix

QCString EclipseHelp::m_pathprefix
private

在文件 eclipsehelp.h66 行定义.

被这些函数引用 addContentsItem() , 以及 initialize().

◆ m_tocstream

std::ofstream EclipseHelp::m_tocstream
private

在文件 eclipsehelp.h65 行定义.

被这些函数引用 addContentsItem(), closedTag(), decContentsDepth(), finalize(), indent(), initialize() , 以及 openedTag().


该类的文档由以下文件生成:
EclipseHelp::m_pathprefix
QCString m_pathprefix
Definition: eclipsehelp.h:66
EclipseHelp::indent
void indent()
Definition: eclipsehelp.cpp:29
QCString::isEmpty
bool isEmpty() const
Returns TRUE iff the string is empty
Definition: qcstring.h:144
QCString::str
std::string str() const
Definition: qcstring.h:442
addHtmlExtensionIfMissing
QCString addHtmlExtensionIfMissing(const QCString &fName)
Definition: util.cpp:5275
EclipseHelp::openedTag
void openedTag()
Definition: eclipsehelp.cpp:47
EclipseHelp::closedTag
void closedTag()
Definition: eclipsehelp.cpp:38
EclipseHelp::m_tocstream
std::ofstream m_tocstream
Definition: eclipsehelp.h:65
TRUE
#define TRUE
Definition: qcstring.h:36
EclipseHelp::m_endtag
bool m_endtag
Definition: eclipsehelp.h:62
EclipseHelp::m_depth
int m_depth
Definition: eclipsehelp.h:61
Doxygen::htmlFileExtension
static QCString htmlFileExtension
Definition: doxygen.h:103
EclipseHelp::m_openTags
int m_openTags
Definition: eclipsehelp.h:63
term
void term(const char *fmt,...)
Definition: message.cpp:220
qPrint
const char * qPrint(const char *s)
Definition: qcstring.h:589
Config_getString
#define Config_getString(name)
Definition: config.h:32
convertToXML
QCString convertToXML(const QCString &s, bool keepEntities)
Definition: util.cpp:3948
FALSE
#define FALSE
Definition: qcstring.h:33
QCString
This is an alternative implementation of QCString.
Definition: qcstring.h:108