Isis 3 Developer Reference
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 {
123 
124  public:
125  // Constructors
126  PvlTranslationTable(FileName transFile);
127  PvlTranslationTable(std::istream &istr);
129 
130  virtual ~PvlTranslationTable();
131 
132  // Return the associated input group from the trans table
133  virtual PvlKeyword InputGroup(const QString translationGroupName, const int inst = 0) const;
134 
135  // Return the associated input keyword name from the trans table
136  virtual QString InputKeywordName(const QString translationGroupName) const;
137 
138  // Return the associated input default value from the trans table
139  QString InputDefault(const QString translationGroupName) const;
140 
141  // Translate a single input value associated with a output name to a output value
142  QString Translate(const QString translationGroupName, const QString inputKeyValue = "") const;
143 
144  // Add more table entries to the translation table data
145  void AddTable(std::istream &transStm);
146  void AddTable(const QString &transFile);
147 
148  protected:
150  const Pvl &TranslationTable() const;
151  virtual std::vector< std::pair<QString, int> > validKeywords() const;
152 
153  bool hasInputDefault(const QString translationGroupName);
154  bool IsAuto(const QString translationGroupName);
155  bool IsOptional(const QString translationGroupName);
156  PvlKeyword OutputPosition(const QString translationGroupName);
157  QString OutputName(const QString translationGroupName);
158  const PvlGroup &findTranslationGroup(const QString translationGroupName) const;
159 
160  private:
161  Pvl p_trnsTbl;
162  };
163 };
164 
165 #endif
bool hasInputDefault(const QString translationGroupName)
Determines whether the given group has a default input value.
Definition: PvlTranslationTable.cpp:423
virtual ~PvlTranslationTable()
Destroys the PvlTranslationTable object.
Definition: PvlTranslationTable.cpp:67
File name manipulation and expansion.
Definition: FileName.h:116
PvlTranslationTable()
Construct an empty PvlTranslationTable.
Definition: PvlTranslationTable.cpp:60
PvlKeyword OutputPosition(const QString translationGroupName)
Retrieves the OutputPosition PvlKeyword for the translation group with the given name.
Definition: PvlTranslationTable.cpp:499
QString Translate(const QString translationGroupName, const QString inputKeyValue="") const
Translates a single output value from the given translation group name and input value.
Definition: PvlTranslationTable.cpp:232
void AddTable(std::istream &transStm)
Adds the contents of a translation table to the searchable groups/keys Also performs a verification...
Definition: PvlTranslationTable.cpp:118
virtual QString InputKeywordName(const QString translationGroupName) const
Returns the input keyword name from the translation table corresponding to the output name argument...
Definition: PvlTranslationTable.cpp:376
QString OutputName(const QString translationGroupName)
Retrieves a string containing the value of the OutputName keyword for the translation group with the ...
Definition: PvlTranslationTable.cpp:527
Pvl & TranslationTable()
Protected accessor for pvl translation table passed into class.
Definition: PvlTranslationTable.cpp:78
Contains multiple PvlContainers.
Definition: PvlGroup.h:57
A single keyword-value pair.
Definition: PvlKeyword.h:98
virtual std::vector< std::pair< QString, int > > validKeywords() const
Returns a vector of valid keyword names and their sizes.
Definition: PvlTranslationTable.cpp:195
Container for cube-like labels.
Definition: Pvl.h:135
Internalizes a translation table.
Definition: PvlTranslationTable.h:122
const PvlGroup & findTranslationGroup(const QString translationGroupName) const
Searches for translation group with the given name.
Definition: PvlTranslationTable.cpp:554
Namespace for ISIS/Bullet specific routines.
Definition: Apollo.h:31
bool IsOptional(const QString translationGroupName)
Determines whether the translation group is optional.
Definition: PvlTranslationTable.cpp:473
QString InputDefault(const QString translationGroupName) const
Returns the input default value from the translation table corresponding to the output name argument...
Definition: PvlTranslationTable.cpp:398
virtual PvlKeyword InputGroup(const QString translationGroupName, const int inst=0) const
Returns the input group name from the translation table corresponding to the output name argument...
Definition: PvlTranslationTable.cpp:301
bool IsAuto(const QString translationGroupName)
Determines whether the given group should be automatically translated.
Definition: PvlTranslationTable.cpp:448