USGS

Isis 3.0 Developer's Reference (API)

Home

PvlTranslationManager.h

Go to the documentation of this file.
00001 #ifndef PvlTranslationManager_h
00002 #define PvlTranslationManager_h
00003 
00025 #include <string>
00026 #include <fstream>
00027 
00028 #include "Filename.h"
00029 #include "PvlTokenizer.h"
00030 #include "PvlTranslationTable.h"
00031 
00032 namespace Isis {
00075   class PvlTranslationManager : public PvlTranslationTable {
00076     public:
00077       PvlTranslationManager(const std::string &transFile);
00078 
00079       PvlTranslationManager(Isis::Pvl &inputLabel,
00080                             const std::string &transFile);
00081 
00082       PvlTranslationManager(Isis::Pvl &inputLabel,
00083                             std::istream &transStrm);
00084 
00086       ~PvlTranslationManager() {};
00087 
00088       // Attempt to translate the requested output name to output value
00089       // using the input name and value/default value
00090       std::string Translate(const std::string nName, int findex = 0);
00091 
00092       // Translate all translation table groups which contain "Auto"
00093       void Auto(Isis::Pvl &outputLabel);
00094 
00095       // Return the ith input value associated with a output name
00096       const PvlKeyword &InputKeyword(const std::string nName) const;
00097 
00098       // Return true if the input lable contains the translated group and key names
00099       bool InputHasKeyword(const std::string nName);
00100 
00101       void SetLabel(Isis::Pvl &lab) {
00102         p_fLabel = lab;
00103       }
00104     private:
00105 
00106       Isis::Pvl p_fLabel; 
00107 
00108       Isis::PvlKeyword DoTranslation(const std::string nName);
00109       const Isis::PvlContainer *GetContainer(const PvlKeyword &inputGroup) const;
00110       Isis::PvlContainer *CreateContainer(const std::string nName, Isis::Pvl &pvl);
00111   };
00112 };
00113 
00114 #endif
00115 
00116