Ananas Library 0.9.5
aOOTemplate Class Reference

#include <aootemplate.h>

Inheritance diagram for aOOTemplate:
iTemplate aCalcTemplate

Public Member Functions

virtual bool open (const QString &fname)
virtual void close ()
virtual void clear ()
virtual QString getValue (const QString &name)
virtual void setValue (const QString &name, const QString &value)
virtual QString exec (const QString &sname)
virtual QString result ()
virtual bool save (const QString &fname)
virtual void setDir (const QString &dirName)
virtual QString getDir ()
virtual void cleanUpTags ()
virtual bool lineFeedRemove (const QString &filename)
Public Member Functions inherited from iTemplate
 iTemplate ()
virtual ~iTemplate ()

Protected Member Functions

void searchTags (QDomNode node, const QString &sname)
virtual bool getNodeTags (QDomNode node, const QString &tagname, bool params)
void insertRowValues (QDomNode node)
virtual void insertTagsValues (QDomNode node, const QString &tagName)
void clearTags (QDomNode node, bool section)
void clearRow (QDomNode node)

Protected Attributes

QString copyName
QString templateDir
QMap< QString, QString > values
QDomDocument docTpl
QDomDocument docStyle

Detailed Description

Class for work with pattern in OpenOffice format

Member Function Documentation

◆ cleanUpTags()

void aOOTemplate::cleanUpTags ( )
virtual

clears all tags from pattern

Reimplemented from iTemplate.

References clearRow(), clearTags(), docStyle, and docTpl.

◆ clear()

void aOOTemplate::clear ( )
virtual

clears internal variable.

Reimplemented from iTemplate.

◆ clearRow()

void aOOTemplate::clearRow ( QDomNode node)
protected

Deletes row, having section tag

Parameters
node- context

References clearRow().

Referenced by cleanUpTags(), and clearRow().

◆ clearTags()

void aOOTemplate::clearTags ( QDomNode node,
bool section )
protected

Deletes tags from node

Parameters
node- context
section-

References clearTags().

Referenced by cleanUpTags(), clearTags(), and insertRowValues().

◆ close()

void aOOTemplate::close ( )
virtual

Closes pattern. Deletes temporary files.

Reimplemented from iTemplate.

References copyName, docStyle, and docTpl.

◆ exec()

QString aOOTemplate::exec ( const QString & sname)
virtual

Execute replace tags to values.

Reimplemented from iTemplate.

References docStyle, docTpl, getValue(), searchTags(), and setValue().

◆ getDir()

QString aOOTemplate::getDir ( )
virtual

Gets working directory

Reimplemented from iTemplate.

◆ getNodeTags()

bool aOOTemplate::getNodeTags ( QDomNode node,
const QString & tagname,
bool params )
protectedvirtual

Return true, if node contain tag

Parameters
node- context for searching
sname- tag name
params- true, if find simple tag and false, if section

Reimplemented in aCalcTemplate.

Referenced by searchTags().

◆ getValue()

QString aOOTemplate::getValue ( const QString & name)
virtual

Returns value parameter name

Reimplemented from iTemplate.

References aLog::print().

Referenced by exec(), aCalcTemplate::insertTagsValues(), and insertTagsValues().

◆ insertRowValues()

void aOOTemplate::insertRowValues ( QDomNode node)
protected

insert new row in table and replace tag to value

See also
searchTags()

References clearTags(), and searchTags().

Referenced by searchTags().

◆ insertTagsValues()

void aOOTemplate::insertTagsValues ( QDomNode node,
const QString & tagName )
protectedvirtual

Addes to tag value of parametr tagName

Parameters
node- context
sname- tag name

Reimplemented in aCalcTemplate.

References getValue().

Referenced by searchTags().

◆ lineFeedRemove()

bool aOOTemplate::lineFeedRemove ( const QString & filename)
virtual

Deletes from a file line feeds

References aLog::print().

Referenced by save().

◆ open()

bool aOOTemplate::open ( const QString & fname)
virtual

Open pattern.

Parameters
fname

Implements iTemplate.

References copyName, docStyle, docTpl, aLog::print(), and templateDir.

◆ result()

QString aOOTemplate::result ( )
virtual

Returns patten

Reimplemented from iTemplate.

References docTpl.

◆ save()

bool aOOTemplate::save ( const QString & fname)
virtual

Save pattern

Reimplemented from iTemplate.

References copyName, docStyle, docTpl, lineFeedRemove(), aLog::print(), and templateDir.

◆ searchTags()

void aOOTemplate::searchTags ( QDomNode node,
const QString & sname )
protected

Added value to end tag with name ‘sname’. Don't deletes tag.

Parameters
node- context for searching
sname- tag name
See also
cleanUpTags() getNodeTags() insertRowValues()

References getNodeTags(), insertRowValues(), insertTagsValues(), and searchTags().

Referenced by exec(), insertRowValues(), and searchTags().

◆ setDir()

void aOOTemplate::setDir ( const QString & dir)
virtual

Sets working directory

Reimplemented from iTemplate.

References templateDir.

◆ setValue()

void aOOTemplate::setValue ( const QString & name,
const QString & value )
virtual

Sets value parameter ‘name’

Reimplemented from iTemplate.

Referenced by exec().

Member Data Documentation

◆ copyName

QString aOOTemplate::copyName
protected

directory name for unzip

Referenced by close(), open(), and save().

◆ docStyle

QDomDocument aOOTemplate::docStyle
protected

Variable for store unpacking teplate stales

Referenced by cleanUpTags(), close(), exec(), open(), and save().

◆ docTpl

QDomDocument aOOTemplate::docTpl
protected

Variable for store unpacking teplate content

Referenced by cleanUpTags(), close(), exec(), open(), result(), and save().

◆ templateDir

QString aOOTemplate::templateDir
protected

directory template name

Referenced by open(), save(), and setDir().


The documentation for this class was generated from the following files: