Isis 3 Programmer Reference
PvlTranslationTable.h
1 #ifndef PvlTranslationTable_h
2 #define PvlTranslationTable_h
3 
8 /* SPDX-License-Identifier: CC0-1.0 */
9 #include <iostream>
10 #include <vector>
11 #include <string>
12 
13 #include "FileName.h"
14 #include "Pvl.h"
15 
16 namespace Isis {
107 
108  public:
109  // Constructors
110  PvlTranslationTable(FileName transFile);
111  PvlTranslationTable(std::istream &istr);
113 
114  virtual ~PvlTranslationTable();
115 
116  // Return the associated input group from the trans table
117  virtual PvlKeyword InputGroup(const QString translationGroupName, const int inst = 0) const;
118 
119  // Return the associated input keyword name from the trans table
120  virtual QString InputKeywordName(const QString translationGroupName) const;
121 
122  // Return the associated input default value from the trans table
123  QString InputDefault(const QString translationGroupName) const;
124 
125  // Translate a single input value associated with a output name to a output value
126  QString Translate(const QString translationGroupName, const QString inputKeyValue = "") const;
127 
128  // Add more table entries to the translation table data
129  void AddTable(std::istream &transStm);
130  void AddTable(const QString &transFile);
131 
132  protected:
134  const Pvl &TranslationTable() const;
135  virtual std::vector< std::pair<QString, int> > validKeywords() const;
136 
137  bool hasInputDefault(const QString translationGroupName);
138  bool IsAuto(const QString translationGroupName);
139  bool IsOptional(const QString translationGroupName);
140  PvlKeyword OutputPosition(const QString translationGroupName);
141  QString OutputName(const QString translationGroupName);
142  const PvlGroup &findTranslationGroup(const QString translationGroupName) const;
143 
144  private:
145  Pvl p_trnsTbl;
146  };
147 };
148 
149 #endif
Isis::PvlTranslationTable::validKeywords
virtual std::vector< std::pair< QString, int > > validKeywords() const
Returns a vector of valid keyword names and their sizes.
Definition: PvlTranslationTable.cpp:179
Isis::PvlTranslationTable::~PvlTranslationTable
virtual ~PvlTranslationTable()
Destroys the PvlTranslationTable object.
Definition: PvlTranslationTable.cpp:51
Isis::PvlKeyword
A single keyword-value pair.
Definition: PvlKeyword.h:82
Isis::FileName
File name manipulation and expansion.
Definition: FileName.h:100
Isis::PvlTranslationTable::OutputName
QString OutputName(const QString translationGroupName)
Retrieves a string containing the value of the OutputName keyword for the translation group with the ...
Definition: PvlTranslationTable.cpp:511
Isis::PvlTranslationTable
Internalizes a translation table.
Definition: PvlTranslationTable.h:106
Isis::PvlTranslationTable::AddTable
void AddTable(std::istream &transStm)
Adds the contents of a translation table to the searchable groups/keys Also performs a verification,...
Definition: PvlTranslationTable.cpp:102
Isis::Pvl
Container for cube-like labels.
Definition: Pvl.h:119
Isis::PvlTranslationTable::hasInputDefault
bool hasInputDefault(const QString translationGroupName)
Determines whether the given group has a default input value.
Definition: PvlTranslationTable.cpp:407
Isis::PvlTranslationTable::PvlTranslationTable
PvlTranslationTable()
Construct an empty PvlTranslationTable.
Definition: PvlTranslationTable.cpp:44
Isis::PvlGroup
Contains multiple PvlContainers.
Definition: PvlGroup.h:41
Isis::PvlTranslationTable::OutputPosition
PvlKeyword OutputPosition(const QString translationGroupName)
Retrieves the OutputPosition PvlKeyword for the translation group with the given name.
Definition: PvlTranslationTable.cpp:483
Isis::PvlTranslationTable::Translate
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:216
Isis::PvlTranslationTable::InputKeywordName
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:360
Isis::PvlTranslationTable::InputGroup
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:285
Isis::PvlTranslationTable::IsAuto
bool IsAuto(const QString translationGroupName)
Determines whether the given group should be automatically translated.
Definition: PvlTranslationTable.cpp:432
Isis::PvlTranslationTable::IsOptional
bool IsOptional(const QString translationGroupName)
Determines whether the translation group is optional.
Definition: PvlTranslationTable.cpp:457
Isis::PvlTranslationTable::InputDefault
QString InputDefault(const QString translationGroupName) const
Returns the input default value from the translation table corresponding to the output name argument.
Definition: PvlTranslationTable.cpp:382
Isis
This is free and unencumbered software released into the public domain.
Definition: Apollo.h:16
Isis::PvlTranslationTable::TranslationTable
Pvl & TranslationTable()
Protected accessor for pvl translation table passed into class.
Definition: PvlTranslationTable.cpp:62
Isis::PvlTranslationTable::findTranslationGroup
const PvlGroup & findTranslationGroup(const QString translationGroupName) const
Searches for translation group with the given name.
Definition: PvlTranslationTable.cpp:538