Isis 3.0
| Home |
Internalizes a translation table. More...
#include <PvlTranslationTable.h>
Inherited by Isis::PvlTranslationManager.
Public Member Functions | |
PvlTranslationTable (Isis::FileName transFile) | |
Constructs and initializes a PvlTranslationTable object. More... | |
PvlTranslationTable (std::istream &istr) | |
Constructs and initializes a PvlTranslationTable object. More... | |
PvlTranslationTable () | |
Construct an empty PvlTranslationTable. More... | |
~PvlTranslationTable () | |
Destroys the PvlTranslationTable object. More... | |
PvlKeyword | InputGroup (const QString nName, const int inst=0) const |
Returns the input group name from the translation table corresponding to the output name argument. More... | |
QString | InputKeywordName (const QString nName) const |
Returns the input keyword name from the translation table corresponding to the output name argument. More... | |
QString | InputDefault (const QString nName) const |
Returns the input default value from the translation table corresponding to the output name argument. More... | |
QString | Translate (const QString nName, const QString fValue="") const |
Translates the output name and input value. More... | |
void | AddTable (std::istream &transStm) |
Adds the contents of a translation table to the searchable groups/keys Also performs a verification, to ensure that the translation table is valid. More... | |
void | AddTable (const QString &transFile) |
Adds the contents of a translation table to the searchable groups/keys. More... | |
Protected Member Functions | |
Pvl & | TranslationTable () |
const Pvl & | TranslationTable () const |
bool | IsAuto (const QString nName) |
bool | IsOptional (const QString nName) |
PvlKeyword & | OutputPosition (const QString nName) |
QString | OutputName (const QString nName) |
Internalizes a translation table.
This class internalizes an Isis translation table and provides group/key searches and value translations. The group names listed are the output names used by applications to get the input names and values. There is only one level of groups and groups are not allowed to be nested. The Group names can NOT be repeated. OutputGroup is a comma delimited list of objects and/or groups in the input label. Traversing this list within the input label will lead to the correct level to find the input keyword. OutputKey is the keyword within the group which holds the information. OutputDefault is the value used if there is no value for the keyword. Translation is the output and corresponding input values. Translation may be repeated as needed. An example piece of a tranlation file:
Isis::PvlTranslationTable::PvlTranslationTable | ( | Isis::FileName | transFile | ) |
Constructs and initializes a PvlTranslationTable object.
transFile | The translation file to be used |
iException::Io |
References Isis::FileName::expanded().
Isis::PvlTranslationTable::PvlTranslationTable | ( | std::istream & | istr | ) |
Constructs and initializes a PvlTranslationTable object.
istr | The translation stream to be used to translate values |
Isis::PvlTranslationTable::PvlTranslationTable | ( | ) |
Construct an empty PvlTranslationTable.
|
inline |
Destroys the PvlTranslationTable object.
void Isis::PvlTranslationTable::AddTable | ( | std::istream & | transStm | ) |
Adds the contents of a translation table to the searchable groups/keys Also performs a verification, to ensure that the translation table is valid.
transStm | The stream to be added. |
References _FILEINFO_, Isis::PvlContainer::hasKeyword(), Isis::PvlContainer::keywords(), Isis::PvlContainer::name(), Isis::PvlKeyword::name(), and Isis::PvlKeyword::size().
void Isis::PvlTranslationTable::AddTable | ( | const QString & | transFile | ) |
Adds the contents of a translation table to the searchable groups/keys.
transFile | The name of the translation file to be added. |
IException::Io |
QString Isis::PvlTranslationTable::InputDefault | ( | const QString | nName | ) | const |
Returns the input default value from the translation table corresponding to the output name argument.
nName | The output name to be used to search the translation table. |
iException::Programmer |
References _FILEINFO_, Isis::PvlContainer::fileName(), and Isis::PvlContainer::hasKeyword().
PvlKeyword Isis::PvlTranslationTable::InputGroup | ( | const QString | nName, |
const int | inst = 0 |
||
) | const |
Returns the input group name from the translation table corresponding to the output name argument.
nName | The output name to be used to search the translation table. |
inst | The occurence number of the "InputGroup" keyword (first one is zero) |
iException::Programmer |
References _FILEINFO_, Isis::PvlContainer::begin(), Isis::PvlContainer::end(), Isis::PvlContainer::findKeyword(), and Isis::PvlKeyword::size().
QString Isis::PvlTranslationTable::InputKeywordName | ( | const QString | nName | ) | const |
Returns the input keyword name from the translation table corresponding to the output name argument.
nName | The output name to be used to search the translation table. |
iException::Programmer |
References _FILEINFO_, and Isis::PvlContainer::hasKeyword().
|
protected |
References _FILEINFO_, Isis::PvlContainer::fileName(), and Isis::PvlContainer::hasKeyword().
|
protected |
References _FILEINFO_, Isis::PvlContainer::fileName(), and Isis::PvlContainer::hasKeyword().
|
protected |
References _FILEINFO_, Isis::PvlContainer::fileName(), and Isis::PvlContainer::hasKeyword().
|
protected |
References _FILEINFO_, Isis::PvlContainer::fileName(), and Isis::PvlContainer::hasKeyword().
QString Isis::PvlTranslationTable::Translate | ( | const QString | nName, |
const QString | fValue = "" |
||
) | const |
Translates the output name and input value.
nName | The output name to be used to search the translation table. |
fValue | The input value to be translated |
iException::Programmer |
References _FILEINFO_, Isis::PvlContainer::begin(), Isis::PvlContainer::end(), Isis::PvlContainer::fileName(), Isis::PvlContainer::findKeyword(), and Isis::PvlContainer::hasKeyword().
Referenced by Isis::PvlTranslationManager::Translate().
|
inlineprotected |
|
inlineprotected |