My Project
|
Singleton for managing resources compiled into an executable. More...
#include <resourcemgr.h>
Classes | |
class | Private |
Public Member Functions | |
void | registerResources (const Resource resources[], int numResources) |
bool | writeCategory (const char *categoryName, const char *targetDir) const |
bool | copyResource (const char *name, const char *targetDir) const |
bool | copyResourceAs (const char *name, const char *targetDir, const char *targetName) const |
QCString | getAsString (const char *name) const |
Static Public Member Functions | |
static ResourceMgr & | instance () |
Private Member Functions | |
const Resource * | get (const char *name) const |
ResourceMgr () | |
~ResourceMgr () | |
Private Attributes | |
Private * | p |
Singleton for managing resources compiled into an executable.
Definition at line 32 of file resourcemgr.h.
|
private |
|
private |
bool ResourceMgr::copyResource | ( | const char * | name, |
const char * | targetDir | ||
) | const |
Copies a registered resource to a given target directory
Definition at line 162 of file resourcemgr.cpp.
References copyResourceAs().
Referenced by generateJSNavTree(), CiteDict::generatePage(), FTVHelp::generateTreeViewImages(), FTVHelp::generateTreeViewScripts(), generateXML(), HtmlGenerator::init(), TemplateNodeResource::render(), writeJavascriptSearchIndex(), HtmlGenerator::writeSearchData(), HtmlGenerator::writeSearchPage(), and HtmlGenerator::writeTabData().
bool ResourceMgr::copyResourceAs | ( | const char * | name, |
const char * | targetDir, | ||
const char * | targetName | ||
) | const |
Copies a registered resource to a given target directory under a given target name
Definition at line 79 of file resourcemgr.cpp.
References ColoredImgDataItem::alpha, Config_getInt, ColoredImgDataItem::content, Resource::CSS, Resource::data, err(), ColoredImgDataItem::height, Resource::LumAlpha, Resource::Luminance, ColoredImgDataItem::name, p, replaceColorMarkers(), Resource::size, substitute(), Resource::type, Resource::Verbatim, versionString, ColoredImgDataItem::width, and writeColoredImgData().
Referenced by copyResource(), and TemplateNodeResource::render().
|
private |
Returns a pointer to the resource object with the given name.
Definition at line 167 of file resourcemgr.cpp.
References p, and ResourceMgr::Private::resources.
QCString ResourceMgr::getAsString | ( | const char * | name | ) | const |
Gets the resource data as a C string
Definition at line 172 of file resourcemgr.cpp.
References Resource::data, and Resource::size.
Referenced by generateXML(), HtmlGenerator::init(), TemplateEngine::Private::loadByName(), writeDefaultStyleSheet(), HtmlGenerator::writeExternalSearchPage(), HtmlGenerator::writeFooterFile(), HtmlGenerator::writeHeaderFile(), HtmlGenerator::writeSearchData(), and HtmlGenerator::writeSearchPage().
|
static |
Returns the one and only instance of this class
Definition at line 35 of file resourcemgr.cpp.
Referenced by generateJSNavTree(), CiteDict::generatePage(), generateTemplateFiles(), FTVHelp::generateTreeViewImages(), FTVHelp::generateTreeViewScripts(), generateXML(), HtmlGenerator::init(), TemplateEngine::Private::loadByName(), TemplateNodeResource::render(), writeDefaultStyleSheet(), HtmlGenerator::writeExternalSearchPage(), HtmlGenerator::writeFooterFile(), HtmlGenerator::writeHeaderFile(), writeJavascriptSearchIndex(), HtmlGenerator::writeSearchData(), HtmlGenerator::writeSearchPage(), HtmlGenerator::writeStyleInfo(), HtmlGenerator::writeStyleSheetFile(), and HtmlGenerator::writeTabData().
void ResourceMgr::registerResources | ( | const Resource | resources[], |
int | numResources | ||
) |
Registers an array of resources
Definition at line 51 of file resourcemgr.cpp.
References p, and ResourceMgr::Private::resources.
bool ResourceMgr::writeCategory | ( | const char * | categoryName, |
const char * | targetDir | ||
) | const |
Writes all resource belonging to a given category to a given target directory
Definition at line 59 of file resourcemgr.cpp.
References Resource::category, Resource::data, err(), Resource::name, p, ResourceMgr::Private::resources, and Resource::size.
Referenced by generateTemplateFiles().
|
private |
Definition at line 59 of file resourcemgr.h.
Referenced by copyResourceAs(), get(), registerResources(), ResourceMgr(), writeCategory(), and ~ResourceMgr().