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.

Constructor & Destructor Documentation

◆ TemplateDocument() [1/2]

Marble::TemplateDocument::TemplateDocument ( )

Definition at line 48 of file TemplateDocument.cpp.

◆ TemplateDocument() [2/2]

Marble::TemplateDocument::TemplateDocument ( const QString & templateText)
explicit

Definition at line 53 of file TemplateDocument.cpp.

◆ ~TemplateDocument()

Marble::TemplateDocument::~TemplateDocument ( )

Definition at line 59 of file TemplateDocument.cpp.

Member Function Documentation

◆ finalText()

QString Marble::TemplateDocument::finalText ( ) const

Final proceed text.

Returns
ready text with all variables and includes processed

Definition at line 84 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 79 of file TemplateDocument.cpp.

◆ setTemplate()

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

Set template text.

Parameters
newTemplateTextnew template text

Definition at line 64 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 74 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 69 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-2024 The KDE developers.
Generated on Fri Nov 8 2024 12:02:45 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.