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


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:
Group = DataStart
OutputKey = ^IMAGE
OutputDefault = 1
Translation = (*,*)
EndGroup
Group = DataFileRecordBytes
OutputKey = RECORD_BYTES
Translation = (*,*)
EndGroup
Group = CoreSamples
OutputGroup = IMAGE
OutputKey = LINE_SAMPLES
Translation = (*,*)
EndGroup
Group = CorePixelType
OutputGroup = IMAGE
OutputKey = SAMPLE_TYPE
OutputDefault = LSB_INTEGER
Translation = (Integer,LSB_INTEGER)
Translation = (Integer,MSB_INTEGER)
Translation = (Integer,PC_INTEGER)
Translation = (Integer,MAC_INTEGER)
Translation = (Integer,SUN_INTEGER)
Translation = (Integer,VAX_INTEGER)
Translation = (Natural,UNSIGNED_INTEGER)
Translation = (Natural,LSB_UNSIGNED_INTEGER)
Translation = (Natural,MSB_UNSIGNED_INTEGER)
EndGroup
Group = CoreOrganization
OutputGroup = IMAGE
OutputKey = BAND_STORAGE_TYPE
OutputDefault = BAND_SEQUENTIAL
Translation = (BSQ,BAND_SEQUENTIAL)
Translation = (BIL,LINE_INTERLEAVED)
Translation = (BIP,SAMPLE_INTERLEAVED)
EndGroup
End
For internal use only.
Definition at line 117 of file PvlTranslationTable.h.
Public Member Functions | |
| PvlTranslationTable (Isis::Filename transFile) | |
| Constructs and initializes a PvlTranslationTable object. | |
| PvlTranslationTable (std::istream &istr) | |
| Constructs and initializes a PvlTranslationTable object. | |
| PvlTranslationTable () | |
| Construct an empty PvlTranslationTable. | |
| ~PvlTranslationTable () | |
| Destroys the PvlTranslationTable object. | |
| std::string | InputGroup (const std::string nName, const int inst=0) const |
| Returns the input group name from the translation table corresponding to the output name argument. | |
| std::string | InputKeyword (const std::string nName) const |
| Returns the input keyword name from the translation table corresponding to the output name argument. | |
| std::string | InputDefault (const std::string nName) const |
| Returns the input default value from the translation table corresponding to the output name argument. | |
| std::string | Translate (const std::string nName, const std::string fValue="") const |
| Translates the output name and input value. | |
| 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. | |
| void | AddTable (const std::string &transFile) |
| Adds the contents of a translation table to the searchable groups/keys. | |
Protected Member Functions | |
| Pvl & | TranslationTable () |
| bool | IsAuto (const std::string nName) |
| bool | IsOptional (const std::string nName) |
| Isis::PvlKeyword & | OutputPosition (const std::string nName) |
| std::string | OutputName (const std::string nName) |
Private Attributes | |
| Pvl | p_trnsTbl |
| Isis::PvlTranslationTable::PvlTranslationTable | ( | Isis::Filename | transFile | ) |
Constructs and initializes a PvlTranslationTable object.
| transFile | The translation file to be used |
| Isis::iException::Io |
Definition at line 43 of file PvlTranslationTable.cpp.
References _FILEINFO_, Isis::Filename::Expanded(), Isis::Message::FileOpen(), in, Isis::iException::Message(), and p_trnsTbl.
| Isis::PvlTranslationTable::PvlTranslationTable | ( | std::istream & | istr | ) |
Constructs and initializes a PvlTranslationTable object.
| istr | The translation stream to be used to translate values |
Definition at line 62 of file PvlTranslationTable.cpp.
References p_trnsTbl.
| Isis::PvlTranslationTable::PvlTranslationTable | ( | ) |
| Isis::PvlTranslationTable::~PvlTranslationTable | ( | ) | [inline] |
| void Isis::PvlTranslationTable::AddTable | ( | const std::string & | transFile | ) |
Adds the contents of a translation table to the searchable groups/keys.
| transFile | The name of the translation file to be added. |
| Isis::iException::Io |
Definition at line 77 of file PvlTranslationTable.cpp.
References _FILEINFO_, AddTable(), Isis::Filename::Expanded(), Isis::Message::FileOpen(), in, and Isis::iException::Message().
| 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. |
Definition at line 100 of file PvlTranslationTable.cpp.
References p_trnsTbl.
Referenced by AddTable(), and Isis::PvlTranslationManager::PvlTranslationManager().
| string Isis::PvlTranslationTable::InputDefault | ( | const std::string | 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. |
| Isis::iException::Programmer |
Definition at line 272 of file PvlTranslationTable.cpp.
References _FILEINFO_, Isis::PvlContainer::Filename(), Isis::PvlObject::FindGroup(), Isis::PvlObject::HasGroup(), Isis::PvlContainer::HasKeyword(), Isis::iException::Message(), and p_trnsTbl.
| string Isis::PvlTranslationTable::InputGroup | ( | const std::string | 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) |
| Isis::iException::Programmer |
Definition at line 211 of file PvlTranslationTable.cpp.
References _FILEINFO_, Isis::PvlContainer::Begin(), Isis::PvlContainer::End(), Isis::PvlContainer::Filename(), Isis::PvlObject::FindGroup(), Isis::PvlContainer::FindKeyword(), Isis::PvlObject::HasGroup(), Isis::PvlContainer::HasKeyword(), Isis::iException::Message(), Isis::PvlContainer::Name(), and p_trnsTbl.
Referenced by Isis::PvlTranslationManager::InputHasKeyword(), Isis::PvlTranslationManager::InputSize(), Isis::PvlTranslationManager::InputUnits(), Isis::PvlTranslationManager::InputValue(), and Isis::PvlTranslationManager::Translate().
| string Isis::PvlTranslationTable::InputKeyword | ( | const std::string | 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. |
| Isis::iException::Programmer |
Definition at line 249 of file PvlTranslationTable.cpp.
References _FILEINFO_, Isis::PvlContainer::Filename(), Isis::PvlObject::FindGroup(), Isis::PvlObject::HasGroup(), Isis::PvlContainer::HasKeyword(), Isis::iException::Message(), and p_trnsTbl.
Referenced by Isis::PvlTranslationManager::InputHasKeyword(), Isis::PvlTranslationManager::InputSize(), Isis::PvlTranslationManager::InputUnits(), Isis::PvlTranslationManager::InputValue(), and Isis::PvlTranslationManager::Translate().
| string Isis::PvlTranslationTable::Translate | ( | const std::string | nName, | |
| const std::string | 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 |
| Isis::iException::Programmer |
Definition at line 151 of file PvlTranslationTable.cpp.
References _FILEINFO_, Isis::PvlContainer::Begin(), Isis::PvlContainer::End(), Isis::PvlContainer::Filename(), Isis::PvlObject::FindGroup(), Isis::PvlContainer::FindKeyword(), Isis::PvlObject::HasGroup(), Isis::PvlContainer::HasKeyword(), Isis::iException::Message(), and p_trnsTbl.
Referenced by Isis::PvlTranslationManager::Translate().