Marble::TemplateDocument

Search for usage in LXR

Marble::TemplateDocument Class Reference

#include <TemplateDocument.h>

Public Member Functions

 TemplateDocument (const QString &templateText)
 
QString finalText () const
 
QStringoperator[] (const QString &key)
 
void setTemplate (const QString &newTemplateText)
 
void setValue (const QString &key, const QString &value)
 
QString value (const QString &key) const
 

Detailed Description

The Template Document.

The class represents a template engine for Marble HTML/plain text. It allows to template big documents with variables like variable_name% or to make includes like %!{include_name}%

"Include" is a special type of template variables which allows to include extra already templated text into the template. E.g. %!{bootstrap}% will include bootstrap CSS files into html file, where this include is called

See also
TemplateDocument()

Definition at line 33 of file TemplateDocument.h.

Member Function Documentation

◆ finalText()

QString Marble::TemplateDocument::finalText ( ) const

Final proceed text.

Returns
ready text with all variables and includes processed

Definition at line 86 of file TemplateDocument.cpp.

◆ operator[]()

QString & Marble::TemplateDocument::operator[] ( const QString key)

Indexator for template values.

Parameters
keytemplate value's index
Returns
reference for the item

Definition at line 81 of file TemplateDocument.cpp.

◆ setTemplate()

void Marble::TemplateDocument::setTemplate ( const QString newTemplateText)

Set template text.

Parameters
newTemplateTextnew template text

Definition at line 66 of file TemplateDocument.cpp.

◆ setValue()

void Marble::TemplateDocument::setValue ( const QString key,
const QString value 
)

Change set template value into new one.

Parameters
keytemplate key
valuetemplate value

Definition at line 76 of file TemplateDocument.cpp.

◆ value()

QString Marble::TemplateDocument::value ( const QString key) const

Returns the current template value of key.

Parameters
keytemplate key (<here>)
Returns
value of the template

Definition at line 71 of file TemplateDocument.cpp.


The documentation for this class was generated from the following files:
This file is part of the KDE documentation.
Documentation copyright © 1996-2022 The KDE developers.
Generated on Tue Dec 6 2022 03:54:40 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.