13 #include "Application.h"
14 #include "PvlObject.h"
23 p_history.setTerminator(
"");
32 p_history.setTerminator(
"");
35 p_bufferSize = blob.
Size();
36 p_histBuffer =
new char[p_bufferSize];
37 memcpy(p_histBuffer, blob_buffer, p_bufferSize);
43 if (p_histBuffer != NULL) {
44 delete [] p_histBuffer;
52 void History::AddEntry() {
64 p_history.addObject(obj);
75 Blob History::toBlob(
const QString &name) {
77 if (p_bufferSize > 0) ostr << std::endl;
79 string histStr = ostr.str();
80 int bytes = histStr.size();
82 int blobBufferSize = p_bufferSize+bytes;
83 char *blobBuffer =
new char[blobBufferSize];
84 if (p_histBuffer != NULL) memcpy(blobBuffer, p_histBuffer, p_bufferSize);
85 const char *ptr = histStr.c_str();
86 memcpy(&blobBuffer[p_bufferSize], (
void *)ptr, bytes);
88 Blob newBlob(name,
"History");
89 newBlob.
takeData(blobBuffer, blobBufferSize);
99 Pvl History::ReturnHist() {
102 for (
int i = 0; i < p_bufferSize; i++) os << p_histBuffer[i];
104 for (
int i = 0; i < p_history.objects(); i++) {
105 os << std::endl << p_history.
object(i);