Doxygen
Loading...
Searching...
No Matches
Crawlmap Class Reference

#include <src/sitemap.h>

+ Inheritance diagram for Crawlmap:
+ Collaboration diagram for Crawlmap:

Classes

class  Private
 

Public Member Functions

 Crawlmap ()
 
 ~Crawlmap ()
 
void initialize ()
 
void finalize ()
 
void incContentsDepth ()
 
void decContentsDepth ()
 
void addContentsItem (bool isDir, const QCString &name, const QCString &ref, const QCString &file, const QCString &anchor, bool separateIndex, bool addToNavIndex, const Definition *def)
 
void addIndexItem (const Definition *context, const MemberDef *md, const QCString &sectionAnchor, const QCString &title)
 
void addIndexFile (const QCString &name)
 
void addImageFile (const QCString &name)
 
void addStyleSheetFile (const QCString &name)
 
- Public Member Functions inherited from IndexIntf

Static Public Attributes

static const QCString crawlFileName = "doxygen_crawl"
 

Private Attributes

std::unique_ptr< Privatep
 

Detailed Description

Definition at line 54 of file sitemap.h.

Constructor & Destructor Documentation

◆ Crawlmap()

Crawlmap::Crawlmap ( )

Definition at line 92 of file sitemap.cpp.

92: p(std::make_unique<Private>()) {}
std::unique_ptr< Private > p
Definition sitemap.h:79

References p.

Referenced by ~Crawlmap().

◆ ~Crawlmap()

Crawlmap::~Crawlmap ( )
default

References Crawlmap().

Member Function Documentation

◆ addContentsItem()

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

Implements IndexIntf.

Definition at line 140 of file sitemap.cpp.

144{
145 if (!file.isEmpty() && ref.isEmpty()) // made file optional param and
146 // don't place links in crawl file imported
147 // by tags
148 {
149 std::string link;
150 if (file[0]=='!' || file[0]=='^') // special markers for user defined URLs
151 {
152 link+=&file[1];
153 }
154 else
155 {
156 QCString currFile = file;
158 QCString currAnc = anchor;
159 link += currFile.data();
160 if (!currAnc.isEmpty())
161 {
162 link += "#";
163 link += currAnc.str();
164 }
165 }
166 p->crawlLinks.push_back(link);
167 }
168}
bool isEmpty() const
Returns TRUE iff the string is empty.
Definition qcstring.h:150
const std::string & str() const
Definition qcstring.h:537
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:159
void addHtmlExtensionIfMissing(QCString &fName)
Definition util.cpp:5243

References addHtmlExtensionIfMissing(), QCString::data(), QCString::isEmpty(), p, and QCString::str().

◆ addImageFile()

void Crawlmap::addImageFile ( const QCString & name)
inlinevirtual

Implements IndexIntf.

Definition at line 72 of file sitemap.h.

72{}

◆ addIndexFile()

void Crawlmap::addIndexFile ( const QCString & name)
virtual

Implements IndexIntf.

Definition at line 133 of file sitemap.cpp.

134{
135 QCString fn = fileName;
137 p->crawlLinks.push_back(fn.str());
138}

References addHtmlExtensionIfMissing(), p, and QCString::str().

◆ addIndexItem()

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

Implements IndexIntf.

Definition at line 195 of file sitemap.cpp.

197{
198 if (context && md) // member
199 {
200 QCString cfname = md->getOutputFileBase();
201 QCString anchor = !sectionAnchor.isEmpty() ? sectionAnchor : md->anchor();
202 QCString ref = makeRef(cfname, anchor);
203 p->crawlLinks.push_back(ref.str());
204 }
205 else if (context) // container
206 {
207 QCString contRef = context->getOutputFileBase();
208 QCString ref = makeRef(contRef,sectionAnchor);
209 p->crawlLinks.push_back(ref.str());
210 }
211}
virtual QCString anchor() const =0
virtual QCString getOutputFileBase() const =0
static QCString makeRef(const QCString &withoutExtension, const QCString &anchor)
Definition qhp.cpp:187

References Definition::anchor(), Definition::getOutputFileBase(), QCString::isEmpty(), makeRef(), p, and QCString::str().

◆ addStyleSheetFile()

void Crawlmap::addStyleSheetFile ( const QCString & name)
inlinevirtual

Implements IndexIntf.

Definition at line 73 of file sitemap.h.

73{}

◆ decContentsDepth()

void Crawlmap::decContentsDepth ( )
inlinevirtual

Implements IndexIntf.

Definition at line 64 of file sitemap.h.

64{}

◆ finalize()

void Crawlmap::finalize ( )
virtual

Implements IndexIntf.

Definition at line 118 of file sitemap.cpp.

119{
120 std::sort(p->crawlLinks.begin(),p->crawlLinks.end());
121 p->crawlLinks.erase(std::unique(p->crawlLinks.begin(),p->crawlLinks.end()),p->crawlLinks.end());
122 for (auto &s : p->crawlLinks)
123 {
124 p->crawl << "<a href=\"" << s << "\"/>\n";
125 }
126
127 p->crawl << "</body>\n";
128 p->crawl << "</html>\n";
129 p->crawl.flush();
130 p->crawlFile.close();
131}

References p.

◆ incContentsDepth()

void Crawlmap::incContentsDepth ( )
inlinevirtual

Implements IndexIntf.

Definition at line 63 of file sitemap.h.

63{}

◆ initialize()

void Crawlmap::initialize ( )
virtual

Implements IndexIntf.

Definition at line 95 of file sitemap.cpp.

96{
97 QCString fileName = Config_getString(HTML_OUTPUT) + "/" + crawlFileName;
99 p->crawlFile = Portable::openOutputStream(fileName);
100 if (!p->crawlFile.is_open())
101 {
102 term("Could not open file %s for writing\n", qPrint(fileName));
103 }
104 p->crawl.setStream(&p->crawlFile);
105 p->crawl << "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n";
106 p->crawl << "<html xmlns=\"http://www.w3.org/1999/xhtml\" lang=\"" + theTranslator->trISOLang() + "\">\n";
107 p->crawl << "<head>\n";
108 p->crawl << "<title>Validator / crawler helper</title>\n";
109 p->crawl << "<meta http-equiv=\"Content-Type\" content=\"text/xhtml;charset=UTF-8\"/>\n";
110 p->crawl << "<meta http-equiv=\"X-UA-Compatible\" content=\"IE=11\"/>\n";
111
112 p->crawl << "<meta name=\"generator\" content=\"Doxygen " + getDoxygenVersion() + "\"/>\n";
113 p->crawl << "<meta name=\"viewport\" content=\"width=device-width, initial-scale=1\"/>\n";
114 p->crawl << "</head>\n";
115 p->crawl << "<body>\n";
116}
static const QCString crawlFileName
Definition sitemap.h:75
virtual QCString trISOLang()=0
#define Config_getString(name)
Definition config.h:32
Translator * theTranslator
Definition language.cpp:71
#define term(fmt,...)
Definition message.h:94
std::ofstream openOutputStream(const QCString &name, bool append=false)
Definition portable.cpp:665
const char * qPrint(const char *s)
Definition qcstring.h:672

References addHtmlExtensionIfMissing(), Config_getString, crawlFileName, Portable::openOutputStream(), p, qPrint(), term, and theTranslator.

Member Data Documentation

◆ crawlFileName

const QCString Crawlmap::crawlFileName = "doxygen_crawl"
inlinestatic

Definition at line 75 of file sitemap.h.

Referenced by initialize(), and writeIndex().

◆ p

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

Definition at line 79 of file sitemap.h.

Referenced by addContentsItem(), addIndexFile(), addIndexItem(), Crawlmap(), finalize(), and initialize().


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