Apache Celix
latest
Apache Celix is a framework for C, C++14 and C++17 to develop dynamic modular software applications using component and in-process service-oriented programming.
|
Go to the documentation of this file.
51 explicit Bundle(celix_bundle_t* _cBnd) : cBnd{_cBnd, [](celix_bundle_t*){}} {}
75 std::string
getEntry(
const std::string& path)
const {
76 return getEntryInternal(path.c_str());
95 return getDataFileInternal(path.c_str());
105 return header ==
nullptr ? std::string{} : std::string{header};
143 return convertCStringToStdString(loc);
152 case CELIX_BUNDLE_STATE_UNINSTALLED:
154 case CELIX_BUNDLE_STATE_INSTALLED:
156 case CELIX_BUNDLE_STATE_RESOLVED:
158 case CELIX_BUNDLE_STATE_STARTING:
160 case CELIX_BUNDLE_STATE_STOPPING:
162 case CELIX_BUNDLE_STATE_ACTIVE:
186 std::string getEntryInternal(
const char* path)
const {
188 return convertCStringToStdString(entry);
191 std::string getDataFileInternal(
const char* path)
const {
193 return convertCStringToStdString(entry);
199 std::string convertCStringToStdString(
char* str)
const {
200 std::unique_ptr<char, void(*)(
void*)> strGuard{str, free};
201 return std::string{str ==
nullptr ?
"" : str};
204 const std::shared_ptr<celix_bundle_t> cBnd;
const CELIX_FRAMEWORK_EXPORT char * celix_bundle_getName(const celix_bundle_t *bnd)
Return the name of the bundle. Note the return value is valid as long as the bundle is installed.
std::string getDataFile(const std::string &path) const
Return a use-able entry path for the provided relative path to a bundle persistent storage.
Definition: Bundle.h:94
CELIX_FRAMEWORK_EXPORT char * celix_bundle_getEntry(const celix_bundle_t *bnd, const char *path)
const CELIX_FRAMEWORK_EXPORT char * celix_bundle_getSymbolicName(const celix_bundle_t *bnd)
Return the symbolic name of the bundle. Note the return value is valid as long as the bundle is insta...
Bundle(celix_bundle_t *_cBnd)
Definition: Bundle.h:51
celix_bundle_t * getCBundle() const
Get the C bundle handle.
Definition: Bundle.h:182
CELIX_FRAMEWORK_EXPORT char * celix_bundle_getDataFile(const celix_bundle_t *bnd, const char *path)
std::string getLocation() const
Return the update location of the bundle. The location the location passed to celix::BundleContext::i...
Definition: Bundle.h:141
std::string getDescription() const
The description of the bundle.
Definition: Bundle.h:132
celix::BundleState getState() const
The current bundle state.
Definition: Bundle.h:149
bool isSystemBundle() const
whether the bundle is the system (framework) bundle
Definition: Bundle.h:173
An installed bundle in the Celix framework.
Definition: Bundle.h:49
std::string getEntry(const std::string &path) const
Get a use-able entry path for the provided relative path to a bundle resource cache.
Definition: Bundle.h:75
CELIX_FRAMEWORK_EXPORT bool celix_bundle_isSystemBundle(const celix_bundle_t *bnd)
Return whether the bundle is the system bundle.
long getId() const
get the bundle id.
Definition: Bundle.h:57
std::string getManifestValue(const std::string &attribute) const
Get a manifest attribute value from the bundle manifest.
Definition: Bundle.h:103
CELIX_FRAMEWORK_EXPORT long celix_bundle_getId(const celix_bundle_t *bnd)
Return the bundle id.
CELIX_FRAMEWORK_EXPORT char * celix_bundle_getLocation(const celix_bundle_t *bnd)
Return the update location of the bundle. The location the location passed to celix_bundleContext_ins...
std::string getGroup() const
The group of the bundle.
Definition: Bundle.h:125
const CELIX_FRAMEWORK_EXPORT char * celix_bundle_getManifestValue(const celix_bundle_t *bnd, const char *attribute)
Get a manifest attribute value from the bundle manifest.
std::string getSymbolicName() const
the symbolic name of the bundle.
Definition: Bundle.h:111
const CELIX_FRAMEWORK_EXPORT char * celix_bundle_getDescription(const celix_bundle_t *bnd)
Return the description of the bundle. Note the return value is valid as long as the bundle is install...
BundleState
Definition: Bundle.h:30
std::string getName() const
The name of the bundle.
Definition: Bundle.h:118
const CELIX_FRAMEWORK_EXPORT char * celix_bundle_getGroup(const celix_bundle_t *bnd)
Return the group of the bundle. Groups are used to order bundles. Note the return value is valid as l...
CELIX_FRAMEWORK_EXPORT celix_bundle_state_e celix_bundle_getState(const celix_bundle_t *bnd)
Return the bundle state.