MCPcopy Create free account
hub / github.com/NatLabRockies/OpenStudio / addVersionObject

Method addVersionObject

src/utilities/idf/IdfFile.cpp:686–709  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

684// SETTERS
685
686void 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

Callers 1

loadMethod · 0.45

Calls 9

getFieldIndexMethod · 0.80
iddObjectMethod · 0.80
IddObjectClass · 0.70
versionObjectMethod · 0.45
sizeMethod · 0.45
objectsMethod · 0.45
emptyMethod · 0.45
setStringMethod · 0.45
strMethod · 0.45

Tested by

no test coverage detected