MCPcopy Create free account
hub / github.com/Cantera/cantera / hasMapWhere

Method hasMapWhere

src/base/AnyMap.cpp:1134–1155  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1132}
1133
1134bool AnyValue::hasMapWhere(const string& key, const string& value) const
1135{
1136 if (is<vector<AnyMap>>()) {
1137 if (value == "") {
1138 return true;
1139 }
1140 for (auto& item : asVector<AnyMap>()) {
1141 if (item.hasKey(key) && item[key] == value) {
1142 return true;
1143 }
1144 }
1145 return false;
1146 } else if (is<AnyMap>()) {
1147 if (value == "" || (hasKey(key) && as<AnyMap>()[key] == value)) {
1148 return true;
1149 } else {
1150 return false;
1151 }
1152 } else {
1153 return false;
1154 }
1155}
1156
1157pair<int, int> AnyValue::order() const
1158{

Callers 3

TESTFunction · 0.80
initThermoMethod · 0.80
initThermoMethod · 0.80

Calls 1

hasKeyMethod · 0.80

Tested by 1

TESTFunction · 0.64