14#include "OriginalXmlLabel.h"
15#include "Application.h"
33 Blob blob =
Blob(
"IsisCube",
"OriginalXmlLabel");
58 void OriginalXmlLabel::fromBlob(
Isis::Blob blob) {
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;
79 std::stringstream sstream;
81 string orglblStr = sstream.str();
82 Isis::Blob blob(
"IsisCube",
"OriginalXmlLabel");
83 blob.
setData((
char*)orglblStr.data(), orglblStr.length());
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() +
113 if ( !
m_originalLabel.setContent(&xmlFile,
false, &errmsg, &errline, &errcol) ) {
115 QString msg =
"XML read/parse error in file [" + xmlFileName.
expanded()
117 +
"], message: " + errmsg;
int Size() const
Accessor method that returns the number of bytes in the blob data.
void setData(const char *buffer, int nbytes)
Set the data stored in the BLOB.
void Read(const QString &file, const std::vector< PvlKeyword > keywords=std::vector< PvlKeyword >())
This method reads Pvl values from a specified file.
char * getBuffer()
Get the internal data buff of the Blob.
PvlObject & Label()
Accessor method that returns a PvlObject containing the Blob label.
File name manipulation and expansion.
QString expanded() const
Returns a QString of the full file name including the file path, excluding the attributes.
@ Unknown
A type of error that cannot be classified as any of the other error types.
@ Io
A type of error that occurred when performing an actual I/O operation.
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.
A single keyword-value pair.
This is free and unencumbered software released into the public domain.
bool IsLsb()
Return true if this host is an LSB first machine and false if it is not.
QString toString(bool boolToConvert)
Global function to convert a boolean to a string.
Namespace for the standard library.