USGS

Isis 3.0 Object Programmers' Reference

Home

Isis::CubeAttributeInput Class Reference
[Parsing]

#include <CubeAttribute.h>

Inheritance diagram for Isis::CubeAttributeInput:

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

Collaboration graph
[legend]
List of all members.

Detailed Description

Manipulate and parse attributes of input cube filenames.

This class provides parsing and manipulation of attributes associated with input cube filenames. Input cube filenames can have an attribute of "band(s) specification"

See also:
IsisAml IsisGui

For internal use only.

History:
2003-07-29 Stuart Sides Separated the input and output attributes into two seprated class deriving off a base class, instead of one class for all cases.
History:
2004-02-03 Stuart Sides Refactor for IsisProcess and cube changes
History:
2006-01-05 Stuart Sides Fixed bug when the input attribute was "+7-10". In this case the Write members were not putting the "+" at the beginning.

Definition at line 250 of file CubeAttribute.h.

Public Member Functions

 CubeAttributeInput ()
 Constructs an empty CubeAttributeInput.
 CubeAttributeInput (const Isis::iString &att)
 Constructs a CubeAttributeInput and initialized it with the contents of the string parameter.
 ~CubeAttributeInput ()
 Destroys the object.
void Set (const std::string &att)
 Set the input attributes according to the argument.
void Reset ()
 Set the input attributes to the default state (i.e., empty).
std::vector< std::string > Bands () const
 Return an STL vector of the input bands specified.
std::string BandsStr () const
 Return a string representation of all the bands.
void Bands (const std::vector< std::string > &bands)
 Set the band attribute according to the list of bands.
void Bands (const std::string &bands)
 Set the band attribute according the string parameter.
void Write (std::ostream &ostr) const
 Write the attributes to a stream.
void Write (std::string &str) const
 Write the attributes to a string.
void Write (Isis::Pvl &pvl) const
 Write the attributes to a Pvl.

Protected Attributes

Isis::iString p_attribute
 Contains the unparsed attributes with the filename stripped.

Private Member Functions

void Parse (const std::string &att)
 Parse the string parameter and populate the private variable accordinly.

Private Attributes

std::vector< std::string > p_bands
 A list of the specified bands.


Constructor & Destructor Documentation

Isis::CubeAttributeInput::CubeAttributeInput (  ) 

Constructs an empty CubeAttributeInput.

Definition at line 84 of file CubeAttribute.cpp.

References p_bands.

Isis::CubeAttributeInput::CubeAttributeInput ( const Isis::iString att  ) 

Constructs a CubeAttributeInput and initialized it with the contents of the string parameter.

The string is parased to obtain any band specifiers. Any attribute information that is not valie for an input cube will throw an error.

Parameters:
att The attribute string to be parsed.

Definition at line 89 of file CubeAttribute.cpp.

References Isis::CubeAttribute::p_attribute, p_bands, and Parse().

Isis::CubeAttributeInput::~CubeAttributeInput (  ) 

Destroys the object.

Definition at line 96 of file CubeAttribute.cpp.


Member Function Documentation

void Isis::CubeAttributeInput::Bands ( const std::string &  bands  ) 

Set the band attribute according the string parameter.

Definition at line 128 of file CubeAttribute.cpp.

References p_bands, and Parse().

void Isis::CubeAttributeInput::Bands ( const std::vector< std::string > &  bands  ) 

Set the band attribute according to the list of bands.

Definition at line 120 of file CubeAttribute.cpp.

References p_bands.

vector< string > Isis::CubeAttributeInput::Bands (  )  const

Return an STL vector of the input bands specified.

Definition at line 115 of file CubeAttribute.cpp.

References p_bands.

Referenced by Isis::GuiInputAttribute::SetAttributes(), and Isis::Process::SetInputCube().

string Isis::CubeAttributeInput::BandsStr (  )  const

Return a string representation of all the bands.

For internal use only.

History:
Stuart Sides 2005-01-2005 ???
Combines all the specified bands numbers into a single string with commas between each band number

Returns:
A comma delimited string of all bands from the input attribute

Definition at line 104 of file CubeAttribute.cpp.

References p_bands, and str.

Referenced by Isis::GuiInputAttribute::SetAttributes(), and Isis::Pipeline::SetInputFile().

void Isis::CubeAttributeInput::Parse ( const std::string &  att  )  [private]

Parse the string parameter and populate the private variable accordinly.

Parameters:
att A string containing the file attributes. All characters before the first "+" are assumed to be the filename and are ignored.

Definition at line 168 of file CubeAttribute.cpp.

References band, direction, p_bands, pos, str, Isis::iString::ToInteger(), and Isis::iString::Token().

Referenced by Bands(), CubeAttributeInput(), and Set().

void Isis::CubeAttributeInput::Reset (  ) 

Set the input attributes to the default state (i.e., empty).

Definition at line 163 of file CubeAttribute.cpp.

References p_bands.

Referenced by IsisAml::Clear(), and IsisAml::GetInputAttribute().

void Isis::CubeAttributeInput::Set ( const std::string &  att  ) 

Set the input attributes according to the argument.

Note: the attributes are not initialized prior to parsing the argument. This means that multipal invocations will be cumulative.

Parameters:
att A string containing the file attributes. All characters before the first "+" are assumed to be the filename and are ignored.

Definition at line 99 of file CubeAttribute.cpp.

References Parse().

Referenced by IsisAml::GetInputAttribute().

void Isis::CubeAttributeInput::Write ( Isis::Pvl pvl  )  const [virtual]

Write the attributes to a Pvl.

Reimplemented from Isis::CubeAttribute.

Definition at line 152 of file CubeAttribute.cpp.

References b, bands, p_bands, and pvl().

void Isis::CubeAttributeInput::Write ( std::string &  str  )  const [virtual]

Write the attributes to a string.

Reimplemented from Isis::CubeAttribute.

Definition at line 141 of file CubeAttribute.cpp.

References p_bands.

void Isis::CubeAttributeInput::Write ( std::ostream &  ostr  )  const [virtual]

Write the attributes to a stream.

Reimplemented from Isis::CubeAttribute.

Definition at line 134 of file CubeAttribute.cpp.

References st.


Member Data Documentation

Isis::iString Isis::CubeAttribute::p_attribute [protected, inherited]

Contains the unparsed attributes with the filename stripped.

Definition at line 220 of file CubeAttribute.h.

Referenced by Isis::CubeAttribute::CubeAttribute(), CubeAttributeInput(), Isis::CubeAttributeOutput::CubeAttributeOutput(), and Isis::CubeAttribute::Write().

std::vector<std::string> Isis::CubeAttributeInput::p_bands [private]

A list of the specified bands.

Definition at line 322 of file CubeAttribute.h.

Referenced by Bands(), BandsStr(), CubeAttributeInput(), Parse(), Reset(), and Write().


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