Isis Developer Reference
XmlToPvlTranslationManager.h
Go to the documentation of this file.
1#ifndef XmlToPvlTranslationManager_h
2#define XmlToPvlTranslationManager_h
8/* SPDX-License-Identifier: CC0-1.0 */
10
11#include <fstream>
12#include <string>
13
14#include <QDomDocument>
15
16#include "FileName.h"
17#include "PvlTokenizer.h"
18
19namespace Isis {
20 class Pvl;
21 class PvlContainer;
22 class PvlKeyword;
116 public:
117 XmlToPvlTranslationManager(const QString &transFile);
118
119 XmlToPvlTranslationManager(std::istream &transStrm);
120
122 const QString &transFile);
123
125 std::istream &transStrm);
126
128
129 // Attempt to translate the requested output name to output value
130 // using the input name and value/default value
131 virtual QString Translate(QString translationGroupName, int findex = 0);
132
133 // Translate all translation table groups which contain "Auto"
135 void Auto(FileName &inputLabel, Pvl &outputLabel);
136
137 void SetLabel(FileName &inputLabel);
138
139 protected:
140 virtual std::vector< std::pair<QString, int> > validKeywords() const;
141 bool checkDependencies(QDomElement element, PvlKeyword dependencies, bool isDebug) const;
142 void parseFile(const FileName &xmlFileName);
143
144 private:
145 QDomDocument m_xmlLabel;
146
147 };
148};
149
150#endif
File name manipulation and expansion.
Definition FileName.h:100
Allows applications to translate simple text files.
Definition LabelTranslationManager.h:43
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:70
Container for cube-like labels.
Definition Pvl.h:119
A single keyword-value pair.
Definition PvlKeyword.h:87
Allows applications to translate Xml label files.
Definition XmlToPvlTranslationManager.h:115
virtual std::vector< std::pair< QString, int > > validKeywords() const
Returns a vector of valid keyword names and their sizes.
Definition XmlToPvlTranslationManager.cpp:118
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:372
virtual QString Translate(QString translationGroupName, int findex=0)
Returns a translated value.
Definition XmlToPvlTranslationManager.cpp:163
virtual ~XmlToPvlTranslationManager()
Destroys the XmlToPvlTranslationManager object.
Definition XmlToPvlTranslationManager.cpp:98
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:449
XmlToPvlTranslationManager(const QString &transFile)
Constructs and initializes an XmlToPvlTranslationManager object from the given Pvl translation file.
Definition XmlToPvlTranslationManager.cpp:39
void parseFile(const FileName &xmlFileName)
Opens, parses, and internalizes an Xml label file.
Definition XmlToPvlTranslationManager.cpp:464
void SetLabel(FileName &inputLabel)
Reads an Xml label file and internalizes it for translation.
Definition XmlToPvlTranslationManager.cpp:107
This is free and unencumbered software released into the public domain.
Definition Apollo.h:16