File failed to load: https://isis.astrogeology.usgs.gov/3.9.0/Object/assets/jax/output/NativeMML/config.js
Isis 3 Developer Reference
Isis::OriginalXmlLabel Class Reference

Read and store original Xml labels. More...

#include <OriginalXmlLabel.h>

Inheritance diagram for Isis::OriginalXmlLabel:
Inheritance graph
Collaboration diagram for Isis::OriginalXmlLabel:
Collaboration graph

Public Member Functions

 OriginalXmlLabel ()
 Constructors a default OriginalXmlLabel with an empty label. More...
 
 OriginalXmlLabel (const QString &file)
 Constructs an OriginalXmlLabel from a cube label file. More...
 
 ~OriginalXmlLabel ()
 Destructor. More...
 
void readFromXmlFile (const FileName &xmlFileName)
 Read the original label from an Xml file. More...
 
const QDomDocument & ReturnLabels () const
 Returns the original Xml label. More...
 
QString Type () const
 Accessor method that returns a string containing the Blob type. More...
 
QString Name () const
 Accessor method that returns a string containing the Blob name. More...
 
int Size () const
 Accessor method that returns the number of bytes in the blob data. More...
 
PvlObjectLabel ()
 Accessor method that returns a PvlObject containing the Blob label. More...
 
void Read (const QString &file)
 This method reads Pvl values from a specified file. More...
 
void Read (const QString &file, const Pvl &pvlLabels)
 This method reads the given a file and labels. More...
 
virtual void Read (const Pvl &pvl, std::istream &is)
 This method reads the Blob data from an open input file stream. More...
 
void Write (const QString &file)
 Write the blob data out to a file. More...
 
void Write (Pvl &pvl, std::fstream &stm, const QString &detachedFileName="")
 Write the blob data out to a Pvl object. More...
 

Protected Member Functions

void ReadData (std::istream &stream)
 Read the xml file data from an input stream. More...
 
void WriteData (std::fstream &os)
 Write the label out to a stream. More...
 
void WriteInit ()
 Prepare to write the label out. More...
 
void Find (const Pvl &pvl)
 This method searches the given Pvl for the Blob by the Blob's type and name. More...
 
virtual void ReadInit ()
 This virtual method for classes that inherit Blob. More...
 

Protected Attributes

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

Detailed Description

Read and store original Xml labels.

This class provides a means to read and store the Xml labels from the original source.

Author
2017-01-30 Jesse Mapel

Constructor & Destructor Documentation

◆ OriginalXmlLabel() [1/2]

Isis::OriginalXmlLabel::OriginalXmlLabel ( )

Constructors a default OriginalXmlLabel with an empty label.

References Isis::Blob::p_blobPvl.

◆ OriginalXmlLabel() [2/2]

Isis::OriginalXmlLabel::OriginalXmlLabel ( const QString &  file)

Constructs an OriginalXmlLabel from a cube label file.

Parameters
fileXml file to read labels from

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

◆ ~OriginalXmlLabel()

Isis::OriginalXmlLabel::~OriginalXmlLabel ( )

Destructor.

Member Function Documentation

◆ Find()

void Isis::Blob::Find ( const Pvl pvl)
protectedinherited

This method searches the given Pvl for the Blob by the Blob's type and name.

If found, the start byte, number of bytes are read from the Pvl. Also, if a keyword label pointer is found, the filename for the detached blob is stored and the pointer is removed from the blob pvl.

Parameters
pvlThe Pvl to be searched

References _FILEINFO_, Isis::PvlContainer::isNamed(), Isis::PvlObject::object(), Isis::PvlObject::objects(), and Isis::FileName::path().

◆ Label()

PvlObject & Isis::Blob::Label ( )
inherited

Accessor method that returns a PvlObject containing the Blob label.

Returns
PvlObject The label of the blob.

Referenced by Isis::SpiceRotation::CacheLabel(), Isis::SpicePosition::LoadCache(), and Isis::SpiceRotation::LoadCache().

◆ Name()

QString Isis::Blob::Name ( ) const
inherited

Accessor method that returns a string containing the Blob name.

Returns
string The name of the blob.

Referenced by Isis::Shape::isFootprintable(), Isis::Image::isFootprintable(), Isis::SpicePosition::LoadCache(), and Isis::Cube::write().

◆ Read() [1/3]

void Isis::Blob::Read ( const QString &  file)
inherited

This method reads Pvl values from a specified file.

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

References _FILEINFO_, and Isis::Pvl::read().

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

◆ Read() [2/3]

void Isis::Blob::Read ( const QString &  file,
const Pvl pvlLabels 
)
inherited

This method reads the given a file and labels.

Parameters
fileThe filename to read from.
pvlLabelsA Pvl containing the label information.
Exceptions
iException::Io- Unable to open file

References _FILEINFO_, and Isis::Message::FileOpen().

◆ Read() [3/3]

void Isis::Blob::Read ( const Pvl pvl,
std::istream &  istm 
)
virtualinherited

This method reads the Blob data from an open input file stream.

Parameters
pvlA Pvl containing the label information.
istmThe input file stream containing the blob data to be read.
Exceptions
iException::Io- Unable to open file

Reimplemented in Isis::History.

References _FILEINFO_, and Isis::Message::FileOpen().

◆ ReadData()

void Isis::OriginalXmlLabel::ReadData ( std::istream &  stream)
protectedvirtual

Read the xml file data from an input stream.

Parameters
streamThe input stream to read from.
Exceptions
IException::Unknown"XML read/parse error when parsing original label."
See also
Blob::Read(const Pvl &pvl, std::istream &is)

Reimplemented from Isis::Blob.

References _FILEINFO_, Isis::Blob::p_buffer, Isis::Blob::p_nbytes, Isis::Blob::ReadData(), Isis::toString(), and Isis::IException::Unknown.

◆ readFromXmlFile()

void Isis::OriginalXmlLabel::readFromXmlFile ( const FileName xmlFileName)

Read the original label from an Xml file.

Parameters
FileNameThe Xml file containing the original label.
Exceptions
IException::Io"Could not open label file."
IException::Unknown"XML read/parse error in file."

References _FILEINFO_, Isis::FileName::expanded(), Isis::IException::Io, Isis::toString(), and Isis::IException::Unknown.

◆ ReadInit()

void Isis::Blob::ReadInit ( )
protectedvirtualinherited

This virtual method for classes that inherit Blob.

It is not defined in the Blob class.

Reimplemented in Isis::Table.

◆ ReturnLabels()

const QDomDocument & Isis::OriginalXmlLabel::ReturnLabels ( ) const

Returns the original Xml label.

Returns
QDomDocument The parsed original label

◆ Size()

int Isis::Blob::Size ( ) const
inherited

Accessor method that returns the number of bytes in the blob data.

Returns
int Number of bytes in the blob data.

◆ Type()

QString Isis::Blob::Type ( ) const
inherited

Accessor method that returns a string containing the Blob type.

Returns
string Type of blob.

Referenced by Isis::Shape::isFootprintable(), Isis::Image::isFootprintable(), and Isis::Cube::write().

◆ Write() [1/2]

void Isis::Blob::Write ( const QString &  file)
inherited

Write the blob data out to a file.

Parameters
fileThe filename to write to.
Exceptions
IException::Io- Unable to open file
IException::Io- Error preparing to write data to file
IException::Io- Error creating file

References _FILEINFO_, Isis::PvlObject::addObject(), Isis::PvlObject::findObject(), Isis::toString(), and Isis::Pvl::write().

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

◆ Write() [2/2]

void Isis::Blob::Write ( Pvl pvl,
std::fstream &  stm,
const QString &  detachedFileName = "" 
)
inherited

Write the blob data out to a Pvl object.

Parameters
pvlThe pvl object to update
stmstream to write data to
detachedFileNameIf the stream is detached from the labels give the name of the file

References Isis::PvlObject::addObject(), Isis::PvlContainer::name(), Isis::PvlObject::object(), Isis::PvlObject::objects(), and Isis::toString().

◆ WriteData()

void Isis::OriginalXmlLabel::WriteData ( std::fstream &  os)
protectedvirtual

Write the label out to a stream.

Parameters
osThe stream to write the label out to.
See also
Blob::Write

Reimplemented from Isis::Blob.

◆ WriteInit()

void Isis::OriginalXmlLabel::WriteInit ( )
protectedvirtual

Prepare to write the label out.

See also
Blob::Write

Reimplemented from Isis::Blob.

References Isis::ByteOrderName(), Isis::IsLsb(), Isis::Lsb, Isis::Msb, Isis::Blob::p_blobPvl, and Isis::Blob::p_nbytes.

Member Data Documentation

◆ p_blobName

QString Isis::Blob::p_blobName
protectedinherited

◆ p_blobPvl

◆ p_buffer

◆ p_detached

QString Isis::Blob::p_detached
protectedinherited

Used for reading detached blobs.

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

◆ p_labelFile

QString Isis::Blob::p_labelFile
protectedinherited

The file containing the labels.

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

◆ p_nbytes

◆ p_startByte

BigInt Isis::Blob::p_startByte
protectedinherited

Byte blob data starts at in buffer.

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

◆ p_type

QString Isis::Blob::p_type
protectedinherited

Type of data stored in the buffer.

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


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

U.S. Department of the Interior | U.S. Geological Survey
ISIS | Privacy & Disclaimers | Astrogeology Research Program
To contact us, please post comments and questions on the USGS Astrogeology Discussion Board
To report a bug, or suggest a feature go to: ISIS Github
File Modified: 07/13/2023 00:02:43