Isis Developer Reference
Isis::PvlToken Class Reference

Container for Keyword-value pair. More...

#include <PvlToken.h>

Collaboration diagram for Isis::PvlToken:
Collaboration graph

Public Member Functions

 PvlToken (const QString &k)
 Constructs a Token with k for keyword and NULL for the value list. More...
 
 PvlToken ()
 Constructs a Token with NULL for both the keyword and value list. More...
 
 ~PvlToken ()
 Destroys the Token object. More...
 
void setKey (const QString &k)
 Set the token keyword. More...
 
QString key () const
 Returns the token keyword. More...
 
QString keyUpper () const
 Returns the token keyword in all uppercase characters. More...
 
void addValue (const QString &v)
 Adds a value to the value-vector. More...
 
QString value (const int index=0) const
 Returns one element of the value-vector. More...
 
QString valueUpper (const int index=0) const
 Returns one element of the value-vector in uppercase. More...
 
int valueSize () const
 Returns the number of elements in the value-vector. More...
 
void valueClear ()
 Removes all elements from the value-vector. More...
 
const std::vector< QString > & valueVector () const
 

Detailed Description

Container for Keyword-value pair.

This class is used for internalizing keyword-value(s) pairs. For example, SPACECRAFT=MARS_GLOBAL_SURVEYOR or FROM=file.cub. This is useful when parsing ASCII files such as PDS labels or command lines.

Author
2002-03-18 Jeff Anderson

Constructor & Destructor Documentation

◆ PvlToken() [1/2]

Isis::PvlToken::PvlToken ( const QString &  k)

Constructs a Token with k for keyword and NULL for the value list.

Parameters
kValue of the keyword

◆ PvlToken() [2/2]

Isis::PvlToken::PvlToken ( )

Constructs a Token with NULL for both the keyword and value list.

◆ ~PvlToken()

Isis::PvlToken::~PvlToken ( )

Destroys the Token object.

Member Function Documentation

◆ addValue()

void Isis::PvlToken::addValue ( const QString &  v)

Adds a value to the value-vector.

Successive calls add values to the end of the vector.

Parameters
vIString add to the value-vector list

Referenced by Isis::PvlTokenizer::Load(), and Isis::PvlTokenizer::ParseCommaList().

◆ key()

QString Isis::PvlToken::key ( ) const

Returns the token keyword.

Returns
QString

Referenced by Isis::PvlTokenizer::Load().

◆ keyUpper()

QString Isis::PvlToken::keyUpper ( ) const

Returns the token keyword in all uppercase characters.

Returns
QString

Referenced by Isis::PvlTokenizer::Load().

◆ setKey()

void Isis::PvlToken::setKey ( const QString &  k)

Set the token keyword.

Parameters
kIString to load into the token keyword

◆ value()

QString Isis::PvlToken::value ( const int  index = 0) const

Returns one element of the value-vector.

Parameters
indexZero-based index of vector element to return. Defaults to 0
Returns
QString
Exceptions
Isis::IException::Programmer

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

◆ valueClear()

void Isis::PvlToken::valueClear ( )

Removes all elements from the value-vector.

◆ valueSize()

int Isis::PvlToken::valueSize ( ) const

Returns the number of elements in the value-vector.

Returns
int

◆ valueUpper()

QString Isis::PvlToken::valueUpper ( const int  index = 0) const

Returns one element of the value-vector in uppercase.

Parameters
indexZero-based index of vector element to return. Defaults to 0
Returns
QString
Exceptions
Isis::IException::Programmer

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

◆ valueVector()

const std::vector<QString>& Isis::PvlToken::valueVector ( ) const
inline

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