Loading...
Searching...
No Matches
ManifestXml Class Reference

`#include <manifestxml.h>`

## Public Member Functions

| ManifestXml (QuaZip *p_quaZip)
virtual | ~ManifestXml ()

## Private Member Functions

void | WriteHeader ()

## Private Attributes

QuaZip * | _p_quaZip
QXmlStreamWriter * | _p_writer

## Static Private Attributes

static QString | _namespaceURI

## Detailed Description

Definition at line 26 of file manifestxml.h.

## Constructor & Destructor Documentation

## ManifestXml()

ManifestXml::ManifestXml | ( | QuaZip * | p_quaZip | ) |

Definition at line 28 of file manifestxml.cpp.

: _p_quaZip(p_quaZip)
{
QuaZipFile outFile(_p_quaZip);
QuaZipNewInfo info("META-INF/manifest.xml");
outFile.open(QIODevice::WriteOnly, info);
_p_writer = new QXmlStreamWriter(&outFile);
_p_writer->setAutoFormatting(true);
this->WriteHeader();
_p_writer->writeStartElement(_namespaceURI, "file-entry");
_p_writer->writeAttribute(_namespaceURI, "full-path", "/");
_p_writer->writeAttribute(_namespaceURI,
"media-type",
"application/vnd.oasis.opendocument.spreadsheet");
_p_writer->writeEndElement();
_p_writer->writeStartElement(_namespaceURI, "file-entry");
_p_writer->writeAttribute(_namespaceURI, "full-path", "styles.xml");
_p_writer->writeAttribute(_namespaceURI, "media-type", "text/xml");
_p_writer->writeEndElement();
_p_writer->writeStartElement(_namespaceURI, "file-entry");
_p_writer->writeAttribute(_namespaceURI, "full-path", "content.xml");
_p_writer->writeAttribute(_namespaceURI, "media-type", "text/xml");
_p_writer->writeEndElement();
_p_writer->writeStartElement(_namespaceURI, "file-entry");
_p_writer->writeAttribute(_namespaceURI, "full-path", "meta.xml");
_p_writer->writeAttribute(_namespaceURI, "media-type", "text/xml");
_p_writer->writeEndElement();
//<manifest:file-entry manifest:full-path="mimetype"
// manifest:media-type="text/plain" />
/*
_p_writer->writeStartElement(_namespaceURI, "file-entry");
_p_writer->writeAttribute(_namespaceURI, "full-path", "mimetype");
_p_writer->writeAttribute(_namespaceURI, "media-type", "text/plain");
_p_writer->writeEndElement();
*/
//<manifest:file-entry manifest:full-path="META-INF/manifest.xml"
// manifest:media-type="text/xml" />
/*
_p_writer->writeStartElement(_namespaceURI,"file-entry");
_p_writer->writeAttribute(_namespaceURI, "full-path",
"META-INF/manifest.xml"); _p_writer->writeAttribute(_namespaceURI,
"media-type", "text/xml"); _p_writer->writeEndElement();
*/
//<manifest:file-entry manifest:full-path="settings.xml"
//manifest:media-type="text/xml"/>
_p_writer->writeStartElement(_namespaceURI, "file-entry");
_p_writer->writeAttribute(_namespaceURI, "full-path", "settings.xml");
_p_writer->writeAttribute(_namespaceURI, "media-type", "text/xml");
_p_writer->writeEndElement();
_p_writer->writeEndDocument();
delete _p_writer;
outFile.close();
}
ManifestXml::WriteHeader
void WriteHeader()
Definition manifestxml.cpp:97
ManifestXml::_namespaceURI
static QString _namespaceURI
Definition manifestxml.h:34
ManifestXml::_p_writer
QXmlStreamWriter * _p_writer
Definition manifestxml.h:38
ManifestXml::_p_quaZip
QuaZip * _p_quaZip
Definition manifestxml.h:37

References _namespaceURI, _p_quaZip, _p_writer, and WriteHeader().

## ~ManifestXml()

ManifestXml::~ManifestXml | ( |  | ) |

virtual

Definition at line 92 of file manifestxml.cpp.

{
}

## Member Function Documentation

## WriteHeader()

void ManifestXml::WriteHeader | ( |  | ) |

private

Definition at line 97 of file manifestxml.cpp.

{
_p_writer->writeStartDocument("1.0");
//<manifest:manifest
//xmlns:manifest="urn:oasis:names:tc:opendocument:xmlns:manifest:1.0"
//manifest:version="1.2" >
_p_writer->writeNamespace(_namespaceURI, "manifest");
_p_writer->writeStartElement(_namespaceURI, "manifest");
_p_writer->writeAttribute(_namespaceURI, "version", "1.2");
//_p_writer->setPrefix("manifest", namespaceURI);
//_p_writer->setDefaultNamespace(namespaceURI);
//_p_writer->writeStartElement("mzXML");
//_p_writer->writeAttribute(xmlnsxsi, "schemaLocation", xsischemaLocation);
// not compatible with MS office 2010 :
//_p_writer->writeAttribute("manifest", namespaceURI, "version", "1.2");
}

References _namespaceURI, and _p_writer.

Referenced by ManifestXml().

## Member Data Documentation

## _namespaceURI

QString ManifestXml::_namespaceURI

static private

Initial value:
=
"urn:oasis:names:tc:opendocument:xmlns:manifest:1.0"

Definition at line 34 of file manifestxml.h.

Referenced by ManifestXml(), and WriteHeader().

## _p_quaZip

QuaZip* ManifestXml::_p_quaZip

private

Definition at line 37 of file manifestxml.h.

Referenced by ManifestXml().

## _p_writer

QXmlStreamWriter* ManifestXml::_p_writer

private

Definition at line 38 of file manifestxml.h.

Referenced by ManifestXml(), and WriteHeader().

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

- odsstream/writer/structure/manifestxml.h
- odsstream/writer/structure/manifestxml.cpp