| 684 | // SETTERS |
| 685 | |
| 686 | void IdfFile::addVersionObject() { |
| 687 | OptionalIddObject versionIdd = m_iddFileAndFactoryWrapper.versionObject(); |
| 688 | if (!versionIdd) { |
| 689 | bool printWarn(true); |
| 690 | if ((m_iddFileAndFactoryWrapper.objects().size() == 1u) && (m_iddFileAndFactoryWrapper.objects()[0] == IddObject())) { |
| 691 | printWarn = false; |
| 692 | } |
| 693 | if (printWarn) { |
| 694 | LOG(Warn, "Unable to add Version Idf object, because could not identify a Version " << "Idd object."); |
| 695 | } |
| 696 | return; |
| 697 | } |
| 698 | if (m_versionObjectIndices.empty()) { |
| 699 | IdfObject versionObject(*versionIdd); |
| 700 | // look for field named "Version Identifier" |
| 701 | OptionalInt index = versionObject.iddObject().getFieldIndex("Version Identifier"); |
| 702 | if (!index) { |
| 703 | LOG(Warn, "No 'Version Identifier' field found in the Version IddObject."); |
| 704 | } else { |
| 705 | versionObject.setString(*index, version().str()); |
| 706 | } |
| 707 | addObject(versionObject); |
| 708 | } |
| 709 | } |
| 710 | |
| 711 | // QUERIES |
| 712 |
no test coverage detected