we don't actually wrap the existing init, but rather reimplement it here using clear() and addPath(), so that we can support a mixture of strings and InternedStringVectorData.
| 255 | // here using clear() and addPath(), so that we can support a mixture |
| 256 | // of strings and InternedStringVectorData. |
| 257 | void initWrapper( PathMatcher &m, boost::python::object paths ) |
| 258 | { |
| 259 | m.clear(); |
| 260 | for( size_t i = 0, e = len( paths ); i < e; ++i ) |
| 261 | { |
| 262 | object path = paths[i]; |
| 263 | extract<const IECore::InternedStringVectorData *> pathDataExtractor( path ); |
| 264 | const IECore::InternedStringVectorData *pathData = pathDataExtractor.check() ? pathDataExtractor() : nullptr; |
| 265 | if( pathData ) |
| 266 | { |
| 267 | m.addPath( pathData->readable() ); |
| 268 | } |
| 269 | else |
| 270 | { |
| 271 | m.addPath( extract<std::string>( path ) ); |
| 272 | } |
| 273 | } |
| 274 | } |
| 275 | |
| 276 | PathMatcher *constructFromObject( boost::python::object oPaths ) |
| 277 | { |