Official websites use .gov
A .gov website belongs to an official government organization in the United States.

Secure .gov websites use HTTPS
A lock ( ) or https:// means you’ve safely connected to the .gov website. Share sensitive information only on official, secure websites.

Isis 3 Programmer Reference
OriginalLabel.cpp
1
5
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
27 OriginalLabel::OriginalLabel(Isis::Blob &blob) {
28 fromBlob(blob);
29 }
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
65 void OriginalLabel::fromBlob(Isis::Blob blob) {
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
82 Isis::Blob OriginalLabel::toBlob() {
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.
This is free and unencumbered software released into the public domain.
Definition Apollo.h:16
Namespace for the standard library.