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

#include <src/sitemap.h>

+ Inheritance diagram for Sitemap:
+ Collaboration diagram for Sitemap:

Classes

class  Private
 

Public Member Functions

 Sitemap ()
 
 ~Sitemap ()
 
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 sitemapFileName = "sitemap.xml"
 

Private Attributes

std::unique_ptr< Privatep
 

Detailed Description

Definition at line 26 of file sitemap.h.

Constructor & Destructor Documentation

◆ Sitemap()

Sitemap::Sitemap ( )

Definition at line 43 of file sitemap.cpp.

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

References p.

Referenced by ~Sitemap().

◆ ~Sitemap()

Sitemap::~Sitemap ( )
default

References Sitemap().

Member Function Documentation

◆ addContentsItem()

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

Implements IndexIntf.

Definition at line 37 of file sitemap.h.

40 {}

◆ addImageFile()

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

Implements IndexIntf.

Definition at line 44 of file sitemap.h.

44{}

◆ addIndexFile()

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

Implements IndexIntf.

Definition at line 72 of file sitemap.cpp.

73{
74 QCString fn = fileName;
75 QCString sidemapUrl = Config_getString(SITEMAP_URL);
77 p->doc << " <url>\n";
78 p->doc << " <loc>" << convertToXML(sidemapUrl + fn) << "</loc>\n";
79 p->doc << " </url>\n";
80}
#define Config_getString(name)
Definition config.h:32
QCString convertToXML(const QCString &s, bool keepEntities)
Definition util.cpp:4266
void addHtmlExtensionIfMissing(QCString &fName)
Definition util.cpp:5243

References addHtmlExtensionIfMissing(), Config_getString, convertToXML(), and p.

◆ addIndexItem()

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

Implements IndexIntf.

Definition at line 41 of file sitemap.h.

42 {}

◆ addStyleSheetFile()

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

Implements IndexIntf.

Definition at line 45 of file sitemap.h.

45{}

◆ decContentsDepth()

void Sitemap::decContentsDepth ( )
inlinevirtual

Implements IndexIntf.

Definition at line 36 of file sitemap.h.

36{}

◆ finalize()

void Sitemap::finalize ( )
virtual

Implements IndexIntf.

Definition at line 65 of file sitemap.cpp.

66{
67 p->doc << "</urlset>\n";
68 p->doc.flush();
69 p->docFile.close();
70}

References p.

◆ incContentsDepth()

void Sitemap::incContentsDepth ( )
inlinevirtual

Implements IndexIntf.

Definition at line 35 of file sitemap.h.

35{}

◆ initialize()

void Sitemap::initialize ( )
virtual

Implements IndexIntf.

Definition at line 46 of file sitemap.cpp.

47{
48 QCString fileName = Config_getString(HTML_OUTPUT) + "/" + sitemapFileName;
49
50 p->docFile = Portable::openOutputStream(fileName);
51 if (!p->docFile.is_open())
52 {
53 term("Could not open file %s for writing\n", qPrint(fileName));
54 }
55 p->doc.setStream(&p->docFile);
56
57 p->doc << "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n";
58 p->doc << "<urlset\n";
59 p->doc << " xmlns=\"http://www.sitemaps.org/schemas/sitemap/0.9\"\n";
60 p->doc << " xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n";
61 p->doc << " xsi:schemaLocation=\"http://www.sitemaps.org/schemas/sitemap/0.9\n";
62 p->doc << " http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd\">\n";
63}
static const QCString sitemapFileName
Definition sitemap.h:47
#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:661

References Config_getString, Portable::openOutputStream(), p, qPrint(), sitemapFileName, and term.

Member Data Documentation

◆ p

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

Definition at line 51 of file sitemap.h.

Referenced by addIndexFile(), finalize(), initialize(), and Sitemap().

◆ sitemapFileName

const QCString Sitemap::sitemapFileName = "sitemap.xml"
inlinestatic

Definition at line 47 of file sitemap.h.

Referenced by initialize().


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