46 PvlToPvlTranslationManager::PvlToPvlTranslationManager(
const QString &transFile)
73 const QString &transFile)
88 std::istream &transStrm)
99 void PvlToPvlTranslationManager::SetLabel(
Pvl &inputLabel) {
127 while((grp =
InputGroup(translationGroupName, inst++)).name() !=
"") {
165 while((grp =
InputGroup(translationGroupName, inst++)).name() !=
"") {
173 while(it != transGroup.
end()) {
178 for(
int v = 0; v < (*con)[(result[0])].size(); v++) {
180 (*con)[result[0]][v]),
181 (*con)[result[0]].unit(v));
186 it = transGroup.
findKeyword(
"InputKey", it + 1, transGroup.
end());
248 int instanceNumber = 0;
250 bool anInputGroupFound =
false;
252 while(inputGroupKeyword.
name() !=
"") {
254 if(containingGroup != NULL) {
255 anInputGroupFound =
true;
263 inputGroupKeyword =
InputGroup(translationGroupName, instanceNumber);
266 if(anInputGroupFound) {
267 QString msg =
"Unable to find input keyword [" +
InputKeywordName(translationGroupName) +
272 QString container =
"";
274 for(
int i = 0; i <
InputGroup(translationGroupName).
size(); i++) {
275 if(i > 0) container +=
",";
277 container +=
InputGroup(translationGroupName)[i];
280 QString msg =
"Unable to find input group [" + container +
307 while((grp =
InputGroup(translationGroupName, inst++)).name() !=
"") {
322 if(inputGroup.
size() == 1 &&
332 objectIndex < inputGroup.
size() - 1;
334 if(currentObject->
hasObject(inputGroup[objectIndex])) {
335 currentObject = ¤tObject->
findObject(inputGroup[objectIndex]);
343 if(currentObject->
hasObject(inputGroup[objectIndex])) {
344 return ¤tObject->
findObject(inputGroup[objectIndex]);
346 else if(currentObject->
hasGroup(inputGroup[objectIndex])) {
347 return ¤tObject->
findGroup(inputGroup[objectIndex]);
PvlKeywordIterator end()
Return the ending iterator.
bool hasKeyword(const QString &name) const
Check to see if a keyword exists.
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.
virtual PvlContainer * CreateContainer(const QString translationGroupName, Pvl &pvl)
Create the requsted container and any containers above it and return a reference to the container...
Contains more than one keyword-value pair.
virtual ~PvlToPvlTranslationManager()
Destroys the TranslationManager object.
PvlObjectIterator findObject(const QString &name, PvlObjectIterator beg, PvlObjectIterator end)
Find the index of object with a specified name, between two indexes.
PvlKeywordIterator begin()
Return the beginning iterator.
void setName(QString name)
Sets the keyword name.
Namespace for the standard library.
virtual PvlKeyword DoTranslation(const QString translationGroupName)
Translate the requested output name to output values using the input name and values or default value...
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.
static bool stringEqual(const QString &string1, const QString &string2)
Checks to see if two QStrings are equal.
This error is for when a programmer made an API call that was illegal.
bool hasObject(const QString &name) const
Returns a boolean value based on whether the object exists in the current PvlObject or not...
virtual bool InputHasKeyword(const QString translationGroupName)
Indicates if the input keyword corresponding to the output name exists in the label.
QString Translate(const QString translationGroupName, const QString inputKeyValue="") const
Translates a single output value from the given translation group name and input value.
QString name() const
Returns the container name.
virtual QString InputKeywordName(const QString translationGroupName) const
Returns the input keyword name from the translation table corresponding to the output name argument...
QString OutputName(const QString translationGroupName)
Retrieves a string containing the value of the OutputName keyword for the translation group with the ...
int size() const
Returns the number of values stored in this keyword.
Pvl p_fLabel
A Pvl object for the input label file.
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.
PvlToPvlTranslationManager(const QString &transFile)
Constructs and initializes a TranslationManager object from given the Pvl translation file...
virtual QString Translate(QString translationGroupName, int findex=0)
Returns a translated value.
Container for cube-like labels.
virtual const PvlContainer * GetContainer(const PvlKeyword &inputGroup) const
Return a container from the input label according tund.
virtual const PvlKeyword & InputKeyword(const QString translationGroupName) const
Returns the ith input value associated with the output name argument.
PvlKeyword & findKeyword(const QString &name)
Find a keyword with a specified name.
PvlGroup & group(const int index)
Return the group at the specified index.
QString fileName() const
Returns the filename used to initialise the Pvl object.
QString name() const
Returns the keyword name.
Namespace for ISIS/Bullet specific routines.
bool IsOptional(const QString translationGroupName)
Determines whether the translation group is optional.
Allows applications to translate simple text files.
void Auto(Pvl &outputLabel)
Automatically translate all the output names found in the translation table If a output name does not...
int groups() const
Returns the number of groups contained.
QList< PvlKeyword >::const_iterator ConstPvlKeywordIterator
The const keyword iterator.
Contains Pvl Groups and Pvl Objects.
virtual PvlKeyword InputGroup(const QString translationGroupName, const int inst=0) const
Returns the input group name from the translation table corresponding to the output name argument...
bool IsAuto(const QString translationGroupName)
Determines whether the given group should be automatically translated.
void addValue(QString value, QString unit="")
Adds a value with units.