Apache Celix  2.3.0
An implementation of the OSGi specification adapted to C and C++
Public Member Functions | List of all members
celix::Bundle Class Reference

An installed bundle in the Celix framework. More...

#include <Bundle.h>

Public Member Functions

 Bundle (celix_bundle_t *_cBnd)
 
long getId () const
 get the bundle id. More...
 
std::string getEntry (std::string_view path) const
 Get a use-able entry path for the provided relative path to a bundle resource. More...
 
std::string getManifestValue (std::string_view attribute) const
 Get a manifest attribute value from the bundle manifest. More...
 
std::string getSymbolicName () const
 the symbolic name of the bundle. More...
 
std::string getName () const
 The name of the bundle. More...
 
std::string getGroup () const
 The group of the bundle. More...
 
std::string getDescription () const
 The description of the bundle. More...
 
celix::BundleState getState () const
 The current bundle state. More...
 
bool isSystemBundle () const
 whether the bundle is the system (framework) bundle More...
 

Detailed Description

An installed bundle in the Celix framework.

Each bundle installed in the Celix framework must have an associated Bundle object. A bundle must have a unique identity, a long, chosen by the Celix framework.

Note
Provided std::string_view values must be null terminated strings.
Thread safe.

Constructor & Destructor Documentation

◆ Bundle()

celix::Bundle::Bundle ( celix_bundle_t *  _cBnd)
inlineexplicit

Member Function Documentation

◆ getDescription()

std::string celix::Bundle::getDescription ( ) const
inline

The description of the bundle.

◆ getEntry()

std::string celix::Bundle::getEntry ( std::string_view  path) const
inline

Get a use-able entry path for the provided relative path to a bundle resource.

For example if there is a resource entry in the bundle at path 'META-INF/descriptors/foo.descriptor` this call will return a relative path to the extracted location of the bundle resource, e.g.: .cache/bundle5/version0.0/META-INF/descriptors/foo.descriptor

Parameters
pathThe relative path to a bundle resource
Returns
The use-able entry path or an empty string if the entry is not found.

◆ getGroup()

std::string celix::Bundle::getGroup ( ) const
inline

The group of the bundle.

◆ getId()

long celix::Bundle::getId ( ) const
inline

get the bundle id.

Returns

◆ getManifestValue()

std::string celix::Bundle::getManifestValue ( std::string_view  attribute) const
inline

Get a manifest attribute value from the bundle manifest.

Parameters
attributeThe attribute to get the value from.
Returns
The attribute value or an empty string if the attribute is not present in the bundle manifest.

◆ getName()

std::string celix::Bundle::getName ( ) const
inline

The name of the bundle.

◆ getState()

celix::BundleState celix::Bundle::getState ( ) const
inline

The current bundle state.

◆ getSymbolicName()

std::string celix::Bundle::getSymbolicName ( ) const
inline

the symbolic name of the bundle.

◆ isSystemBundle()

bool celix::Bundle::isSystemBundle ( ) const
inline

whether the bundle is the system (framework) bundle

Returns

The documentation for this class was generated from the following file: