Doxygen
Loading...
Searching...
No Matches
EclipseHelp Class Referencefinal

Generator for Eclipse help files. More...

#include <src/eclipsehelp.h>

Inheritance diagram for EclipseHelp:
Collaboration diagram for EclipseHelp:

Classes

struct  Private

Public Member Functions

 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 DString &name, const DString &ref, const DString &file, const DString &anchor, bool separateIndex, bool addToNavIndex, const Definition *def, const DString &nameAsHtml)
 Add an item to the content.
virtual void addIndexItem (const Definition *context, const MemberDef *md, const DString &sectionAnchor, const DString &title)
virtual void addIndexFile (const DString &name)
virtual void addImageFile (const DString &name)
virtual void addStyleSheetFile (const DString &name)

Private Attributes

std::unique_ptr< Privatep

Detailed Description

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.

Definition at line 43 of file eclipsehelp.h.

Constructor & Destructor Documentation

◆ EclipseHelp()

EclipseHelp::EclipseHelp ( )

Definition at line 59 of file eclipsehelp.cpp.

59: p(std::make_unique<Private>()) {}
std::unique_ptr< Private > p
Definition eclipsehelp.h:66

References p.

Referenced by ~EclipseHelp().

◆ ~EclipseHelp()

Member Function Documentation

◆ addContentsItem()

void EclipseHelp::addContentsItem ( bool isDir,
const DString & name,
const DString & ref,
const DString & file,
const DString & anchor,
bool separateIndex,
bool addToNavIndex,
const Definition * def,
const DString & nameAsHtml )
virtual

Add an item to the content.

Parameters
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.
nameAsHtmlname parameter in HTML format

Implements IndexIntf.

Definition at line 162 of file eclipsehelp.cpp.

172{
173 // -- write the topic tag
174 p->closedTag();
175 if (!file.empty())
176 {
177 DString fn = file;
179 switch (file[0]) // check for special markers (user defined URLs)
180 {
181 case '^':
182 // URL not supported by eclipse toc.xml
183 break;
184
185 case '!':
186 p->indent();
187 p->tocstream << "<topic label=\"" << convertToXML(name) << "\"";
188 p->tocstream << " href=\"" << convertToXML(p->pathprefix) << &file[1] << "\"";
189 p->endtag = true;
190 break;
191
192 default:
193 p->indent();
194 p->tocstream << "<topic label=\"" << convertToXML(name) << "\"";
195 p->tocstream << " href=\"" << convertToXML(p->pathprefix) << fn;
196 if (!anchor.empty())
197 {
198 p->tocstream << "#" << anchor;
199 }
200 p->tocstream << "\"";
201 p->endtag = true;
202 break;
203 }
204 }
205 else
206 {
207 p->indent();
208 p->tocstream << "<topic label=\"" << convertToXML(name) << "\"";
209 p->endtag = true;
210 }
211}
bool empty() const
Returns true iff the string is empty (std::string compatible alias for isEmpty()).
Definition dstring.h:153
void addHtmlExtensionIfMissing(DString &fName)
Definition util.cpp:4963
DString convertToXML(const DString &s, bool keepEntities, const bool citeEntry)
Definition util.cpp:3950

References addHtmlExtensionIfMissing(), convertToXML(), DString::empty(), and p.

Referenced by ~EclipseHelp().

◆ addImageFile()

void EclipseHelp::addImageFile ( const DString & name)
virtual

Implements IndexIntf.

Definition at line 225 of file eclipsehelp.cpp.

226{
227}

Referenced by ~EclipseHelp().

◆ addIndexFile()

void EclipseHelp::addIndexFile ( const DString & name)
virtual

Implements IndexIntf.

Definition at line 221 of file eclipsehelp.cpp.

222{
223}

Referenced by ~EclipseHelp().

◆ addIndexItem()

void EclipseHelp::addIndexItem ( const Definition * context,
const MemberDef * md,
const DString & sectionAnchor,
const DString & title )
virtual

Implements IndexIntf.

Definition at line 213 of file eclipsehelp.cpp.

218{
219}

Referenced by ~EclipseHelp().

◆ addStyleSheetFile()

void EclipseHelp::addStyleSheetFile ( const DString & name)
virtual

Implements IndexIntf.

Definition at line 229 of file eclipsehelp.cpp.

230{
231}

Referenced by ~EclipseHelp().

◆ decContentsDepth()

void EclipseHelp::decContentsDepth ( )
virtual

Decrease the level of content hierarchy.

It closes currently opened topic tag.

Implements IndexIntf.

Definition at line 135 of file eclipsehelp.cpp.

136{
137 // -- end of the opened topic
138 p->closedTag();
139 --p->depth;
140
141 if (p->openTags==p->depth)
142 {
143 --p->openTags;
144 p->indent();
145 p->tocstream << "</topic>\n";
146 }
147}

References p.

Referenced by ~EclipseHelp().

◆ finalize()

void EclipseHelp::finalize ( )
virtual

Finish generation of the Eclipse specific help files.

This method writes footers of the files and closes them.

See also
initialize()

Implements IndexIntf.

Definition at line 96 of file eclipsehelp.cpp.

97{
98 p->closedTag(); // -- close previous tag
99
100 // -- write ending tag
101 --p->depth;
102 p->tocstream << "</toc>\n";
103
104 // -- close the content file
105 p->tocstream.close();
106
107 DString name = Config_getString(HTML_OUTPUT) + "/plugin.xml";
108 std::ofstream t = Portable::openOutputStream(name);
109 if (t.is_open())
110 {
111 DString docId = Config_getString(ECLIPSE_DOC_ID);
112 t << "<plugin name=\"" << docId << "\" id=\"" << docId << "\"\n";
113 t << " version=\"1.0.0\" provider-name=\"Doxygen\">\n";
114 t << " <extension point=\"org.eclipse.help.toc\">\n";
115 t << " <toc file=\"toc.xml\" primary=\"true\" />\n";
116 t << " </extension>\n";
117 t << "</plugin>\n";
118 }
119}
#define Config_getString(name)
Definition config.h:32
std::ofstream openOutputStream(const DString &name, bool append=false)
Definition portable.cpp:648

References Config_getString, Portable::openOutputStream(), and p.

Referenced by ~EclipseHelp().

◆ incContentsDepth()

void EclipseHelp::incContentsDepth ( )
virtual

Increase the level of content hierarchy.

Implements IndexIntf.

Definition at line 124 of file eclipsehelp.cpp.

125{
126 p->openedTag();
127 ++p->depth;
128}

References p.

Referenced by ~EclipseHelp().

◆ initialize()

void EclipseHelp::initialize ( )
virtual

Initialize the Eclipse generator.

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

See also
finalize()

Implements IndexIntf.

Definition at line 68 of file eclipsehelp.cpp.

69{
70 // -- open the contents file
71 DString name = Config_getString(HTML_OUTPUT) + "/toc.xml";
72 p->tocstream = Portable::openOutputStream(name);
73 if (!p->tocstream.is_open())
74 {
75 term("Could not open file {} for writing\n", name);
76 }
77
78 // -- write the opening tag
79 DString title = Config_getString(PROJECT_NAME);
80 if (title.empty())
81 {
82 title = "Doxygen generated documentation";
83 }
84 p->tocstream << "<toc label=\"" << convertToXML(title)
85 << "\" topic=\"" << convertToXML(p->pathprefix)
86 << "index" << Doxygen::htmlFileExtension << "\">\n";
87 ++ p->depth;
88}
static DString htmlFileExtension
Definition doxygen.h:122
#define term(fmt,...)
Definition message.h:137

References Config_getString, convertToXML(), DString::empty(), Doxygen::htmlFileExtension, Portable::openOutputStream(), p, and term.

Referenced by ~EclipseHelp().

Member Data Documentation

◆ p

std::unique_ptr<Private> EclipseHelp::p
private

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