Isis 3 Programmer 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. 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 |
Private Attributes | |
QString | m_key |
Storage for the keyword name. More... | |
std::vector< QString > | m_value |
Vector storage for a list of values. More... | |
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.
2003-05-16 Stuart Sides - Modified schema from astrogeology... isis.astrogeology...
2005-02-14 Elizabeth Ribelin - Modified file to support Doxygen
2013-03-11 Steven Lambright and Mathew Eis - Brought method names and member variable names up to the current Isis 3 coding standards. Fixes #1533. documentation
Definition at line 54 of file PvlToken.h.
Isis::PvlToken::PvlToken | ( | const QString & | k | ) |
Constructs a Token with k for keyword and NULL for the value list.
k | Value of the keyword |
Definition at line 34 of file PvlToken.cpp.
Isis::PvlToken::PvlToken | ( | ) |
Constructs a Token with NULL for both the keyword and value list.
Definition at line 40 of file PvlToken.cpp.
Isis::PvlToken::~PvlToken | ( | ) |
Destroys the Token object.
Definition at line 45 of file PvlToken.cpp.
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 |
Definition at line 97 of file PvlToken.cpp.
Referenced by Isis::PvlTokenizer::Load(), and Isis::PvlTokenizer::ParseCommaList().
QString Isis::PvlToken::key | ( | ) | const |
Returns the token keyword.
Definition at line 64 of file PvlToken.cpp.
Referenced by Isis::PvlTokenizer::Load().
QString Isis::PvlToken::keyUpper | ( | ) | const |
Returns the token keyword in all uppercase characters.
Definition at line 73 of file PvlToken.cpp.
Referenced by Isis::PvlTokenizer::Load().
void Isis::PvlToken::setKey | ( | const QString & | k | ) |
Set the token keyword.
k | IString to load into the token keyword |
Definition at line 55 of file PvlToken.cpp.
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 |
Definition at line 110 of file PvlToken.cpp.
References _FILEINFO_, and Isis::Message::ArraySubscriptNotInRange().
void Isis::PvlToken::valueClear | ( | ) |
Removes all elements from the value-vector.
Definition at line 78 of file PvlToken.cpp.
int Isis::PvlToken::valueSize | ( | ) | const |
Returns the number of elements in the value-vector.
Definition at line 87 of file PvlToken.cpp.
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 |
Definition at line 127 of file PvlToken.cpp.
References _FILEINFO_, and Isis::Message::ArraySubscriptNotInRange().
|
private |
Storage for the keyword name.
Definition at line 56 of file PvlToken.h.
|
private |
Vector storage for a list of values.
See the standard template library for more information on vectors.
Definition at line 57 of file PvlToken.h.