14#include "OriginalXmlLabel.h"
15#include "Application.h"
33 Blob blob = Blob(
"IsisCube",
"OriginalXmlLabel");
58 void OriginalXmlLabel::fromBlob(Isis::Blob blob) {
63 if ( !
m_originalLabel.setContent( QByteArray(blob.getBuffer(), blob.Size()) ) ) {
64 QString msg =
"XML read/parse error when parsing original label. "
65 "Error at line [" +
toString(errorLine) +
66 "], column [" +
toString(errorColumn) +
67 "]. Error message: " + errorMessage;
68 throw IException(IException::Unknown, msg, _FILEINFO_);
79 std::stringstream sstream;
81 string orglblStr = sstream.str();
82 Isis::Blob blob(
"IsisCube",
"OriginalXmlLabel");
83 blob.setData((
char*)orglblStr.data(), orglblStr.length());
84 blob.Label() += Isis::PvlKeyword(
"ByteOrder",
"NULL");
86 blob.Label()[
"ByteOrder"] = Isis::ByteOrderName(Isis::Lsb);
89 blob.Label()[
"ByteOrder"] = Isis::ByteOrderName(Isis::Msb);
104 QFile xmlFile(xmlFileName.expanded());
105 if ( !xmlFile.open(QIODevice::ReadOnly) ) {
106 QString msg =
"Could not open label file [" + xmlFileName.expanded() +
108 throw IException(IException::Io, msg, _FILEINFO_);
113 if ( !
m_originalLabel.setContent(&xmlFile,
false, &errmsg, &errline, &errcol) ) {
115 QString msg =
"XML read/parse error in file [" + xmlFileName.expanded()
117 +
"], message: " + errmsg;
118 throw IException(IException::Unknown, msg, _FILEINFO_);
const QDomDocument & ReturnLabels() const
Returns the original Xml label.
void readFromXmlFile(const FileName &xmlFileName)
Read the original label from an Xml file.
QDomDocument m_originalLabel
Original Xml Label.
OriginalXmlLabel()
Constructors a default OriginalXmlLabel with an empty label.
~OriginalXmlLabel()
Destructor.
Blob toBlob() const
Serialize the OriginalXmlLabel to a Blob.
This is free and unencumbered software released into the public domain.
QString toString(const LinearAlgebra::Vector &vector, int precision)
A global function to format LinearAlgebra::Vector as a QString with the given precision.
Namespace for the standard library.