Isis 3 Developer Reference
XmlToPvlTranslationManager.h
Go to the documentation of this file.
1 #ifndef XmlToPvlTranslationManager_h
2 #define XmlToPvlTranslationManager_h
3 
25 
26 #include <fstream>
27 #include <string>
28 
29 #include <QDomDocument>
30 
31 #include "FileName.h"
32 #include "PvlTokenizer.h"
33 
34 namespace Isis {
35  class Pvl;
36  class PvlContainer;
37  class PvlKeyword;
131  public:
132  XmlToPvlTranslationManager(const QString &transFile);
133 
134  XmlToPvlTranslationManager(std::istream &transStrm);
135 
137  const QString &transFile);
138 
140  std::istream &transStrm);
141 
142  virtual ~XmlToPvlTranslationManager();
143 
144  // Attempt to translate the requested output name to output value
145  // using the input name and value/default value
146  virtual QString Translate(QString translationGroupName, int findex = 0);
147 
148  // Translate all translation table groups which contain "Auto"
150  void Auto(FileName &inputLabel, Pvl &outputLabel);
151 
152  void SetLabel(FileName &inputLabel);
153 
154  protected:
155  virtual std::vector< std::pair<QString, int> > validKeywords() const;
156  bool checkDependencies(QDomElement element, PvlKeyword dependencies, bool isDebug) const;
157  void parseFile(const FileName &xmlFileName);
158 
159  private:
160  QDomDocument m_xmlLabel;
161 
162  };
163 };
164 
165 #endif
File name manipulation and expansion.
Definition: FileName.h:116
void SetLabel(FileName &inputLabel)
Reads an Xml label file and internalizes it for translation.
Definition: XmlToPvlTranslationManager.cpp:122
virtual QString Translate(QString translationGroupName, int findex=0)
Returns a translated value.
Definition: XmlToPvlTranslationManager.cpp:178
virtual void Auto(Pvl &outputLabel)
Automatically translate all the output names tagged as Auto in the translation table If a output name...
Definition: LabelTranslationManager.cpp:85
virtual std::vector< std::pair< QString, int > > validKeywords() const
Returns a vector of valid keyword names and their sizes.
Definition: XmlToPvlTranslationManager.cpp:133
A single keyword-value pair.
Definition: PvlKeyword.h:98
XmlToPvlTranslationManager(const QString &transFile)
Constructs and initializes an XmlToPvlTranslationManager object from the given Pvl translation file...
Definition: XmlToPvlTranslationManager.cpp:54
Container for cube-like labels.
Definition: Pvl.h:135
void parseFile(const FileName &xmlFileName)
Opens, parses, and internalizes an Xml label file.
Definition: XmlToPvlTranslationManager.cpp:479
void Auto(FileName &inputLabel, Pvl &outputLabel)
Automatically translate all the output names flagged with the Auto keyword in the translation table a...
Definition: XmlToPvlTranslationManager.cpp:464
bool checkDependencies(QDomElement element, PvlKeyword dependencies, bool isDebug) const
Checks if a element in the xml label satisfies a list of dependencies.
Definition: XmlToPvlTranslationManager.cpp:387
Namespace for ISIS/Bullet specific routines.
Definition: Apollo.h:31
virtual ~XmlToPvlTranslationManager()
Destroys the XmlToPvlTranslationManager object.
Definition: XmlToPvlTranslationManager.cpp:113
Allows applications to translate simple text files.
Definition: LabelTranslationManager.h:59
Allows applications to translate Xml label files.
Definition: XmlToPvlTranslationManager.h:130