| 252 | } |
| 253 | |
| 254 | bool ObjectIdentifier::verify(const App::Property& prop, bool silent) const |
| 255 | { |
| 256 | ResolveResults result(*this); |
| 257 | if (components.size() - result.propertyIndex != 1) { |
| 258 | if (silent) { |
| 259 | return false; |
| 260 | } |
| 261 | FC_THROWM(Base::ValueError, "Invalid property path: single component expected"); |
| 262 | } |
| 263 | if (!components[result.propertyIndex].isSimple()) { |
| 264 | if (silent) { |
| 265 | return false; |
| 266 | } |
| 267 | FC_THROWM(Base::ValueError, "Invalid property path: simple component expected"); |
| 268 | } |
| 269 | const std::string& name = components[result.propertyIndex].getName(); |
| 270 | CellAddress addr; |
| 271 | bool isAddress = addr.parseAbsoluteAddress(name.c_str()); |
| 272 | if ((isAddress && addr.toString(CellAddress::Cell::ShowRowColumn) != prop.getName()) |
| 273 | || (!isAddress && name != prop.getName())) { |
| 274 | if (silent) { |
| 275 | return false; |
| 276 | } |
| 277 | FC_THROWM(Base::ValueError, "Invalid property path: name mismatch"); |
| 278 | } |
| 279 | return true; |
| 280 | } |
| 281 | |
| 282 | const std::string& ObjectIdentifier::toString() const |
| 283 | { |
no test coverage detected