Isis 3.0
Home
PvlTranslationTable.h
Go to the documentation of this file.
1 #ifndef PvlTranslationTable_h
2 #define PvlTranslationTable_h
3 
25 #include <iostream>
26 #include <vector>
27 #include <string>
28 
29 #include "FileName.h"
30 #include "Pvl.h"
31 
32 namespace Isis {
126 
127  public:
128  // Constructors
130  PvlTranslationTable(std::istream &istr);
132 
135 
136  // Return the associated input group from the trans table
137  PvlKeyword InputGroup(const QString nName, const int inst = 0) const;
138 
139  // Return the associated input keyword name from the trans table
140  QString InputKeywordName(const QString nName) const;
141 
142  // Return the associated input default value from the trans table
143  QString InputDefault(const QString nName) const;
144 
145  // Translate a single input value associated with a output name to a output value
146  QString Translate(const QString nName, const QString fValue = "") const;
147 
148  // Add more table entries to the translation table data
149  void AddTable(std::istream &transStm);
150  void AddTable(const QString &transFile);
151 
152  protected:
154  return p_trnsTbl;
155  }
156  const Pvl &TranslationTable() const {
157  return p_trnsTbl;
158  }
159 
160  bool IsAuto(const QString nName);
161  bool IsOptional(const QString nName);
162  PvlKeyword &OutputPosition(const QString nName);
163  QString OutputName(const QString nName);
164 
165  private:
166  Pvl p_trnsTbl;
167  };
168 };
169 
170 #endif
const Pvl & TranslationTable() const
Definition: PvlTranslationTable.h:156
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...
Definition: PvlTranslationTable.cpp:235
~PvlTranslationTable()
Destroys the PvlTranslationTable object.
Definition: PvlTranslationTable.h:134
File name manipulation and expansion.
Definition: FileName.h:111
PvlKeyword & OutputPosition(const QString nName)
Definition: PvlTranslationTable.cpp:375
QString Translate(const QString nName, const QString fValue="") const
Translates the output name and input value.
Definition: PvlTranslationTable.cpp:168
PvlTranslationTable()
Construct an empty PvlTranslationTable.
Definition: PvlTranslationTable.cpp:56
QString InputDefault(const QString nName) const
Returns the input default value from the translation table corresponding to the output name argument...
Definition: PvlTranslationTable.cpp:335
bool IsAuto(const QString nName)
Definition: PvlTranslationTable.cpp:349
void AddTable(std::istream &transStm)
Adds the contents of a translation table to the searchable groups/keys Also performs a verification...
Definition: PvlTranslationTable.cpp:77
QString InputKeywordName(const QString nName) const
Returns the input keyword name from the translation table corresponding to the output name argument...
Definition: PvlTranslationTable.cpp:311
A single keyword-value pair.
Definition: PvlKeyword.h:98
Container for cube-like labels.
Definition: Pvl.h:135
QString OutputName(const QString nName)
Definition: PvlTranslationTable.cpp:395
Internalizes a translation table.
Definition: PvlTranslationTable.h:125
bool IsOptional(const QString nName)
Definition: PvlTranslationTable.cpp:362
Pvl & TranslationTable()
Definition: PvlTranslationTable.h:153