|
Isis 3 Programmer Reference
|
6 #include "IException.h"
8 #include "XmlStackedHandlerReader.h"
60 return m_templateType;
89 if (!QFile::remove(m_fileName)) {
91 tr(
"Could not remove file [%1]").arg(m_fileName),
107 stream.writeStartElement(
"template");
108 stream.writeAttribute(
"fileName",
FileName(m_fileName).name());
109 stream.writeAttribute(
"templateType", m_templateType);
110 stream.writeAttribute(
"importName", m_importName);
111 stream.writeEndElement();
142 const QString &qName,
const QXmlAttributes &atts) {
143 if (XmlStackedHandler::startElement(namespaceURI, localName, qName, atts)) {
144 if (localName ==
"template") {
145 QString
fileName = atts.value(
"fileName");
147 QString
importName = atts.value(
"importName");
150 m_xmlHandlerTemplate->m_fileName = m_xmlHandlerTemplateFolderName.expanded()
161 m_xmlHandlerTemplate->m_importName =
importName;
FileName m_xmlHandlerTemplateFolderName
The name of the folder for the template xml.
static QString templateRoot(QString projectRoot)
Appends the root directory name 'templates' to the project .
@ Io
A type of error that occurred when performing an actual I/O operation.
QString name() const
Returns the name of the file excluding the path and the attributes in the file name.
File name manipulation and expansion.
virtual void pushContentHandler(XmlStackedHandler *newHandler)
Push a contentHandler and maybe continue parsing...
QString importName() const
Get the name of the TemplateList this file was imported under.
void deleteFromDisk()
Delete the template from disk.
Manage a stack of content handlers for reading XML files.
void updateFileName(Project *project)
Change the file name for this template to be where it now is with the given project.
Template * m_xmlHandlerTemplate
A pointer to the Template object to be read or written.
The main project for ipce.
Template(QString fileName, QString templateType, QString importName, QObject *parent=0)
Create a Template from template file's name.
void save(QXmlStreamWriter &stream, const Project *project, FileName newProjectRoot) const
Method to write this Template object's member data to an XML stream.
QString fileName() const
Get the file name that this Template represents.
virtual bool startElement(const QString &namespaceURI, const QString &localName, const QString &qName, const QXmlAttributes &atts)
Method to read the given XML formatted attribute for a Template object into the XmlHandler.
~Template()
Destroys Template object.
QString templateType() const
Get the type of template.
XmlHandler(Template *currentTemplate, FileName templateFolder)
Constructor for the Template object's XmlHandler.
This is free and unencumbered software released into the public domain.