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

Method getFieldIndex

src/utilities/idd/IddObject.cpp:111–136  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

109 }
110
111 boost::optional<int> IddObject_Impl::getFieldIndex(const std::string& fieldName) const {
112 OptionalInt result;
113 int index = 0;
114
115 // look in fields
116 for (const IddField& field : m_fields) {
117 if (boost::iequals(field.name(), fieldName)) {
118 result = index;
119 break;
120 }
121 ++index;
122 }
123
124 // look in extensible fields
125 if (!result) {
126 for (const IddField& field : m_extensibleFields) {
127 if (boost::iequals(field.name(), fieldName)) {
128 result = index;
129 break;
130 }
131 ++index;
132 }
133 }
134
135 return result;
136 }
137
138 // SETTERS
139

Callers 2

addVersionObjectMethod · 0.80
versionObjectToAddMethod · 0.80

Calls 1

nameMethod · 0.45

Tested by

no test coverage detected