|
NuriaProject Framework
0.1
The NuriaProject Framework
|
A template loader which stores templates in-memory. More...
#include <memorytemplateloader.hpp>
Public Types | |
| typedef QMap< QString, QByteArray > | Map |
Public Member Functions | |
| MemoryTemplateLoader (QObject *parent=0) | |
| MemoryTemplateLoader (Map map, QObject *parent=0) | |
| ~MemoryTemplateLoader () override | |
| void | addTemplate (const QString &name, const QByteArray &data) |
| bool | hasTemplate (const QString &name) override |
| QByteArray | load (const QString &name) override |
| Map | map () const |
| void | removeTemplate (const QString &name) |
| void | setMap (const Map &map) |
Public Member Functions inherited from Nuria::TemplateLoader | |
| TemplateLoader (QObject *parent=0) | |
| ~TemplateLoader () override | |
| virtual bool | hasTemplateChanged (const QString &name, const QDateTime &since) |
Additional Inherited Members | |
Signals inherited from Nuria::TemplateLoader | |
| void | allTemplatesChanged () |
| void | templateChanged (const QString &name) |
A template loader which stores templates in-memory.
This template loader is essentially a wraper around a associative array, as in a QMap, storing templates completely in-memory.
| typedef QMap< QString, QByteArray > Nuria::MemoryTemplateLoader::Map |
The storage type for templates. The key is the template name and the corresponding value the template data.
|
explicit |
Default constructor. The template map is empty.
|
explicit |
Constructor which uses map as template storage.
|
override |
Destructor.
| void Nuria::MemoryTemplateLoader::addTemplate | ( | const QString & | name, |
| const QByteArray & | data | ||
| ) |
Adds a template called name with data. If there's already a template with this name, the old one will be overridden.
|
overridevirtual |
Returns true if a template name is known to the template loader. The default implementation returns true if name is not empty.
Reimplemented from Nuria::TemplateLoader.
|
overridevirtual |
Returns the data of template name.
Reimplemented from Nuria::TemplateLoader.
| Map Nuria::MemoryTemplateLoader::map | ( | ) | const |
Returns the template map.
| void Nuria::MemoryTemplateLoader::removeTemplate | ( | const QString & | name | ) |
Removes the template called name.
| void Nuria::MemoryTemplateLoader::setMap | ( | const Map & | map | ) |
Sets the template map.
1.8.9.1