7 #include "fwTest/helper/compare.hpp" 9 #include <fwData/Object.hpp> 10 #include <fwDataCamp/visitor/CompareObjects.hpp> 12 #include <boost/algorithm/string.hpp> 21 ::fwData::Object::sptr objRef,
22 ::fwData::Object::sptr objComp,
23 ExcludeSetType excludeCompare,
24 ExcludeSetType excludeByPrefix)
27 visitor.
compare(objRef, objComp);
30 for(const ExcludeSetType::value_type& key: excludeCompare)
35 std::set< ::fwDataCamp::visitor::CompareObjects::PropsMapType::key_type > propsKey;
36 for(const ::fwDataCamp::visitor::CompareObjects::PropsMapType::value_type &prop: *props)
39 for(
const ExcludeSetType::value_type& key: excludeByPrefix)
41 if(::boost::starts_with(prop.first, key))
43 propsKey.insert(prop.first);
48 OSLM_ERROR_IF(
"new object difference found : " << prop.first <<
" '" << prop.second <<
"'", !erased);
51 for(const ::fwDataCamp::visitor::CompareObjects::PropsMapType::key_type &key: propsKey)
56 return props->empty();
Visitor used to compare two objects.
FWDATACAMP_API void compare(std::shared_ptr< ::fwData::Object > objRef, std::shared_ptr< ::fwData::Object > objComp)
Process to the comparison between reference object and compared object. When the process completes...
std::map< std::string, std::string > PropsMapType
Associates property path (within its parent object) to its value.
#define OSLM_ERROR_IF(message, cond)