* Remove an object from the current PvlObject. * * @param name The name of the PvlObject to remove. * * @throws IException */
| 356 | * @throws IException |
| 357 | */ |
| 358 | void PvlObject::deleteObject(const QString &name) { |
| 359 | PvlObjectIterator key = findObject(name, beginObject(), endObject()); |
| 360 | if(key == endObject()) { |
| 361 | QString msg = "Unable to find PVL object [" + name + "] in " + type() + |
| 362 | " [" + this->name() + "]"; |
| 363 | if(m_filename.size() > 0) msg += " in file [" + m_filename + "]"; |
| 364 | throw IException(IException::Unknown, msg, _FILEINFO_); |
| 365 | } |
| 366 | |
| 367 | m_objects.erase(key); |
| 368 | } |
| 369 | |
| 370 | |
| 371 | /** |