USGS

Isis 3.0 Object Programmers' Reference

Home

Isis::OriginalLabel Class Reference
[Low Level Cube I/O]

#include <OriginalLabel.h>

Inheritance diagram for Isis::OriginalLabel:

Inheritance graph
[legend]
Collaboration diagram for Isis::OriginalLabel:

Collaboration graph
[legend]
List of all members.

Detailed Description

Read and store original labels.

This class provides a means to read and store the labels from the original source. The labels can be retreived in a Pvl object.

Author:
2006-02-23 Robert Wallace and Brian Lipkowitz
History:
2006-06-13 Brendan George - Modified to throw error when called file does not contain an Original Label
History:
2006-12-11 Kris Becker - Fixed bug in WriteInit method using a temporary string to reference a char pointer to its contents. The string remain after the reference or its toast.
History:
2008-06-18 Steven Koechle - Fixed Documentation Errors

Definition at line 50 of file OriginalLabel.h.

Public Member Functions

 OriginalLabel ()
 Constructor for creating an original blob with a given name.
 OriginalLabel (const std::string &file)
 Constructor for creating an original blob with a given name and file to read labels from.
 OriginalLabel (Pvl pvl)
 Constructor for creating an original blob with a given name and Pvl container.
 ~OriginalLabel ()
Pvl ReturnLabels ()
 Returns the labels in a Pvl object.
void Read (Isis::Pvl &pvl, std::fstream &is)
 Fill pvl with original label data.
void Read (const std::string &file)
 This reads Pvl values from a specified file.
void Write (const std::string &file)
 Write the blob data out to a file.
void Write (Isis::Pvl &pvl, std::fstream &istm, const std::string &detachedFilename="")
 Write the blob data out to a Pvl object.
std::string Type () const
std::string Name () const
PvlObjectLabel ()

Protected Member Functions

void WriteInit ()
 Prepare labels for writing to the output cube.
void Find (Isis::Pvl &pvl)
virtual void ReadInit ()
virtual void ReadData (std::fstream &is)
 Read binary data from an input stream into the Blob.
virtual void WriteData (std::fstream &os)
 Writes blob data to a stream.

Protected Attributes

Isis::PvlObject p_blobPvl
 Pvl Blob object.
std::string p_blobName
 Name of the Blob object.
char * p_buffer
 Buffer blob data is stored in.
BigInt p_startByte
 Byte blob data starts at in buffer.
int p_nbytes
 Size of blob data (in bytes).
std::string p_type
 Type of data stored in the buffer.
std::string p_detached
 Used for reading detached blobs.
std::string p_labelFile
 The file containing the labels.

Private Attributes

Pvl m_originalLabel


Constructor & Destructor Documentation

Isis::OriginalLabel::OriginalLabel (  ) 

Constructor for creating an original blob with a given name.

Definition at line 35 of file OriginalLabel.cpp.

References m_originalLabel, and Isis::Pvl::SetTerminator().

Isis::OriginalLabel::OriginalLabel ( const std::string &  file  ) 

Constructor for creating an original blob with a given name and file to read labels from.

Parameters:
file File to read labels from

Definition at line 45 of file OriginalLabel.cpp.

References Isis::Blob::Read().

Isis::OriginalLabel::OriginalLabel ( Pvl  pvl  ) 

Constructor for creating an original blob with a given name and Pvl container.

Parameters:
pvl Pvl containing labels of the source

Definition at line 56 of file OriginalLabel.cpp.

References m_originalLabel, and pvl().


Member Function Documentation

void Isis::Blob::Read ( const std::string &  file  )  [inherited]

This reads Pvl values from a specified file.

Parameters:
file The filename to read from.
Exceptions:
Isis::iException::Io - Unable to open file
Isis::iException::Pvl - Invalid label format

Definition at line 141 of file Blob.cpp.

References _FILEINFO_, e, Isis::Message::FileOpen(), in, Isis::iException::Message(), Isis::Blob::p_blobName, Isis::Blob::p_type, and pvl().

Referenced by Isis::Blob::Blob(), Isis::History::History(), OriginalLabel(), Read(), Isis::History::Read(), Isis::Cube::Read(), and Isis::Table::Table().

void Isis::OriginalLabel::Read ( Isis::Pvl pvl,
std::fstream &  is 
) [virtual]

Fill pvl with original label data.

Parameters:
[out] pvl Pvl to store original label data
[out] is file stream to get data from

Reimplemented from Isis::Blob.

Definition at line 107 of file OriginalLabel.cpp.

References pvl(), and Isis::Blob::Read().

void Isis::Blob::ReadData ( std::fstream &  stream  )  [protected, virtual, inherited]

Read binary data from an input stream into the Blob.

Parameters:
stream The input stream to read from.
Exceptions:
Isis::iException::Io - Error reading data from stream

Reimplemented in Isis::ImagePolygon, and Isis::Table.

Definition at line 267 of file Blob.cpp.

References _FILEINFO_, Isis::iException::Message(), Isis::Blob::p_blobName, Isis::Blob::p_buffer, Isis::Blob::p_nbytes, Isis::Blob::p_startByte, and Isis::Blob::p_type.

Referenced by Isis::Blob::Read().

Pvl Isis::OriginalLabel::ReturnLabels (  ) 

Returns the labels in a Pvl object.

Returns:
(Isis::Pvl) original labels

Definition at line 93 of file OriginalLabel.cpp.

References Isis::Blob::p_buffer, Isis::Blob::p_nbytes, and pvl().

void Isis::Blob::Write ( Isis::Pvl pvl,
std::fstream &  stm,
const std::string &  detachedFilename = "" 
) [inherited]

Write the blob data out to a Pvl object.

Parameters:
pvl The pvl object to update
stm stream to write data to
detachedFilename If the stream is detached from the labels give the name of the file

Definition at line 345 of file Blob.cpp.

References Isis::PvlContainer::DeleteKeyword(), Isis::PvlContainer::Name(), Isis::Blob::p_blobPvl, Isis::Blob::p_nbytes, Isis::Blob::p_type, pvl(), Isis::Blob::WriteData(), and Isis::Blob::WriteInit().

void Isis::Blob::Write ( const std::string &  file  )  [inherited]

Write the blob data out to a file.

Parameters:
file The filename to write to.
Exceptions:
Isis::iException::Io - Unable to open file
Isis::iException::Io - Error preparing to write data to file
Isis::iException::Io - Error creating file

Definition at line 296 of file Blob.cpp.

References _FILEINFO_, e, in, Isis::iException::Message(), Isis::Blob::p_blobName, Isis::Blob::p_blobPvl, Isis::Blob::p_nbytes, Isis::Blob::p_startByte, Isis::Blob::p_type, pvl(), Isis::Blob::WriteData(), and Isis::Blob::WriteInit().

Referenced by Isis::Cube::Write().

void Isis::Blob::WriteData ( std::fstream &  stream  )  [protected, virtual, inherited]

Writes blob data to a stream.

Parameters:
stream Output steam blob data will be written to
Exceptions:
Isis::iException::Io - Error writing data to stream

Reimplemented in Isis::ImagePolygon, and Isis::Table.

Definition at line 422 of file Blob.cpp.

References _FILEINFO_, Isis::iException::Message(), Isis::Blob::p_blobName, Isis::Blob::p_buffer, Isis::Blob::p_nbytes, and Isis::Blob::p_type.

Referenced by Isis::Blob::Write().

void Isis::OriginalLabel::WriteInit (  )  [protected, virtual]

Prepare labels for writing to the output cube.

Reimplemented from Isis::Blob.

Definition at line 68 of file OriginalLabel.cpp.

References m_originalLabel, Isis::Blob::p_buffer, and Isis::Blob::p_nbytes.


Member Data Documentation

std::string Isis::Blob::p_blobName [protected, inherited]

Name of the Blob object.

Definition at line 72 of file Blob.h.

Referenced by Isis::Blob::Blob(), Isis::Blob::Find(), Isis::Blob::Name(), Isis::Blob::operator=(), Isis::Blob::Read(), Isis::Table::ReadData(), Isis::ImagePolygon::ReadData(), Isis::Blob::ReadData(), Isis::Blob::Write(), and Isis::Blob::WriteData().

Isis::PvlObject Isis::Blob::p_blobPvl [protected, inherited]

Pvl Blob object.

Definition at line 71 of file Blob.h.

Referenced by Isis::Blob::Blob(), Isis::Blob::Find(), Isis::Blob::Label(), Isis::Blob::operator=(), Isis::Table::ReadInit(), Isis::Table::Table(), Isis::Blob::Write(), and Isis::Table::WriteInit().

char* Isis::Blob::p_buffer [protected, inherited]

Buffer blob data is stored in.

Definition at line 74 of file Blob.h.

Referenced by Isis::Blob::Blob(), Isis::Blob::operator=(), Isis::Blob::ReadData(), Isis::History::ReturnHist(), ReturnLabels(), Isis::Blob::WriteData(), WriteInit(), Isis::History::WriteInit(), and Isis::Blob::~Blob().

std::string Isis::Blob::p_detached [protected, inherited]

Used for reading detached blobs.

Definition at line 78 of file Blob.h.

Referenced by Isis::Blob::Blob(), Isis::Blob::Find(), Isis::Blob::operator=(), and Isis::Blob::Read().

std::string Isis::Blob::p_labelFile [protected, inherited]

The file containing the labels.

Definition at line 79 of file Blob.h.

Referenced by Isis::Blob::Blob(), Isis::Blob::Find(), and Isis::Blob::operator=().

int Isis::Blob::p_nbytes [protected, inherited]

Size of blob data (in bytes).

Definition at line 76 of file Blob.h.

Referenced by Isis::Blob::Blob(), Isis::Blob::Find(), Isis::Blob::operator=(), Isis::ImagePolygon::ReadData(), Isis::Blob::ReadData(), Isis::History::ReturnHist(), ReturnLabels(), Isis::Blob::Write(), Isis::ImagePolygon::WriteData(), Isis::Blob::WriteData(), Isis::Table::WriteInit(), WriteInit(), Isis::ImagePolygon::WriteInit(), and Isis::History::WriteInit().

BigInt Isis::Blob::p_startByte [protected, inherited]

Byte blob data starts at in buffer.

Definition at line 75 of file Blob.h.

Referenced by Isis::Blob::Blob(), Isis::Blob::Find(), Isis::Blob::operator=(), Isis::Table::ReadData(), Isis::ImagePolygon::ReadData(), Isis::Blob::ReadData(), and Isis::Blob::Write().

std::string Isis::Blob::p_type [protected, inherited]

Type of data stored in the buffer.

Definition at line 77 of file Blob.h.

Referenced by Isis::Blob::Blob(), Isis::Blob::Find(), Isis::Blob::operator=(), Isis::Blob::Read(), Isis::ImagePolygon::ReadData(), Isis::Blob::ReadData(), Isis::Blob::Type(), Isis::Blob::Write(), and Isis::Blob::WriteData().


The documentation for this class was generated from the following files: