USGS

Isis 3.0 Developer's Reference (API)

Home

PvlTranslationTable.h

Go to the documentation of this file.
00001 #ifndef PvlTranslationTable_h
00002 #define PvlTranslationTable_h
00003 
00025 #include <iostream>
00026 #include <vector>
00027 #include <string>
00028 
00029 #include "Filename.h"
00030 #include "Pvl.h"
00031 
00032 namespace Isis {
00125   class PvlTranslationTable {
00126 
00127     public:
00128       // Constructors
00129       PvlTranslationTable(Isis::Filename transFile);
00130       PvlTranslationTable(std::istream &istr);
00131       PvlTranslationTable();
00132 
00134       ~PvlTranslationTable() { };
00135 
00136       // Return the associated input group from the trans table
00137       PvlKeyword InputGroup(const std::string nName, const int inst = 0) const;
00138 
00139       // Return the associated input keyword name from the trans table
00140       std::string InputKeywordName(const std::string nName) const;
00141 
00142       // Return the associated input default value from the trans table
00143       std::string InputDefault(const std::string nName) const;
00144 
00145       // Translate a single input value associated with a output name to a output value
00146       std::string Translate(const std::string nName, const std::string fValue = "") const;
00147 
00148       // Add more table entries to the translation table data
00149       void AddTable(std::istream &transStm);
00150       void AddTable(const std::string &transFile);
00151 
00152     protected:
00153       Pvl &TranslationTable() {
00154         return p_trnsTbl;
00155       }
00156       const Pvl &TranslationTable() const {
00157         return p_trnsTbl;
00158       }
00159 
00160       bool IsAuto(const std::string nName);
00161       bool IsOptional(const std::string nName);
00162       PvlKeyword &OutputPosition(const std::string nName);
00163       std::string OutputName(const std::string nName);
00164 
00165     private:
00166       Pvl p_trnsTbl;
00167   };
00168 };
00169 
00170 #endif