Grantlee
0.4.0
|
The InMemoryTemplateLoader loads Templates set dynamically in memory. More...
#include <grantlee/templateloader.h>
Public Member Functions | |
bool | canLoadTemplate (const QString &name) const |
QPair< QString, QString > | getMediaUri (const QString &fileName) const |
Template | loadByName (const QString &name, Engine const *engine) const |
void | setTemplate (const QString &name, const QString &content) |
![]() | |
virtual | ~AbstractTemplateLoader () |
Additional Inherited Members | |
![]() | |
typedef QSharedPointer < AbstractTemplateLoader > | Ptr |
This class is mostly used for testing purposes, but can also be used for simple uses of Grantlee.
Templates can be made available using the setTemplate method, and will then be retrieved by the Grantlee::Engine as appropriate.
Definition at line 221 of file templateloader.h.
|
virtual |
Return true if a Template identified by name
exists and can be loaded.
Implements Grantlee::AbstractTemplateLoader.
|
virtual |
Return a complete URI for media identified by fileName.
Implements Grantlee::AbstractTemplateLoader.
|
virtual |
Load a Template called name
. Return an invalid Template if no content by that name exists.
Implements Grantlee::AbstractTemplateLoader.
void Grantlee::InMemoryTemplateLoader::setTemplate | ( | const QString & | name, |
const QString & | content | ||
) |
Add a template content to this Loader.
Example: