SYNOPSIS

#include <plugin.hpp>

Public Member Functions

void loadInfo ()

void parse ()

void check (std::vector< std::string > &warnings)

std::string lookupInfo (std::string item, std::string section='infos')

bool findInfo (std::string check, std::string item, std::string section='infos')

kdb::KeySet getInfo ()

kdb::KeySet getNeededConfig ()

func_t getSymbol (std::string which)

int open (kdb::Key &errorKey)

int close (kdb::Key &errorKey)

int get (kdb::KeySet &ks, kdb::Key &parentKey)

int set (kdb::KeySet &ks, kdb::Key &parentKey)

int error (kdb::KeySet &ks, kdb::Key &parentKey)

std::string name ()

std::string refname ()

Detailed Description

This is a C++ representation of a plugin.

It will load an Elektra plugin using the module loader from Elektra.

Then you can either check the plugins configuration using loadInfo(), parse() and check. Symbols can then be retrieved with getSymbol().

Or you can use the normal open(), close(), get(), set() and error() API which every plugin exports.

Member Function Documentation

void kdb::tools::Plugin::check (std::vector< std::string > &warnings)

Does various checks on the Plugin and throws exceptions if something is not ok.

  • Check if Plugin is compatible to current Version of Backend-API.

Exceptions:

PluginCheckException if there are errors

Parameters:

warnings for warnings

Precondition:

parse()

int kdb::tools::Plugin::close (\fBkdb::Key\fP &errorKey)

Calls the close function of the plugin

Precondition:

parse()

int kdb::tools::Plugin::error (\fBkdb::KeySet\fP &ks, \fBkdb::Key\fP &parentKey)

Calls the error function of the plugin

Precondition:

parse()

bool kdb::tools::Plugin::findInfo (std::stringcheck, std::stringitem, std::stringsection = \fC'infos'\fP)

Searches within a string of an information item.

Precondition:

loadInfo()

int kdb::tools::Plugin::get (\fBkdb::KeySet\fP &ks, \fBkdb::Key\fP &parentKey)

Calls the get function of the plugin

Precondition:

parse()

\fBkdb::KeySet\fP kdb::tools::Plugin::getInfo ()\fC [inline]\fP

Returns the whole keyset of information.

Precondition:

loadInfo()

\fBkdb::KeySet\fP kdb::tools::Plugin::getNeededConfig ()

In the plugin's contract there is a description of which config is needed in order to work together with a backend properly.

Returns:

the keyset with the config needed for the backend.

Precondition:

loadInfo()

func_t kdb::tools::Plugin::getSymbol (std::stringwhich)\fC [inline]\fP

Returns symbol to a function.

Precondition:

parse()

void kdb::tools::Plugin::loadInfo ()

Gets the configuration for the plugin.

std::string kdb::tools::Plugin::lookupInfo (std::stringitem, std::stringsection = \fC'infos'\fP)

Gets the whole string of an information item.

Precondition:

loadInfo()

std::string kdb::tools::Plugin::name ()

Returns:

the name of the plugin

int kdb::tools::Plugin::open (\fBkdb::Key\fP &errorKey)

Calls the open function of the plugin

Precondition:

parse()

void kdb::tools::Plugin::parse ()

Creates symbol and info table.

std::string kdb::tools::Plugin::refname ()

Returns:

the name how it would be referred to in mountpoint

int kdb::tools::Plugin::set (\fBkdb::KeySet\fP &ks, \fBkdb::Key\fP &parentKey)

Calls the set function of the plugin

Precondition:

parse()

Author

Generated automatically by Doxygen for Elektra from the source code.