| 23 | } |
| 24 | |
| 25 | bool AnnotationService::loadRepositoryFromFile(const std::string& source) { |
| 26 | if (source.rfind(std::string(".xml")) != source.npos) { |
| 27 | _repo = std::make_shared<XmlRepository>(_list); |
| 28 | _repo->setSource(source); |
| 29 | if (!_repo->load()) { |
| 30 | _list->removeAllAnnotations(); |
| 31 | _list->removeAllGroups(); |
| 32 | _repo = std::make_shared<ImageScopeRepository>(_list); |
| 33 | _repo->setSource(source); |
| 34 | } |
| 35 | } |
| 36 | else if (source.rfind(std::string(".ndpa")) != source.npos) { |
| 37 | _repo = std::make_shared<NDPARepository>(_list); |
| 38 | _repo->setSource(source); |
| 39 | } |
| 40 | return _repo->load(); |
| 41 | } |
| 42 | |
| 43 | bool AnnotationService::saveRepositoryToFile(const std::string& source) { |
| 44 | if (source.rfind(std::string(".xml")) != source.npos) { |
no test coverage detected