NuriaProject Framework
0.1
The NuriaProject Framework
|
Loader of template data for TemplateEngine. More...
#include <templateloader.hpp>
Signals | |
void | allTemplatesChanged () |
void | templateChanged (const QString &name) |
Public Member Functions | |
TemplateLoader (QObject *parent=0) | |
~TemplateLoader () override | |
virtual bool | hasTemplate (const QString &name) |
virtual bool | hasTemplateChanged (const QString &name, const QDateTime &since) |
virtual QByteArray | load (const QString &name) |
Loader of template data for TemplateEngine.
A TemplateLoader can find templates by name and make them available to the engine and other templates.
Template loaders should make use of the two signals templateChanged and allTemplatesChanged to notify listeners, e.g. TemplateProgram caches, of changes to a template source file.
|
explicit |
Constructor.
|
override |
Destructor.
|
signal |
Signal emitted when all (or an unknown amount of) templates have changed.
|
virtual |
Returns true
if a template name is known to the template loader. The default implementation returns true
if name is not empty.
Reimplemented in Nuria::MemoryTemplateLoader, and Nuria::FileTemplateLoader.
|
virtual |
Returns true
if name has been changed since. The default implementation always returns false
, which is fine for template loaders making use of the changed signals in this class.
Reimplemented in Nuria::FileTemplateLoader.
|
virtual |
Returns the template data of the template called name. The default implementation returns name.
A empty result is treated as failure.
Reimplemented in Nuria::MemoryTemplateLoader, and Nuria::FileTemplateLoader.
|
signal |
Signal emitted when a specific template has changed.