| 233 | } |
| 234 | |
| 235 | Any |
| 236 | Bundle::GetProperty(std::string const& key) const |
| 237 | { |
| 238 | if (!d) |
| 239 | { |
| 240 | throw std::invalid_argument("invalid bundle"); |
| 241 | } |
| 242 | |
| 243 | Any property(d->bundleManifest.GetValueDeprecated(key)); |
| 244 | |
| 245 | // Clients must be able to query both a bundle's properties |
| 246 | // and the framework's properties through any Bundle's |
| 247 | // GetProperty function. |
| 248 | // The Framework's properties include both the launch properties |
| 249 | // used to initialize the Framework and all relevant |
| 250 | // "org.cppmicroservices.*" properties. |
| 251 | if (property.Empty()) |
| 252 | { |
| 253 | auto props = d->coreCtx->frameworkProperties.find(key); |
| 254 | if (props != d->coreCtx->frameworkProperties.end()) |
| 255 | { |
| 256 | property = (*props).second; |
| 257 | } |
| 258 | } |
| 259 | return property; |
| 260 | } |
| 261 | |
| 262 | std::vector<std::string> |
| 263 | Bundle::GetPropertyKeys() const |