7#include "PvlTranslationTable.h"
11#include "LabelTranslationManager.h"
14#include "PvlContainer.h"
16#include "PvlKeyword.h"
109 for(
int c = 0; c < np.
size(); c += 2) {
111 if(np[c].toUpper() ==
"OBJECT") {
119 else if(np[c].toUpper() ==
"GROUP") {
145 PvlKeyword outputKeyword( outputName, Translate(outputName) );
146 return outputKeyword;
177 QStringList typeSplit = specification.split(
"@", Qt::SkipEmptyParts);
178 QStringList barSplit = specification.split(
"|", Qt::SkipEmptyParts);
180 if (typeSplit.size() == 2) {
181 if (typeSplit[0].toLower() !=
"att" &&
182 typeSplit[0].toLower() !=
"tag" &&
183 typeSplit[0].toLower() !=
"new") {
184 QString msg =
"Dependency type specification [" + typeSplit[0] +
185 "] is invalid. Valid types are [att], [tag] and [new]";
188 parsedSpecification.append(typeSplit[0].toLower());
190 QStringList nameValueSplit = typeSplit[1].split(
"|", Qt::SkipEmptyParts);
191 if (nameValueSplit.size() == 2) {
192 parsedSpecification.append(nameValueSplit);
194 else if (nameValueSplit.size() == 1) {
195 parsedSpecification.append(nameValueSplit);
198 QString msg =
"Malformed dependency specification [" + specification +
"].";
202 else if (barSplit.size() == 2) {
203 parsedSpecification = barSplit;
205 else if (barSplit.size() == 1 && typeSplit.size() == 1) {
206 parsedSpecification = barSplit;
209 QString msg =
" [" + specification +
"] has unexpected number of '@' or '|' delimiters";
215 QString msg =
"Malformed dependency specification [" + specification +
"].";
219 return parsedSpecification;
@ Programmer
This error is for when a programmer made an API call that was illegal.
virtual PvlKeyword DoTranslation(const QString translationGroupName)
Translate the requested output name to output values using the input name and values or default value...
virtual void Auto(Pvl &outputLabel)
Automatically translate all the output names tagged as Auto in the translation table If a output name...
LabelTranslationManager()
Constructs a default LabelTranslationManager.
virtual QStringList parseSpecification(QString specification) const
Parses and validates a dependency specification.
virtual PvlContainer * CreateContainer(const QString translationGroupName, Pvl &pvl)
Creates all parent PVL containers for an output keyword.
virtual ~LabelTranslationManager()
Destroys the LabelTranslationManager object.
Contains more than one keyword-value pair.
QString name() const
Returns the container name.
Contains multiple PvlContainers.
Container for cube-like labels.
A single keyword-value pair.
int size() const
Returns the number of values stored in this keyword.
Contains Pvl Groups and Pvl Objects.
PvlGroup & group(const int index)
Return the group at the specified index.
bool hasObject(const QString &name) const
Returns a boolean value based on whether the object exists in the current PvlObject or not.
int groups() const
Returns the number of groups contained.
PvlObjectIterator findObject(const QString &name, PvlObjectIterator beg, PvlObjectIterator end)
Find the index of object with a specified name, between two indexes.
bool hasGroup(const QString &name) const
Returns a boolean value based on whether the object has the specified group or not.
void addObject(const PvlObject &object)
Add a PvlObject.
void addGroup(const Isis::PvlGroup &group)
Add a group to the object.
PvlGroupIterator findGroup(const QString &name, PvlGroupIterator beg, PvlGroupIterator end)
Find a group with the specified name, within these indexes.
bool IsOptional(const QString translationGroupName)
Determines whether the translation group is optional.
PvlKeyword OutputPosition(const QString translationGroupName)
Retrieves the OutputPosition PvlKeyword for the translation group with the given name.
void AddTable(std::istream &transStm)
Adds the contents of a translation table to the searchable groups/keys Also performs a verification,...
bool IsAuto(const QString translationGroupName)
Determines whether the given group should be automatically translated.
Pvl & TranslationTable()
Protected accessor for pvl translation table passed into class.
PvlTranslationTable(FileName transFile)
Constructs and initializes a PvlTranslationTable object.
This is free and unencumbered software released into the public domain.
Namespace for the standard library.