106 PvlObject *obj = &pvl;
109 for(
int c = 0; c < np.size(); c += 2) {
111 if(np[c].toUpper() ==
"OBJECT") {
113 if(!obj->hasObject(np[c+1])) {
114 obj->addObject(np[c+1]);
116 obj = &(obj->findObject(np[c+1]));
119 else if(np[c].toUpper() ==
"GROUP") {
121 if(!obj->hasGroup(np[c+1])) {
122 obj->addGroup(np[c+1]);
124 return (PvlContainer *) & (obj->findGroup(np[c+1]));
129 return (PvlContainer *) obj;
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]";
186 throw IException(IException::Programmer, msg, _FILEINFO_);
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 +
"].";
199 throw IException(IException::Programmer, msg, _FILEINFO_);
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";
210 throw IException(IException::Programmer,msg, _FILEINFO_);
214 catch (IException &e) {
215 QString msg =
"Malformed dependency specification [" + specification +
"].";
216 throw IException(e, IException::Programmer, msg, _FILEINFO_);
219 return parsedSpecification;