Example #1
0
/**
 * Set all keys below parentKey.
 *
 * If the keyname of the parentKey is invalid (e.g. empty) all keys will be set.
 *
 * @copydoc kdbSet
 *
 * @copydetails doxygenKDBReturn
 *
 * @param returned the keyset where the keys are passed to the user
 * @param parentKey the parentKey of returned
 *
 * @throw KDBException if there were problems with the database
 */
inline int KDB::set (KeySet & returned, Key & parentKey)
{
	int ret = ckdb::kdbSet(handle, returned.getKeySet(), parentKey.getKey());
	if (ret == -1)
	{
		throw KDBException(parentKey);
	}
	return ret;
}
Example #2
0
std::vector<PluginSpec> PluginVariantDatabase::getPluginVariants (PluginSpec const & whichplugin) const
{
	PluginPtr plugin = this->impl->modules.load (whichplugin);
	KeySet ksSysconf (this->variantImpl->pluginconf);
	KeySet ksGenconf;

	// read plugin variants via genconf
	try
	{
		auto funcGenconf = reinterpret_cast<void (*) (ckdb::KeySet *, ckdb::Key *)> (plugin->getSymbol ("genconf"));
		funcGenconf (ksGenconf.getKeySet (), 0);
	}
	catch (kdb::tools::MissingSymbol & e)
	{
		// no genconf, but maybe sysconf variants
		KeySet placeholder;
		return this->getPluginVariantsFromSysconf (whichplugin, ksSysconf, placeholder);
	}

	// get plugin variants from genconf, but also consider sysconf for disable/override
	return this->getPluginVariantsFromGenconf (whichplugin, ksGenconf, ksSysconf);
}
/**
 * @brief append a keyset
 *
 * @param toAppend keyset to append
 *
 * @return number of keys in the keyset
 *
 * @copydoc ksAppend()
 */
inline ssize_t KeySet::append (KeySet const & toAppend)
{
	return ckdb::ksAppend(ks, toAppend.getKeySet());
}