| 1132 | } |
| 1133 | |
| 1134 | bool 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 | |
| 1157 | pair<int, int> AnyValue::order() const |
| 1158 | { |