Isis Developer Reference
|
Container for Keyword-value pair. More...
#include <PvlToken.h>
Public Member Functions | |
PvlToken (const QString &k) | |
Constructs a Token with k for keyword and NULL for the value list. | |
PvlToken () | |
Constructs a Token with NULL for both the keyword and value list. | |
~PvlToken () | |
Destroys the Token object. | |
void | setKey (const QString &k) |
Set the token keyword. | |
QString | key () const |
Returns the token keyword. | |
QString | keyUpper () const |
Returns the token keyword in all uppercase characters. | |
void | addValue (const QString &v) |
Adds a value to the value-vector. | |
QString | value (const int index=0) const |
Returns one element of the value-vector. | |
QString | valueUpper (const int index=0) const |
Returns one element of the value-vector in uppercase. | |
int | valueSize () const |
Returns the number of elements in the value-vector. | |
void | valueClear () |
Removes all elements from the value-vector. | |
const std::vector< QString > & | valueVector () const |
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.
Isis::PvlToken::PvlToken | ( | const QString & | k | ) |
Constructs a Token with k for keyword and NULL for the value list.
k | Value of the keyword |
References setKey(), and valueClear().
Isis::PvlToken::PvlToken | ( | ) |
Constructs a Token with NULL for both the keyword and value list.
References valueClear().
Isis::PvlToken::~PvlToken | ( | ) |
Destroys the Token object.
References valueClear().
void Isis::PvlToken::addValue | ( | const QString & | v | ) |
Adds a value to the value-vector.
Successive calls add values to the end of the vector.
v | IString add to the value-vector list |
QString Isis::PvlToken::key | ( | ) | const |
Returns the token keyword.
QString Isis::PvlToken::keyUpper | ( | ) | const |
Returns the token keyword in all uppercase characters.
void Isis::PvlToken::setKey | ( | const QString & | k | ) |
QString Isis::PvlToken::value | ( | const int | index = 0 | ) | const |
Returns one element of the value-vector.
index | Zero-based index of vector element to return. Defaults to 0 |
Isis::IException::Programmer |
References _FILEINFO_, Isis::Message::ArraySubscriptNotInRange(), and Isis::IException::Programmer.
void Isis::PvlToken::valueClear | ( | ) |
Removes all elements from the value-vector.
Referenced by PvlToken(), PvlToken(), and ~PvlToken().
int Isis::PvlToken::valueSize | ( | ) | const |
Returns the number of elements in the value-vector.
QString Isis::PvlToken::valueUpper | ( | const int | index = 0 | ) | const |
Returns one element of the value-vector in uppercase.
index | Zero-based index of vector element to return. Defaults to 0 |
Isis::IException::Programmer |
References _FILEINFO_, Isis::Message::ArraySubscriptNotInRange(), and Isis::IException::Programmer.
|
inline |