Computer Assisted Medical Intervention Tool Kit  version 6.0
Loading...
Searching...
No Matches
TransformEngine Class Reference

#include <TransformEngine.h>

Public Member Functions

bool setTemplateString (QString templateString)
 set the current template string
 TransformEngine ()
 Constructor set up the date and time.
 TransformEngine (QDate currentDate, QTime currentTime)
 Use this constructor for test purpose only (to fix the date and be able to compare output).
bool transformToFile (const QJsonObject &data, const QString &filename, bool overwrite=true)
 transform the current template string using the given data and save it to filename
QString transformToString (const QString &templateString, const QJsonObject &data)
 transform the given template using the given data to a string.

Detailed Description

Constructor & Destructor Documentation

◆ TransformEngine() [1/2]

TransformEngine::TransformEngine ( )

◆ TransformEngine() [2/2]

TransformEngine::TransformEngine ( QDate currentDate,
QTime currentTime )

Use this constructor for test purpose only (to fix the date and be able to compare output).

References TransformEngine().

Member Function Documentation

◆ setTemplateString()

bool TransformEngine::setTemplateString ( QString templateString)

◆ transformToFile()

bool TransformEngine::transformToFile ( const QJsonObject & data,
const QString & filename,
bool overwrite = true )

transform the current template string using the given data and save it to filename

Parameters
dataQJsonObject that contains the data used to transform the template
filenamethe filename to use
overwriteif false, the file is not overwritten if it already exists (default: true)
Returns
true if the file was generated
Note
filename can contain a variable (e.g. "/tmp/$name$.cpp" will use data["name"] to determine the actual filename)
Examples
/build/camitk-9Ht7pk/camitk-6.0.0/sdk/libraries/extensiongenerator/TransformEngine.h.

References transformToString().

◆ transformToString()

QString TransformEngine::transformToString ( const QString & templateString,
const QJsonObject & data )

transform the given template using the given data to a string.

You can use this method as a utility function it does not modify the class attributes apart from temporary loop counters

Examples
/build/camitk-9Ht7pk/camitk-6.0.0/sdk/libraries/extensiongenerator/TransformEngine.h.

Referenced by camitk::CppHotPlugAction::CppHotPlugAction(), camitk::HotPlugAction::HotPlugAction(), camitk::HotPlugActionExtension::HotPlugActionExtension(), and transformToFile().


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