| 320 | } // namespace |
| 321 | |
| 322 | void IECorePython::bindPathMatcher() |
| 323 | { |
| 324 | |
| 325 | PathFromInternedStringVectorData(); |
| 326 | PathFromString(); |
| 327 | |
| 328 | /// \todo Create an IECoreTest module, and bind these in it |
| 329 | def( "testPathMatcherRawIterator", &testPathMatcherRawIterator ); |
| 330 | def( "testPathMatcherIteratorPrune", &testPathMatcherIteratorPrune ); |
| 331 | def( "testPathMatcherFind", &testPathMatcherFind ); |
| 332 | |
| 333 | IECorePython::RunTimeTypedClass<PathMatcherData>() |
| 334 | .def( init<>() ) |
| 335 | .def( init<const PathMatcher &>() ) |
| 336 | .add_property( "value", make_function( &PathMatcherData::writable, return_internal_reference<1>() ) ) |
| 337 | .def( "hasBase", &PathMatcherData::hasBase ).staticmethod( "hasBase" ) |
| 338 | .def( "__repr__", &pathMatcherDataRepr ) |
| 339 | ; |
| 340 | |
| 341 | scope s = class_<PathMatcher>( "PathMatcher" ) |
| 342 | .def( "__init__", make_constructor( constructFromObject ) ) |
| 343 | .def( "__init__", make_constructor( constructFromVectorData ) ) |
| 344 | .def( init<const PathMatcher &>() ) |
| 345 | .def( "init", &initWrapper ) |
| 346 | .def( "addPath", (bool (PathMatcher::*)( const std::vector<IECore::InternedString> & ))&PathMatcher::addPath ) |
| 347 | .def( "addPath", (bool (PathMatcher::*)( const std::string & ))&PathMatcher::addPath ) |
| 348 | .def( "removePath", (bool (PathMatcher::*)( const std::vector<IECore::InternedString> & ))&PathMatcher::removePath ) |
| 349 | .def( "removePath", (bool (PathMatcher::*)( const std::string & ))&PathMatcher::removePath ) |
| 350 | .def( "addPaths", (bool (PathMatcher::*)( const PathMatcher & ))&PathMatcher::addPaths ) |
| 351 | .def( "addPaths", (bool (PathMatcher::*)( const PathMatcher &, const std::vector<IECore::InternedString> & ))&PathMatcher::addPaths ) |
| 352 | .def( "removePaths", &PathMatcher::removePaths ) |
| 353 | .def( "intersection", (PathMatcher ( PathMatcher::*)( const PathMatcher & ) const)&PathMatcher::intersection ) |
| 354 | .def( "prune", (bool (PathMatcher::*)( const std::vector<IECore::InternedString> & ))&PathMatcher::prune ) |
| 355 | .def( "prune", (bool (PathMatcher::*)( const std::string & ))&PathMatcher::prune ) |
| 356 | .def( "subTree", (PathMatcher ( PathMatcher::*)( const std::vector<IECore::InternedString> & ) const)&PathMatcher::subTree ) |
| 357 | .def( "subTree", (PathMatcher ( PathMatcher::*)( const std::string & ) const)&PathMatcher::subTree ) |
| 358 | .def( "clear", &PathMatcher::clear ) |
| 359 | .def( "isEmpty", &PathMatcher::isEmpty ) |
| 360 | .def( "size", &PathMatcher::size ) |
| 361 | .def( "paths", &paths ) |
| 362 | .def( "match", (unsigned (PathMatcher ::*)( const std::vector<IECore::InternedString> & ) const)&PathMatcher::match ) |
| 363 | .def( "match", (unsigned (PathMatcher ::*)( const std::string & ) const)&PathMatcher::match ) |
| 364 | .def( "__repr__", &pathMatcherRepr ) |
| 365 | .def( self == self ) |
| 366 | .def( self != self ) |
| 367 | ; |
| 368 | |
| 369 | enum_<PathMatcher::Result>( "Result" ) |
| 370 | .value( "NoMatch", PathMatcher::NoMatch ) |
| 371 | .value( "DescendantMatch", PathMatcher::DescendantMatch ) |
| 372 | .value( "ExactMatch", PathMatcher::ExactMatch ) |
| 373 | .value( "AncestorMatch", PathMatcher::AncestorMatch ) |
| 374 | .value( "EveryMatch", PathMatcher::EveryMatch ) |
| 375 | ; |
| 376 | |
| 377 | } |
nothing calls this directly
no test coverage detected