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


This class allows the translation of text files which can be parsed by the Pvl class.
For internal use only.
Definition at line 69 of file PvlTranslationManager.h.
Public Member Functions | |
| PvlTranslationManager (const std::string &transFile) | |
| PvlTranslationManager (Isis::Pvl &inputLabel, const std::string &transFile) | |
| Constructs and initializes a TranslationManager object. | |
| PvlTranslationManager (Isis::Pvl &inputLabel, std::istream &transStrm) | |
| Constructs and initializes a TranslationManager object. | |
| ~PvlTranslationManager () | |
| Destroys the TranslationManager object. | |
| std::string | Translate (const std::string nName, int findex=0) |
| Returns a translated value. | |
| void | Auto (Isis::Pvl &outputLabel) |
| std::string | InputValue (const std::string nName, int findex=0) |
| Returns the ith input value assiciated with the output name argument. | |
| std::string | InputUnits (const std::string nName, int findex=0) |
| Returns the ith input units assiciated with the output name argument. | |
| int | InputSize (const std::string nName) |
| Returns the number of values in foriegn keyword assiciated with the output name argument. | |
| bool | InputHasKeyword (const std::string nName) |
| Indicates if the input keyword corresponding to the output name exists in the label. | |
| void | SetLabel (Isis::Pvl &lab) |
| 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 Member Functions | |
| Isis::PvlKeyword | Translate (const std::string nName, double dummy) |
| Translate the requested output name to output values using the input name and values or default value. | |
| Isis::PvlContainer * | GetContainer (const std::string &inputGroup) |
| Isis::PvlContainer * | CreateContainer (const std::string nName, Isis::Pvl &pvl) |
Private Attributes | |
| Isis::Pvl | p_fLabel |
| A Pvl object for the input label file. | |
| Isis::PvlTranslationManager::PvlTranslationManager | ( | Isis::Pvl & | inputLabel, | |
| const std::string & | transFile | |||
| ) |
Constructs and initializes a TranslationManager object.
| inputLabel | The Pvl holding the input label. | |
| transFile | The translation file to be used to tranlate keywords in the input label. |
Definition at line 43 of file PvlTranslationManager.cpp.
References Isis::PvlTranslationTable::AddTable(), and p_fLabel.
| Isis::PvlTranslationManager::PvlTranslationManager | ( | Isis::Pvl & | inputLabel, | |
| std::istream & | transStrm | |||
| ) |
Constructs and initializes a TranslationManager object.
| inputLabel | The Pvl holding the input label. | |
| transStrm | A stream containing the tranlation table to be used to tranlate keywords in the input label. |
Definition at line 59 of file PvlTranslationManager.cpp.
References Isis::PvlTranslationTable::AddTable(), and p_fLabel.
| Isis::PvlTranslationManager::~PvlTranslationManager | ( | ) | [inline] |
| void Isis::PvlTranslationTable::AddTable | ( | const std::string & | transFile | ) | [inherited] |
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_, Isis::PvlTranslationTable::AddTable(), Isis::Filename::Expanded(), Isis::Message::FileOpen(), in, and Isis::iException::Message().
| void Isis::PvlTranslationTable::AddTable | ( | std::istream & | transStm | ) | [inherited] |
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 Isis::PvlTranslationTable::p_trnsTbl.
Referenced by Isis::PvlTranslationTable::AddTable(), and PvlTranslationManager().
| string Isis::PvlTranslationTable::InputDefault | ( | const std::string | nName | ) | const [inherited] |
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 Isis::PvlTranslationTable::p_trnsTbl.
| string Isis::PvlTranslationTable::InputGroup | ( | const std::string | nName, | |
| const int | inst = 0 | |||
| ) | const [inherited] |
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 Isis::PvlTranslationTable::p_trnsTbl.
Referenced by InputHasKeyword(), InputSize(), InputUnits(), InputValue(), and Translate().
| bool Isis::PvlTranslationManager::InputHasKeyword | ( | const std::string | nName | ) |
Indicates if the input keyword corresponding to the output name exists in the label.
| nName | The output name used to identify the input keyword. |
Definition at line 289 of file PvlTranslationManager.cpp.
References GetContainer(), Isis::PvlContainer::HasKeyword(), Isis::PvlTranslationTable::InputGroup(), and Isis::PvlTranslationTable::InputKeyword().
Referenced by Isis::ProcessImportPds::ExtractPdsProjection(), Isis::ProcessImportPds::IdentifySource(), Isis::ProcessImportPds::SetPdsFile(), and Isis::ProcessImportPds::TranslatePdsProjection().
| string Isis::PvlTranslationTable::InputKeyword | ( | const std::string | nName | ) | const [inherited] |
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 Isis::PvlTranslationTable::p_trnsTbl.
Referenced by InputHasKeyword(), InputSize(), InputUnits(), InputValue(), and Translate().
| int Isis::PvlTranslationManager::InputSize | ( | const std::string | nName | ) |
Returns the number of values in foriegn keyword assiciated with the output name argument.
| nName | The output name used to identify the input keyword. |
| Isis::iException::Programmer |
Definition at line 255 of file PvlTranslationManager.cpp.
References _FILEINFO_, Isis::PvlContainer::Filename(), GetContainer(), Isis::PvlContainer::HasKeyword(), Isis::PvlTranslationTable::InputGroup(), Isis::PvlTranslationTable::InputKeyword(), Isis::iException::Message(), and Isis::PvlTranslationTable::TranslationTable().
| string Isis::PvlTranslationManager::InputUnits | ( | const std::string | nName, | |
| int | findex = 0 | |||
| ) |
Returns the ith input units assiciated with the output name argument.
| nName | The output name used to identify the input keyword. | |
| findex | The index into the input keyword array. Defaults to 0 |
| Isis::iException::Programmer |
Definition at line 216 of file PvlTranslationManager.cpp.
References _FILEINFO_, Isis::PvlContainer::Filename(), GetContainer(), Isis::PvlContainer::HasKeyword(), Isis::PvlTranslationTable::InputGroup(), Isis::PvlTranslationTable::InputKeyword(), Isis::iException::Message(), and Isis::PvlTranslationTable::TranslationTable().
Referenced by Isis::ProcessImportPds::ExtractPdsProjection().
| string Isis::PvlTranslationManager::InputValue | ( | const std::string | nName, | |
| int | findex = 0 | |||
| ) |
Returns the ith input value assiciated with the output name argument.
| nName | The output name used to identify the input keyword. | |
| findex | The index into the input keyword array. Defaults to 0 |
| Isis::iException::Programmer |
Definition at line 176 of file PvlTranslationManager.cpp.
References _FILEINFO_, Isis::PvlContainer::Filename(), GetContainer(), Isis::PvlContainer::HasKeyword(), Isis::PvlTranslationTable::InputGroup(), Isis::PvlTranslationTable::InputKeyword(), Isis::iException::Message(), and Isis::PvlTranslationTable::TranslationTable().
| string Isis::PvlTranslationTable::Translate | ( | const std::string | nName, | |
| const std::string | fValue = "" | |||
| ) | const [inherited] |
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 Isis::PvlTranslationTable::p_trnsTbl.
Referenced by Translate().
| Isis::PvlKeyword Isis::PvlTranslationManager::Translate | ( | const std::string | nName, | |
| double | dummy | |||
| ) | [private] |
Translate the requested output name to output values using the input name and values or default value.
| nName | The output name used to identify the input keyword to be translated. | |
| dummy |
Definition at line 111 of file PvlTranslationManager.cpp.
References Isis::PvlKeyword::AddValue(), GetContainer(), Isis::PvlContainer::HasKeyword(), Isis::PvlTranslationTable::InputGroup(), Isis::PvlTranslationTable::InputKeyword(), Isis::PvlTranslationTable::OutputName(), Isis::PvlKeyword::SetName(), and Isis::PvlTranslationTable::Translate().
| string Isis::PvlTranslationManager::Translate | ( | const std::string | nName, | |
| int | findex = 0 | |||
| ) |
Returns a translated value.
The output name is used to find the input group, keyword, default and tranlations in the translation table. If the keyword does not exist in the input label, the input default if available will be used as the input value. This input value is then used to search all of the translations. If a match is found the translated value is returned.
| nName | The output name used to identify the input keyword to be translated. | |
| findex | The index into the input keyword array. Defaults to 0 |
Definition at line 82 of file PvlTranslationManager.cpp.
References GetContainer(), Isis::PvlContainer::HasKeyword(), Isis::PvlTranslationTable::InputGroup(), Isis::PvlTranslationTable::InputKeyword(), and Isis::PvlTranslationTable::Translate().
Referenced by Auto(), Isis::NaifStatus::CheckErrors(), Isis::ProcessImportPds::ExtractPdsProjection(), Isis::ObservationNumber::FindObservationTranslation(), and Isis::SerialNumber::FindSerialTranslation().
A Pvl object for the input label file.
Definition at line 111 of file PvlTranslationManager.h.
Referenced by GetContainer(), PvlTranslationManager(), and SetLabel().