Apache Celix
2.4.0
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.
50 explicit Bundle(celix_bundle_t* _cBnd) : cBnd{_cBnd, [](celix_bundle_t*){}} {}
74 #if __cplusplus >= 201703L //C++17 or higher
75 std::string
getEntry(std::string_view path)
const {
76 return getEntryInternal(path.data());
79 std::string
getEntry(
const std::string& path)
const {
80 return getEntryInternal(path.c_str());
99 #if __cplusplus >= 201703L //C++17 or higher
101 return getDataFileInternal(path.data());
104 std::string
getDataFile(
const std::string& path)
const {
105 return getDataFileInternal(path.c_str());
114 #if __cplusplus >= 201703L //C++17 or higher
117 return header ==
nullptr ? std::string{} : std::string{header};
122 return header ==
nullptr ? std::string{} : std::string{header};
161 return convertCStringToStdString(loc);
170 case CELIX_BUNDLE_STATE_UNINSTALLED:
172 case CELIX_BUNDLE_STATE_INSTALLED:
174 case CELIX_BUNDLE_STATE_RESOLVED:
176 case CELIX_BUNDLE_STATE_STARTING:
178 case CELIX_BUNDLE_STATE_STOPPING:
180 case CELIX_BUNDLE_STATE_ACTIVE:
204 std::string getEntryInternal(
const char* path)
const {
206 return convertCStringToStdString(entry);
209 std::string getDataFileInternal(
const char* path)
const {
211 return convertCStringToStdString(entry);
217 std::string convertCStringToStdString(
char* str)
const {
218 std::unique_ptr<char, void(*)(
void*)> strGuard{str, free};
219 return std::string{str ==
nullptr ?
"" : str};
222 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.
CELIX_FRAMEWORK_EXPORT char * celix_bundle_getEntry(const celix_bundle_t *bnd, const char *path)
std::string getEntry(std::string_view path) const
Get a use-able entry path for the provided relative path to a bundle resource cache.
Definition: Bundle.h:75
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:50
celix_bundle_t * getCBundle() const
Get the C bundle handle.
Definition: Bundle.h:200
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:159
std::string getDescription() const
The description of the bundle.
Definition: Bundle.h:150
celix::BundleState getState() const
The current bundle state.
Definition: Bundle.h:167
bool isSystemBundle() const
whether the bundle is the system (framework) bundle
Definition: Bundle.h:191
An installed bundle in the Celix framework.
Definition: Bundle.h:48
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:56
CELIX_FRAMEWORK_EXPORT long celix_bundle_getId(const celix_bundle_t *bnd)
Return the bundle id.
std::string getDataFile(std::string_view path) const
Return a use-able entry path for the provided relative path to a bundle persistent storage.
Definition: Bundle.h:100
std::string getManifestValue(std::string_view attribute) const
Get a manifest attribute value from the bundle manifest.
Definition: Bundle.h:115
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:143
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:129
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:29
std::string getName() const
The name of the bundle.
Definition: Bundle.h:136
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.