Isis 3 Programmer Reference
OriginalLabel.cpp
1
6/* SPDX-License-Identifier: CC0-1.0 */
7#include <fstream>
8#include <sstream>
9#include <string>
10#include "OriginalLabel.h"
11#include "Application.h"
12#include "PvlObject.h"
13
14using namespace std;
15namespace Isis {
20 m_originalLabel.setTerminator("");
21 }
22
23
30
31
38 OriginalLabel::OriginalLabel(const QString &file){
39 Blob blob = Blob("IsisCube", "OriginalLabel");
40 blob.Read(file);
41 fromBlob(blob);
42 }
43
44
52 m_originalLabel = pvl;
53 }
54
55 // Destructor
56 OriginalLabel::~OriginalLabel() {
57 }
58
59
66 Pvl pvl;
67 stringstream os;
68 char *buff = blob.getBuffer();
69 for(int i = 0; i < blob.Size(); i++){
70 os << buff[i];
71 }
72 os >> pvl;
73 m_originalLabel = pvl;
74 }
75
76
83 std::stringstream sstream;
84 sstream << m_originalLabel;
85 string orglblStr = sstream.str();
86 Isis::Blob blob("IsisCube", "OriginalLabel");
87 blob.setData(orglblStr.c_str(), orglblStr.size());
88 return blob;
89 }
90
91
98 return m_originalLabel;
99 }
100}
Isis::Blob toBlob()
Serialize the OriginalLabel data to a Blob.
OriginalLabel()
Constructor for creating an original blob with a given name.
Pvl ReturnLabels() const
Returns the labels in a Pvl object.
void fromBlob(Isis::Blob blob)
Initialize the OriginalLabel from a Blob.
Container for cube-like labels.
Definition Pvl.h:119
void setTerminator(const QString &term)
Sets the terminator used to signify the end of the PVL informationDefaults to "END".
Definition Pvl.h:144
This is free and unencumbered software released into the public domain.
Definition Apollo.h:16
Namespace for the standard library.