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. More...
 

Public Member Functions

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

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,
XmlStackedHandlerReader 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

References Isis::XmlStackedHandlerReader::pushContentHandler().

◆ ~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.

Referenced by Isis::TemplateList::deleteFromDisk().

◆ fileName()

◆ 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.

Referenced by Isis::TemplateList::save().

◆ 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: