40 LabelTranslationManager::LabelTranslationManager()
124 for(
int c = 0; c < np.
size(); c += 2) {
126 if(np[c].toUpper() ==
"OBJECT") {
134 else if(np[c].toUpper() ==
"GROUP") {
160 PvlKeyword outputKeyword( outputName, Translate(outputName) );
161 return outputKeyword;
192 QStringList typeSplit = specification.split(
"@", QString::SkipEmptyParts);
193 QStringList barSplit = specification.split(
"|", QString::SkipEmptyParts);
195 if (typeSplit.size() == 2) {
196 if (typeSplit[0].toLower() !=
"att" &&
197 typeSplit[0].toLower() !=
"tag" &&
198 typeSplit[0].toLower() !=
"new") {
199 QString msg =
"Dependency type specification [" + typeSplit[0] +
200 "] is invalid. Valid types are [att], [tag] and [new]";
203 parsedSpecification.append(typeSplit[0].toLower());
205 QStringList nameValueSplit = typeSplit[1].split(
"|", QString::SkipEmptyParts);
206 if (nameValueSplit.size() == 2) {
207 parsedSpecification.append(nameValueSplit);
209 else if (nameValueSplit.size() == 1) {
210 parsedSpecification.append(nameValueSplit);
213 QString msg =
"Malformed dependency specification [" + specification +
"].";
217 else if (barSplit.size() == 2) {
218 parsedSpecification = barSplit;
220 else if (barSplit.size() == 1 && typeSplit.size() == 1) {
221 parsedSpecification = barSplit;
224 QString msg =
" [" + specification +
"] has unexpected number of '@' or '|' delimiters";
230 QString msg =
"Malformed dependency specification [" + specification +
"].";
234 return parsedSpecification;
Unless noted otherwise, the portions of Isis written by the USGS are public domain.
PvlGroupIterator findGroup(const QString &name, PvlGroupIterator beg, PvlGroupIterator end)
Find a group with the specified name, within these indexes.
Contains more than one keyword-value pair.
LabelTranslationManager()
Constructs a default LabelTranslationManager.
virtual QStringList parseSpecification(QString specification) const
Parses and validates a dependency specification.
PvlObjectIterator findObject(const QString &name, PvlObjectIterator beg, PvlObjectIterator end)
Find the index of object with a specified name, between two indexes.
void addGroup(const Isis::PvlGroup &group)
Add a group to the object.
PvlKeyword OutputPosition(const QString translationGroupName)
Retrieves the OutputPosition PvlKeyword for the translation group with the given name.
Namespace for the standard library.
bool hasGroup(const QString &name) const
Returns a boolean value based on whether the object has the specified group or not.
virtual PvlContainer * CreateContainer(const QString translationGroupName, Pvl &pvl)
Creates all parent PVL containers for an output keyword.
This error is for when a programmer made an API call that was illegal.
virtual void Auto(Pvl &outputLabel)
Automatically translate all the output names tagged as Auto in the translation table If a output name...
bool hasObject(const QString &name) const
Returns a boolean value based on whether the object exists in the current PvlObject or not...
void addObject(const PvlObject &object)
Add a PvlObject.
QString name() const
Returns the container name.
void AddTable(std::istream &transStm)
Adds the contents of a translation table to the searchable groups/keys Also performs a verification...
virtual PvlKeyword DoTranslation(const QString translationGroupName)
Translate the requested output name to output values using the input name and values or default value...
int size() const
Returns the number of values stored in this keyword.
Pvl & TranslationTable()
Protected accessor for pvl translation table passed into class.
Contains multiple PvlContainers.
#define _FILEINFO_
Macro for the filename and line number.
A single keyword-value pair.
Container for cube-like labels.
virtual ~LabelTranslationManager()
Destroys the LabelTranslationManager object.
PvlGroup & group(const int index)
Return the group at the specified index.
Internalizes a translation table.
Namespace for ISIS/Bullet specific routines.
bool IsOptional(const QString translationGroupName)
Determines whether the translation group is optional.
int groups() const
Returns the number of groups contained.
Contains Pvl Groups and Pvl Objects.
bool IsAuto(const QString translationGroupName)
Determines whether the given group should be automatically translated.