| 39 | BundleHooks::BundleHooks(CoreBundleContext* ctx) : coreCtx(ctx) {} |
| 40 | |
| 41 | Bundle |
| 42 | BundleHooks::FilterBundle(BundleContext const& context, Bundle const& bundle) const |
| 43 | { |
| 44 | if (!bundle) |
| 45 | { |
| 46 | return bundle; |
| 47 | } |
| 48 | |
| 49 | std::vector<ServiceRegistrationBase> srl; |
| 50 | coreCtx->services.Get(us_service_interface_iid<BundleFindHook>(), srl); |
| 51 | if (srl.empty()) |
| 52 | { |
| 53 | return bundle; |
| 54 | } |
| 55 | else |
| 56 | { |
| 57 | std::vector<Bundle> ml; |
| 58 | ml.push_back(bundle); |
| 59 | this->FilterBundles(context, ml); |
| 60 | return ml.empty() ? Bundle() : bundle; |
| 61 | } |
| 62 | } |
| 63 | |
| 64 | void |
| 65 | BundleHooks::FilterBundles(BundleContext const& context, std::vector<Bundle>& bundles) const |
no test coverage detected