|
Doxygen
|
Singleton for managing resources compiled into an executable. More...
#include <src/resourcemgr.h>
Classes | |
| class | Private |
Public Member Functions | |
| void | registerResources (std::initializer_list< Resource > resources) |
| Registers an array of resources. | |
| bool | writeCategory (const QCString &categoryName, const QCString &targetDir) const |
| Writes all resource belonging to a given category to a given target directory. | |
| bool | copyResource (const QCString &name, const QCString &targetDir) const |
| Copies a registered resource to a given target directory. | |
| bool | copyResourceAs (const QCString &name, const QCString &targetDir, const QCString &targetName, bool append=false) const |
| Copies a registered resource to a given target directory under a given target name. | |
| QCString | getAsString (const QCString &name) const |
| Gets the resource data as a C string. | |
Static Public Member Functions | |
| static ResourceMgr & | instance () |
| Returns the one and only instance of this class. | |
Private Member Functions | |
| const Resource * | get (const QCString &name) const |
| Returns a pointer to the resource object with the given name. | |
| ResourceMgr () | |
| ~ResourceMgr () | |
Private Attributes | |
| std::unique_ptr< Private > | p |
Singleton for managing resources compiled into an executable.
Definition at line 36 of file resourcemgr.h.
|
private |
Definition at line 39 of file resourcemgr.cpp.
References p.
Referenced by instance().
|
private |
Definition at line 43 of file resourcemgr.cpp.
Copies a registered resource to a given target directory.
Definition at line 122 of file resourcemgr.cpp.
References copyResourceAs().
Referenced by CitationManager::generatePage(), generateXML(), HtmlGenerator::init(), HtmlGenerator::writeSearchPage(), and HtmlGenerator::writeTabData().
| bool ResourceMgr::copyResourceAs | ( | const QCString & | name, |
| const QCString & | targetDir, | ||
| const QCString & | targetName, | ||
| bool | append = false ) const |
Copies a registered resource to a given target directory under a given target name.
Definition at line 79 of file resourcemgr.cpp.
References Resource::data, err, QCString::ExplicitSize, FALSE, get(), Portable::openOutputStream(), QCString::rawData(), replaceColorMarkers(), Resource::size, Resource::SVG, TRUE, Resource::type, and Resource::Verbatim.
Referenced by copyResource().
Returns a pointer to the resource object with the given name.
Definition at line 127 of file resourcemgr.cpp.
References p, and QCString::str().
Referenced by copyResourceAs(), and getAsString().
Gets the resource data as a C string.
Definition at line 134 of file resourcemgr.cpp.
References Resource::data, QCString::ExplicitSize, get(), QCString::rawData(), and Resource::size.
Referenced by fillColorStyleMaps(), generateXML(), HtmlGenerator::getNavTreeCss(), HtmlGenerator::init(), LatexGenerator::init(), LayoutDocManager::init(), writeDefaultLayoutFile(), writeDefaultStyleSheet(), writeDefaultStyleSheet(), HtmlGenerator::writeExternalSearchPage(), HtmlGenerator::writeFooterFile(), LatexGenerator::writeFooterFile(), HtmlGenerator::writeHeaderFile(), LatexGenerator::writeHeaderFile(), HtmlGenerator::writeSearchData(), HtmlGenerator::writeSearchPage(), and LatexGenerator::writeStyleInfo().
|
static |
Returns the one and only instance of this class.
Definition at line 33 of file resourcemgr.cpp.
References ResourceMgr().
Referenced by fillColorStyleMaps(), generateJSNavTree(), CitationManager::generatePage(), generateXML(), HtmlGenerator::getNavTreeCss(), HtmlGenerator::init(), LatexGenerator::init(), LayoutDocManager::init(), writeDefaultLayoutFile(), writeDefaultStyleSheet(), writeDefaultStyleSheet(), HtmlGenerator::writeExternalSearchPage(), HtmlGenerator::writeFooterFile(), LatexGenerator::writeFooterFile(), HtmlGenerator::writeHeaderFile(), LatexGenerator::writeHeaderFile(), writeJavaScriptSearchIndex(), HtmlGenerator::writeSearchData(), HtmlGenerator::writeSearchPage(), LatexGenerator::writeStyleInfo(), and HtmlGenerator::writeTabData().
| void ResourceMgr::registerResources | ( | std::initializer_list< Resource > | resources | ) |
Writes all resource belonging to a given category to a given target directory.
Definition at line 55 of file resourcemgr.cpp.
References err, FALSE, Portable::openOutputStream(), p, and TRUE.
|
private |
Definition at line 66 of file resourcemgr.h.
Referenced by get(), registerResources(), ResourceMgr(), and writeCategory().