Official websites use .gov
A .gov website belongs to an official government organization in the United States.

Secure .gov websites use HTTPS
A lock ( ) or https:// means you’ve safely connected to the .gov website. Share sensitive information only on official, secure websites.

Isis Developer Reference
PvlToXmlTranslationManager.h
Go to the documentation of this file.
1#ifndef PvlToXmlTranslationManager_h
2#define PvlToXmlTranslationManager_h
7
8/* SPDX-License-Identifier: CC0-1.0 */
10
11#include <string>
12
13#include <QDomDocument>
14
15#include "FileName.h"
16#include "Pvl.h"
17
18class QDomElement;
19class QString;
20
21namespace Isis {
22 class Pvl;
23 class PvlContainer;
24 class PvlKeyword;
51 public:
52 PvlToXmlTranslationManager(const QString &transFile);
53
54 PvlToXmlTranslationManager(Pvl &inputLabel,
55 const QString &transFile);
56
58
59 // Attempt to translate the requested output name to output value
60 // using the input name and value/default value
61 virtual QString Translate(QString translationGroupName, int inputIndex = 0);
62
63 // Translate all translation table groups which contain "Auto"
64 void Auto(QDomDocument &outputLabel);
65 void Auto(Pvl &inputLabel, QDomDocument &outputLabel);
66
67 // Return the ith input value associated with a output name
68 virtual const PvlKeyword &InputKeyword(const QString translationGroupName) const;
69
70 // Return true if the input lable contains the translated group and key names
71 virtual bool InputHasKeyword(const QString translationGroupName);
72
73 void SetLabel(Pvl &inputLabel);
74
75 static void addElement(QDomElement &parent, QString name, QString value, QString units = "");
76 static void setElementValue(QDomElement &element, QString value, QString units = "");
77 static void resetElementValue(QDomElement &element, QString value, QString units = "");
78
79
80 protected:
81 void doTranslation(PvlGroup transGroup, QDomElement &parent);
82 virtual const PvlContainer *GetContainer(const PvlKeyword &inputGroup) const;
83
84 virtual std::vector< std::pair<QString, int> > validKeywords() const;
85 bool checkDependencies(QDomElement element, PvlKeyword dependencies, bool isDebug) const;
86 QDomElement *createParentElements(const QString translationGroupName, QDomElement &xml);
87 void addSiblings(PvlKeyword outputSiblings, QDomElement &parent);
88 void addAttributes(PvlKeyword something, QDomElement &parent);
89
90 private:
91 Pvl m_inputLabel;
92 };
93};
94
95#endif
LabelTranslationManager()
Constructs a default LabelTranslationManager.
Definition LabelTranslationManager.cpp:25
void SetLabel(Pvl &inputLabel)
Internalizes a Pvl formatted label for translation.
Definition PvlToXmlTranslationManager.cpp:66
PvlToXmlTranslationManager(const QString &transFile)
Constructs and initializes a TranslationManager object from given the Pvl translation file.
Definition PvlToXmlTranslationManager.cpp:36
void doTranslation(PvlGroup transGroup, QDomElement &parent)
Translate the requested output name to output values using the input name and values or default value...
Definition PvlToXmlTranslationManager.cpp:133
bool checkDependencies(QDomElement element, PvlKeyword dependencies, bool isDebug) const
virtual ~PvlToXmlTranslationManager()
Destroys the TranslationManager object.
Definition PvlToXmlTranslationManager.cpp:57
QDomElement * createParentElements(const QString translationGroupName, QDomElement &xml)
Read the OutputPosition for the translation group name passed and create any parent elements specifie...
Definition PvlToXmlTranslationManager.cpp:378
static void resetElementValue(QDomElement &element, QString value, QString units="")
Reset the QDomElement's value, and units, if units != "".
Definition PvlToXmlTranslationManager.cpp:536
static void setElementValue(QDomElement &element, QString value, QString units="")
Set the QDomElement's value, and units, if units != "".
Definition PvlToXmlTranslationManager.cpp:516
virtual bool InputHasKeyword(const QString translationGroupName)
Indicates if the input keyword corresponding to the output name exists in the label.
Definition PvlToXmlTranslationManager.cpp:304
virtual QString Translate(QString translationGroupName, int inputIndex=0)
Returns a translated value.
Definition PvlToXmlTranslationManager.cpp:104
void addSiblings(PvlKeyword outputSiblings, QDomElement &parent)
Take in outputSiblings PvlKeyword and turn each sibling into its corresponding QDomElement.
Definition PvlToXmlTranslationManager.cpp:438
virtual std::vector< std::pair< QString, int > > validKeywords() const
Returns a vector of valid keyword names and their sizes.
Definition PvlToXmlTranslationManager.cpp:79
void addAttributes(PvlKeyword something, QDomElement &parent)
Take in the outputAttributes PvlKeyword and add each attribute to the appropriate element given as an...
Definition PvlToXmlTranslationManager.cpp:471
virtual const PvlKeyword & InputKeyword(const QString translationGroupName) const
Uses the translation file group name to find the input label's PvlKeyword that corresponds to the Inp...
Definition PvlToXmlTranslationManager.cpp:254
virtual const PvlContainer * GetContainer(const PvlKeyword &inputGroup) const
Return a container from the input label with the path given by the "InputPosition" keyword of the tra...
Definition PvlToXmlTranslationManager.cpp:330
void Auto(QDomDocument &outputLabel)
Automatically translate all the output names found in the translation table.
Definition PvlToXmlTranslationManager.cpp:221
static void addElement(QDomElement &parent, QString name, QString value, QString units="")
Add a QDomElement to the given parent with the indicated value and units.
Definition PvlToXmlTranslationManager.cpp:498
This is free and unencumbered software released into the public domain.
Definition Apollo.h:16