Isis Developer Reference
Isis::Template Class Reference

#include <Template.h>

Inheritance diagram for Isis::Template:
Inheritance graph
Collaboration diagram for Isis::Template:
Collaboration graph

Public Slots

void updateFileName (Project *project)
 Change the file name for this template to be where it now is with the given project.
 

Public Member Functions

 Template (QString fileName, QString templateType, QString importName, QObject *parent=0)
 Create a Template from template file's name.
 
 Template (FileName templateFolder, QXmlStreamReader *xmlReader, QObject *parent=0)
 Construct this template from XML.
 
 ~Template ()
 Destroys Template object.
 
QString importName () const
 Get the name of the TemplateList this file was imported under.
 
QString fileName () const
 Get the file name that this Template represents.
 
QString templateType () const
 Get the type of template.
 
void deleteFromDisk ()
 Delete the template from disk.
 
void save (QXmlStreamWriter &stream, const Project *project, FileName newProjectRoot) const
 Method to write this Template object's member data to an XML stream.
 

Detailed Description

Author
2017-11-01 Christopher Combs

Constructor & Destructor Documentation

◆ Template() [1/2]

Isis::Template::Template ( QString fileName,
QString templateType,
QString importName,
QObject * parent = 0 )
explicit

Create a Template from template file's name.

Parameters
fileNameThe name of the template file on disk
templateTypeThe type of template being imported (Options are maps or registrations)
importNameThe name of the TemplateList this Template is imported in
parentThe Qt-relationship parent

References fileName(), importName(), and templateType().

◆ Template() [2/2]

Isis::Template::Template ( FileName templateFolder,
QXmlStreamReader * xmlReader,
QObject * parent = 0 )

Construct this template from XML.

Parameters
templateFolderLocation of template xml
xmlReaderAn XML reader that's up to an <template> tag.
parentThe Qt-relationship parent

◆ ~Template()

Isis::Template::~Template ( )

Destroys Template object.

Member Function Documentation

◆ deleteFromDisk()

void Isis::Template::deleteFromDisk ( )

Delete the template from disk.

Exceptions
IException::Io"Could not remove file."

References _FILEINFO_, and Isis::IException::Io.

◆ fileName()

QString Isis::Template::fileName ( ) const

Get the file name that this Template represents.

Returns
QString A string containing the path to the template file associated.

Referenced by Isis::TemplateEditorWidget::saveText(), Isis::TemplateEditViewWorkOrder::setupExecution(), Template(), and Isis::TemplateEditorWidget::TemplateEditorWidget().

◆ importName()

QString Isis::Template::importName ( ) const

Get the name of the TemplateList this file was imported under.

Returns
QString A string containing TemplateList's name.

Referenced by Template().

◆ save()

void Isis::Template::save ( QXmlStreamWriter & stream,
const Project * project,
FileName newProjectRoot ) const

Method to write this Template object's member data to an XML stream.

Parameters
streamThe stream to which the Template will be saved.
projectThe Project to which this Template will be added.
newProjectRootThe location of the project root directory.

◆ templateType()

QString Isis::Template::templateType ( ) const

Get the type of template.

Returns
QString The name of the directory to find this file under "templates".

Referenced by Template(), and Isis::TemplateEditorWidget::TemplateEditorWidget().

◆ updateFileName

void Isis::Template::updateFileName ( Project * project)
slot

Change the file name for this template to be where it now is with the given project.

Parameters
projectThe project that this file is stored in.

References Isis::FileName::name(), and Isis::Project::templateRoot().


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