Elektra  0.8.21
Static Public Member Functions | Static Public Attributes | List of all members
kdb::tools::Backends Class Reference

Allows one to list backends. More...

#include <backends.hpp>

Static Public Member Functions

static BackendInfoVector getBackendInfo (KeySet mountConf)
 give info about current mounted backends More...
 
static BackendInfo findBackend (std::string const &backend, KeySet mountConf, bool verbose=false)
 Find a backend in the given name. More...
 
static bool umount (std::string const &backend, KeySet &mountConf)
 Unmount a backend by given mountPath. More...
 
static std::string getBasePath (std::string name)
 returns the base path of a mounted backend below system/elektra/mountpoints More...
 

Static Public Attributes

static const char * mountpointsPath = "system/elektra/mountpoints"
 Below this path is the mountConf.
 

Detailed Description

Allows one to list backends.

Member Function Documentation

◆ findBackend()

BackendInfo kdb::tools::Backends::findBackend ( std::string const &  mountPath,
KeySet  mountConf,
bool  verbose = false 
)
static

Find a backend in the given name.

Parameters
mountPaththe given backend name to find

For backwards compatibility old-style names containing _ instead of escaped / are accepted if no modern-style mountpoint is found.

Parameters
mountConfthe configuration to search (should contain keys below mountpointsPath to find something)
Returns
the found backend or an empty BackendInfo if nothing found (with empty strings)

◆ getBackendInfo()

Backends::BackendInfoVector kdb::tools::Backends::getBackendInfo ( KeySet  mountConf)
static

give info about current mounted backends

Parameters
mountConfa keyset that contains everything below Backends::mountpointsPath
Returns
an vector of information about mounted backends

◆ getBasePath()

std::string kdb::tools::Backends::getBasePath ( std::string  mp)
static

returns the base path of a mounted backend below system/elektra/mountpoints

Parameters
mpthe mountpoint (name will be derived from it)
Returns
the properly prefixed and escaped name

◆ umount()

bool kdb::tools::Backends::umount ( std::string const &  mountPath,
KeySet mountConf 
)
static

Unmount a backend by given mountPath.

Parameters
mountPaththe given mountpoint

Uses findBackend() to locate the backend.

Return values
trueif something was done
falseif nothing was done (but also no error)

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