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

singleton class that owns the list of all sections More...

#include <src/section.h>

+ Inheritance diagram for SectionManager:
+ Collaboration diagram for SectionManager:

Public Member Functions

SectionInfoadd (const SectionInfo &si)
 Add a new section given the data of an existing section.
 
SectionInfoadd (const QCString &label, const QCString &fileName, int lineNr, const QCString &title, SectionType type, int level, const QCString &ref=QCString())
 Add a new section Return a non-owning pointer to the newly added section.
 
SectionInforeplace (const QCString &label, const QCString &fileName, int lineNr, const QCString &title, SectionType type, int level, const QCString &ref=QCString())
 Replace an existing section with a new one Return a non-owning pointer to the newly added section.
 
- Public Member Functions inherited from LinkedMap< SectionInfo >
const SectionInfofind (const std::string &key) const
 Find an object given the key.
 
const SectionInfofind (const QCString &key) const
 Find an object given the key.
 
const SectionInfofind (const char *key) const
 Find an object given the key.
 
SectionInfofind (const char *key)
 A non-const wrapper for find() const.
 
SectionInfofind (const QCString &key)
 A non-const wrapper for find() const.
 
SectionInfofind (const std::string &key)
 A non-const wrapper for find() const.
 
SectionInfoadd (const char *k, Args &&... args)
 Adds a new object to the ordered vector if it was not added already.
 
SectionInfoadd (const QCString &k, Args &&... args)
 
SectionInfoadd (const char *k, Ptr &&ptr)
 Adds an existing object to the ordered vector (unless another object was already added under the same key).
 
SectionInfoadd (const QCString &k, Ptr &&ptr)
 
SectionInfoprepend (const char *k, Args &&... args)
 Prepends a new object to the ordered vector if it was not added already.
 
SectionInfoprepend (const QCString &key, Args &&... args)
 
bool del (const QCString &key)
 Removes an object from the container and deletes it.
 
Ptroperator[] (size_t pos)
 
const Ptroperator[] (size_t pos) const
 
iterator begin ()
 
const_iterator begin () const
 
iterator end ()
 
const_iterator end () const
 
reverse_iterator rbegin ()
 
const_reverse_iterator rbegin () const
 
reverse_iterator rend ()
 
const_reverse_iterator rend () const
 
bool empty () const
 
size_t size () const
 
void clear ()
 

Static Public Member Functions

static SectionManagerinstance ()
 returns a reference to the singleton
 

Private Member Functions

 SectionManager ()=default
 
 ~SectionManager ()=default
 

Additional Inherited Members

- Public Types inherited from LinkedMap< SectionInfo >
using Ptr
 
using Vec
 
using iterator
 
using const_iterator
 
using reverse_iterator
 
using const_reverse_iterator
 

Detailed Description

singleton class that owns the list of all sections

Definition at line 133 of file section.h.

Constructor & Destructor Documentation

◆ SectionManager()

SectionManager::SectionManager ( )
privatedefault

Referenced by instance(), and ~SectionManager().

◆ ~SectionManager()

SectionManager::~SectionManager ( )
privatedefault

References SectionManager().

Member Function Documentation

◆ add() [1/2]

SectionInfo * SectionManager::add ( const QCString & label,
const QCString & fileName,
int lineNr,
const QCString & title,
SectionType type,
int level,
const QCString & ref = QCString() )
inline

Add a new section Return a non-owning pointer to the newly added section.

Definition at line 146 of file section.h.

148 {
149 return LinkedMap<SectionInfo>::add(label.data(),fileName,lineNr,title,type,level,ref);
150 }
T * add(const char *k, Args &&... args)
Adds a new object to the ordered vector if it was not added already.
Definition linkedmap.h:90
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

References LinkedMap< T, Hash, KeyEqual, Map >::add(), and QCString::data().

◆ add() [2/2]

SectionInfo * SectionManager::add ( const SectionInfo & si)
inline

Add a new section given the data of an existing section.

Returns a non-owning pointer to the newly added section.

Definition at line 138 of file section.h.

139 {
141 si.lineNr(),si.title(),si.type(),si.level(),si.ref());
142 }
QCString label() const
Definition section.h:68
QCString ref() const
Definition section.h:71
QCString fileName() const
Definition section.h:73
int lineNr() const
Definition section.h:72
QCString title() const
Definition section.h:69
SectionType type() const
Definition section.h:70
int level() const
Definition section.h:75

References LinkedMap< T, Hash, KeyEqual, Map >::add(), SectionInfo::fileName(), SectionInfo::label(), SectionInfo::level(), SectionInfo::lineNr(), SectionInfo::ref(), SectionInfo::title(), and SectionInfo::type().

Referenced by addAnchor(), anonymous_namespace{tagreader.cpp}::TagFileParser::addDocAnchors(), addRelatedPage(), addSection(), DefinitionImpl::addSectionsToDefinition(), addXRefItem(), anonymous_namespace{tagreader.cpp}::TagFileParser::buildLists(), and findMainPage().

◆ instance()

◆ replace()

SectionInfo * SectionManager::replace ( const QCString & label,
const QCString & fileName,
int lineNr,
const QCString & title,
SectionType type,
int level,
const QCString & ref = QCString() )
inline

Replace an existing section with a new one Return a non-owning pointer to the newly added section.

Definition at line 154 of file section.h.

156 {
157 SectionInfo *si = LinkedMap<SectionInfo>::find(label.data());
158 if (si)
159 {
160 si->setFileName(fileName);
161 si->setLineNr(lineNr);
162 si->setTitle(title);
163 si->setType(type);
164 si->setLevel(level);
165 si->setReference(ref);
166 return si;
167 }
168 else
169 {
170 return LinkedMap<SectionInfo>::add(label.data(),fileName,lineNr,title,type,level,ref);
171 }
172 }
const T * find(const std::string &key) const
Find an object given the key.
Definition linkedmap.h:47
void setType(SectionType t)
Definition section.h:80
void setLineNr(int l)
Definition section.h:86
void setReference(const QCString &r)
Definition section.h:85
void setFileName(const QCString &fn)
Definition section.h:79
void setLevel(int l)
Definition section.h:84
void setTitle(const QCString &t)
Definition section.h:83

References LinkedMap< T, Hash, KeyEqual, Map >::add(), QCString::data(), LinkedMap< T, Hash, KeyEqual, Map >::find(), SectionInfo::setFileName(), SectionInfo::setLevel(), SectionInfo::setLineNr(), SectionInfo::setReference(), SectionInfo::setTitle(), and SectionInfo::setType().

Referenced by addAnchor(), anonymous_namespace{tagreader.cpp}::TagFileParser::addDocAnchors(), addRelatedPage(), addSection(), addXRefItem(), and findMainPage().


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