USGS

Isis 3.0 Application Source Code Reference

Home

MdisEdrKeys Class Reference

#include <MdisEdrKeys.h>

List of all members.


Detailed Description

MDIS EDR keyword container class.

This class ingests a PDS EDR label and stages all keywords found in a table. Keywords can be added through the Pvl class or updated explicitly by adding a PvlKeyword.

Any add or update operation will replace existing completely so no more than on keyword will exist in the table at a time.

Keyword names are not case sensitive. Also, any Object or Group hierarchy is not honored in this class. Meaning that if a keyword of the same name exists in more than one Object or Group, only the last occurring one is retained.

Author:
2007-08-14 Kris Becker
History:
2008-09-22 Kris Becker - corrected formatting of units that were missing in some cases where the first value units is not defined.

Definition at line 60 of file MdisEdrKeys.h.

Public Member Functions

 MdisEdrKeys ()
 Benign constuctor.
 MdisEdrKeys (Pvl &edrlab)
 Constuctor adds a Pvl label to the table.
 MdisEdrKeys (const std::string &edrfile)
 Add a Pvl file (label) to the table.
 MdisEdrKeys (Cube &cube)
 Construct from an Isis Cube file.
virtual ~MdisEdrKeys ()
 Destroys the object.
int size () const
 Returns the number of keywords in the container.
void add (const PvlKeyword &key, const std::string &name="")
 Adds a keyword to the container directly.
const PvlKeyword & operator[] (const int index) const throw (iException &)
 Returns the nth keyword in the container.
PvlKeyword & get (const std::string &name) throw (iException &)
 Return the specified keyword by name.
const PvlKeyword & get (const std::string &name) const throw (iException &)
 Returns the specified keyword by name.
void updateKeys (Pvl &keys)
 Replaces or adds keywords in a Pvl class.
std::string extract (const std::vector< std::string > &keylist, const std::string &NAstr, PvlGroup *group=0)
 Return a formatted list of keyword values.


Constructor & Destructor Documentation

MdisEdrKeys (  )  [inline]

Benign constuctor.

Definition at line 63 of file MdisEdrKeys.h.

MdisEdrKeys ( Pvl &  edrlab  )  [inline]

Constuctor adds a Pvl label to the table.

Definition at line 65 of file MdisEdrKeys.h.

MdisEdrKeys ( const std::string &  edrfile  )  [inline]

Add a Pvl file (label) to the table.

This constuctor will ingest a Pvl labelled file to the table. It can be any Pvl file that is supported by the Pvl class, including most all PDS formatted labels. This particular interface assumes a MDIS PDS EDR label as its parameter.

Parameters:
edrfile File containing the PDS EDR label

Definition at line 79 of file MdisEdrKeys.h.

MdisEdrKeys ( Cube cube  )  [inline]

Construct from an Isis Cube file.

This constructor will ingest an ISIS cube file label. Note that there is no regard for the Object/Group structure so all keywords are included and keywords that repeat in other Objects or Groups replace any existing definition.

Parameters:
cube A valid ISIS Cube object with a label

Definition at line 94 of file MdisEdrKeys.h.

virtual ~MdisEdrKeys (  )  [inline, virtual]

Destroys the object.

Definition at line 100 of file MdisEdrKeys.h.


Member Function Documentation

int size (  )  const [inline]

Returns the number of keywords in the container.

Returns:
int Number of keys in container

Definition at line 107 of file MdisEdrKeys.h.

void add ( const PvlKeyword &  key,
const std::string &  name = "" 
) [inline]

Adds a keyword to the container directly.

This method is provided for adding keywords directly to the contained that may not be contained within a Pvl object.

Parameters:
key PvlKeyword to add to the container
name Optional name other than what the keyword is named

Definition at line 118 of file MdisEdrKeys.h.

const PvlKeyword& operator[] ( const int  index  )  const throw (iException &) [inline]

Returns the nth keyword in the container.

This method allows one to retrieve the nth keyword in the container as a means to iterate through the complete contents for direct interogation/use.

If the keyword at specified index does not exist, an exception is thrown.

Parameters:
index Index of the keyword ranging from 0 to size()-1
Returns:
const PvlKeyword& Returns a reference to the keyword at index

Definition at line 142 of file MdisEdrKeys.h.

PvlKeyword& get ( const std::string &  name  )  throw (iException &) [inline]

Return the specified keyword by name.

Retrieves a keyword by name without regard for case. An exception is thrown if it does not exist.

Parameters:
name Name of keyword to retrieve
Returns:
PvlKeyword& Reference to named keyword

Definition at line 156 of file MdisEdrKeys.h.

const PvlKeyword& get ( const std::string &  name  )  const throw (iException &) [inline]

Returns the specified keyword by name.

Retrieves a keyword by name without regard for case. An exception is thrown if it does not exist.

Parameters:
name Name of keyword to retrieve
Returns:
const PvlKeyword& Returns a const reference to the named keyword

Definition at line 171 of file MdisEdrKeys.h.

void updateKeys ( Pvl &  keys  )  [inline]

Replaces or adds keywords in a Pvl class.

This method will add all the keywords found in the Pvl keys object to the container. Any keywords that already exist in the container are replaced with the new one.

Parameters:
keys Pvl class containing the keywords to add

Definition at line 184 of file MdisEdrKeys.h.

std::string extract ( const std::vector< std::string > &  keylist,
const std::string &  NAstr,
PvlGroup *  group = 0 
) [inline]

Return a formatted list of keyword values.

This method takes in a list of named keywords and formats them according to PDS standards in a comma delineated string. This is the defined format of the team for its population of PDS EDR label keywords.

If any one of the keywords is not found, an exception is thrown.

Parameters:
keylist List of keywords to extract
NAstr String used to specify no value (used mainly so a unit qualifer is not added to the value)
Returns:
std::string Returns a comma delineated string of keyword values

Definition at line 203 of file MdisEdrKeys.h.


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