|
Isis 3.0 Object Programmers' Reference |
Home |
#include <PvlToken.h>
Collaboration diagram for Isis::PvlToken:

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.
For internal use only.
Definition at line 51 of file PvlToken.h.
Public Member Functions | |
| PvlToken (const std::string &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 std::string &k) |
| Set the token keyword. | |
| std::string | GetKey () const |
| Returns the token keyword. | |
| std::string | GetKeyUpper () const |
| Returns the token keyword in all uppercase characters. | |
| void | AddValue (const std::string &v) |
| Adds a value to the value-vector. | |
| std::string | GetValue (const int index=0) const |
| Returns one element of the value-vector. | |
| std::string | GetValueUpper (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< std::string > & | ValueVector () const |
Private Attributes | |
| std::string | key |
| Storage for the keyword name. | |
| std::vector< std::string > | value |
| Vector storage for a list of values. | |
| Isis::PvlToken::PvlToken | ( | const std::string & | k | ) |
Constructs a Token with k for keyword and NULL for the value list.
| k | Value of the keyword |
Definition at line 33 of file PvlToken.cpp.
References SetKey(), and ValueClear().
| Isis::PvlToken::PvlToken | ( | ) |
Constructs a Token with NULL for both the keyword and value list.
Definition at line 39 of file PvlToken.cpp.
References key, and ValueClear().
| Isis::PvlToken::~PvlToken | ( | ) |
Destroys the Token object.
Definition at line 45 of file PvlToken.cpp.
References key, and ValueClear().
| void Isis::PvlToken::AddValue | ( | const std::string & | 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 101 of file PvlToken.cpp.
References value.
Referenced by Isis::PvlTokenizer::Load(), and Isis::PvlTokenizer::ParseCommaList().
| string Isis::PvlToken::GetKey | ( | ) | const |
Returns the token keyword.
Definition at line 64 of file PvlToken.cpp.
References key.
Referenced by Isis::PvlTokenizer::Load().
| string Isis::PvlToken::GetKeyUpper | ( | ) | const |
Returns the token keyword in all uppercase characters.
Definition at line 73 of file PvlToken.cpp.
References key.
Referenced by Isis::PvlTokenizer::Load().
| string Isis::PvlToken::GetValue | ( | 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 114 of file PvlToken.cpp.
References _FILEINFO_, Isis::Message::ArraySubscriptNotInRange(), Isis::iException::Message(), and value.
| string Isis::PvlToken::GetValueUpper | ( | 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 131 of file PvlToken.cpp.
References _FILEINFO_, Isis::Message::ArraySubscriptNotInRange(), Isis::iException::Message(), and value.
| void Isis::PvlToken::SetKey | ( | const std::string & | k | ) |
Set the token keyword.
| k | iString to load into the token keyword |
Definition at line 55 of file PvlToken.cpp.
References key.
Referenced by PvlToken().
| void Isis::PvlToken::ValueClear | ( | ) |
Removes all elements from the value-vector.
Definition at line 82 of file PvlToken.cpp.
References value.
Referenced by PvlToken(), and ~PvlToken().
| int Isis::PvlToken::ValueSize | ( | ) | const |
Returns the number of elements in the value-vector.
Definition at line 91 of file PvlToken.cpp.
References value.
std::string Isis::PvlToken::key [private] |
Storage for the keyword name.
Definition at line 53 of file PvlToken.h.
Referenced by GetKey(), GetKeyUpper(), PvlToken(), SetKey(), and ~PvlToken().
std::vector<std::string> Isis::PvlToken::value [private] |
Vector storage for a list of values.
See the standard template library for more information on vectors.
Definition at line 54 of file PvlToken.h.
Referenced by AddValue(), GetValue(), GetValueUpper(), ValueClear(), ValueSize(), and ValueVector().