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 41 of file eclipsehelp.h.

Constructor & Destructor Documentation

◆ EclipseHelp()

EclipseHelp::EclipseHelp ( )

Definition at line 62 of file eclipsehelp.cpp.

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

References p.

Referenced by ~EclipseHelp().

◆ ~EclipseHelp()

EclipseHelp::~EclipseHelp ( )
virtualdefault

References 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 165 of file eclipsehelp.cpp.

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

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

◆ addImageFile()

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

Implements IndexIntf.

Definition at line 228 of file eclipsehelp.cpp.

229{
230}

◆ addIndexFile()

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

Implements IndexIntf.

Definition at line 224 of file eclipsehelp.cpp.

225{
226}

◆ addIndexItem()

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

Implements IndexIntf.

Definition at line 216 of file eclipsehelp.cpp.

221{
222}

◆ addStyleSheetFile()

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

Implements IndexIntf.

Definition at line 232 of file eclipsehelp.cpp.

233{
234}

◆ decContentsDepth()

void EclipseHelp::decContentsDepth ( )
virtual

Decrease the level of content hierarchy.

It closes currently opened topic tag.

Implements IndexIntf.

Definition at line 138 of file eclipsehelp.cpp.

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

References p.

◆ 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 99 of file eclipsehelp.cpp.

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

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

◆ incContentsDepth()

void EclipseHelp::incContentsDepth ( )
virtual

Increase the level of content hierarchy.

Implements IndexIntf.

Definition at line 127 of file eclipsehelp.cpp.

128{
129 p->openedTag();
130 ++p->depth;
131}

References p.

◆ 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 71 of file eclipsehelp.cpp.

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

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

Member Data Documentation

◆ p

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

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