![]() |
Webdar 1.0.0
Web user interface to libdar
|
class bibliotheque More...
#include <bibliotheque.hpp>


Classes | |
| struct | coordinates |
| complete configuration designation More... | |
Public Types | |
| enum | category { filefilter = 0 , pathfilter = 1 , command = 2 , repo = 3 , compress = 4 , confsave = 5 , conftest = 6 , confdiff = 7 , conflist = 8 , confrest = 9 , confmerge = 10 , confrepair = 11 , confcommon = 12 , slicing = 13 , ciphering = 14 , delta_sig = 15 , over_policy = 16 , confread = 17 , confisolate = 18 , EOE = 19 } |
| change event is replaced by a static method with category in argument More... | |
| typedef std::set< coordinates > | using_set |
| list of configs a given config depends on | |
Public Member Functions | |
| bibliotheque (const bibliotheque &ref)=default | |
| bibliotheque (bibliotheque &&ref) noexcept(false)=default | |
| bibliotheque & | operator= (const bibliotheque &ref)=default |
| bibliotheque & | operator= (bibliotheque &&ref) noexcept(false)=default |
| void | add_config (category categ, const std::string &name, const json &config, const using_set &refs=std::set< coordinates >()) |
| add a new configuration, the name must not exist for that category More... | |
| void | add_external_ref_to (category categ, const std::string &name, const void *from_where) |
| add external reference to a config (avoiding it to be deleted) More... | |
| void | update_config (category categ, const std::string &name, const json &config, const using_set &refs=std::set< coordinates >()) |
| update an existing configuration for that category (name must exist) More... | |
| void | delete_config (category categ, const std::string &name) |
| remove a configuration More... | |
| void | delete_external_ref_to (category categ, const std::string &name, const void *from_where) |
| remove external ref to a configuration More... | |
| bool | has_config (category categ, const std::string &name) const |
| tells whether a given cat/config exists | |
| json | fetch_config (category categ, const std::string &name) const |
| provide a stored configuration More... | |
| std::string | display_config (category categ, const std::string &name) const |
| display beautifulized json data for the given category and name | |
| std::deque< std::string > | listing (category categ) const |
| list existing configurations under the provided category | |
| bool | get_saved_status () const |
| get saved status More... | |
| bool | get_autosave_status () const |
| get the autosave property More... | |
| void | set_autosave_status (bool val) |
| set the autosave property More... | |
| void | clear () |
| clear all stored configurations | |
| bool | is_empty () const |
| whether the bibliotheque has some configuration in one or more categories | |
| virtual void | load_json (const json &source) override |
| inherited from jsoner More... | |
| virtual json | save_json () const override |
| inherited from jsoner More... | |
| virtual void | clear_json () override |
| inherited from jsoner More... | |
Public Member Functions inherited from jsoner | |
| jsoner (const jsoner &ref)=default | |
| jsoner (jsoner &&ref) noexcept(false)=default | |
| jsoner & | operator= (const jsoner &ref)=default |
| jsoner & | operator= (jsoner &&ref) noexcept(false)=default |
| virtual void | load_json (const json &source)=0 |
| setup the components from the json provided information More... | |
| virtual json | save_json () const =0 |
| produce a json structure from the component configuration More... | |
| virtual void | clear_json ()=0 |
| instruct the object to get to its default/initial configuration More... | |
Public Member Functions inherited from events | |
| events (const events &ref) | |
| copy constructor More... | |
| events (events &&ref) noexcept(false)=default | |
| events & | operator= (const events &ref)=default |
| events & | operator= (events &&ref) noexcept(false) |
| void | record_actor_on_event (actor *ptr, const std::string &name) |
| record an actor for an given event | |
Public Member Functions inherited from reference | |
| reference () | |
| usual constructor | |
| reference (const reference &ref) | |
| copy constructor More... | |
| reference (reference &&ref) noexcept(false) | |
| move constructor (only operational for objects without peering) More... | |
| reference & | operator= (const reference &ref) |
| assignment operator (only operational for objects without peering) More... | |
| reference & | operator= (reference &&ref) noexcept(false) |
| move assigment operator More... | |
| virtual | ~reference () |
| destructor | |
| void | peer_with (reference *obj) |
| method used to create a relation between two objects More... | |
| void | break_peer_with (reference *obj) |
| break the peering with the object given as argument | |
| bool | is_peer (reference *obj) const |
| whether a peering exists with that object | |
| bool | is_empty () const |
| whether the current object has peering | |
| unsigned int | size () const |
| the number of peers | |
Static Public Member Functions | |
| static std::string | changed (category cat) |
| change event per category | |
| static std::string | category_to_string (category cat) |
| convert category to json used string | |
| static category | string_to_category (const std::string &s) |
| convert json used string to category | |
| static std::string | category_description (category cat, bool capitalized) |
| provide user displayable category description | |
Additional Inherited Members | |
Protected Member Functions inherited from events | |
| virtual void | broken_peering_from (reference *obj) override |
| inherited from class reference More... | |
| void | register_name (const std::string &name) |
| add a new event for actors to register against | |
| void | unregister_name (const std::string &name) |
| remove an event and remove all actors that registed on it | |
| void | rename_name (const std::string &old_name, const std::string &new_name) |
| rename an event and keep all existing peering to this new event More... | |
| void | act (const std::string &name) |
| trigger a given event | |
Protected Member Functions inherited from reference | |
| virtual void | broken_peering_from (reference *obj) |
| to be informed when a peer has broke the peering with me More... | |
| void | reset_read_peers () const |
| reset the peers reading | |
| bool | read_next_peer (reference *&peer) const |
Static Protected Member Functions inherited from jsoner | |
| static json | wrap_config_with_json_header (unsigned int version, const std::string &class_id, const json &config) |
| given a version, class_id and configuration generates the global and common json structure More... | |
| static json | unwrap_config_from_json_header (const json &source, unsigned int &version, std::string &class_id) |
| from a given json global and common json structure split header parts and return the config part More... | |
Static Protected Attributes inherited from jsoner | |
| static constexpr const char * | jsoner_version_label = "version" |
| static constexpr const char * | jsoner_id_label = "class_id" |
| static constexpr const char * | jsoner_config_label = "config" |
class bibliotheque
class bibliotheque purpose is associate json configurations to a name and a category, and provide means to store, search, update and delete them as a whole. This class provides its own configuration (including configuration of it stores) as a jsoner class.
| void bibliotheque::add_config | ( | category | categ, |
| const std::string & | name, | ||
| const json & | config, | ||
| const using_set & | refs = std::set<coordinates>() |
||
| ) |
add a new configuration, the name must not exist for that category
| void bibliotheque::add_external_ref_to | ( | category | categ, |
| const std::string & | name, | ||
| const void * | from_where | ||
| ) |
add external reference to a config (avoiding it to be deleted)
|
inlineoverridevirtual |
inherited from jsoner
Implements jsoner.
| void bibliotheque::delete_config | ( | category | categ, |
| const std::string & | name | ||
| ) |
remove a configuration
| void bibliotheque::delete_external_ref_to | ( | category | categ, |
| const std::string & | name, | ||
| const void * | from_where | ||
| ) |
remove external ref to a configuration
| json bibliotheque::fetch_config | ( | category | categ, |
| const std::string & | name | ||
| ) | const |
provide a stored configuration
|
inline |
get the autosave property
|
inline |
get saved status
|
overridevirtual |
inherited from jsoner
Implements jsoner.
|
overridevirtual |
inherited from jsoner
Implements jsoner.
|
inline |
set the autosave property
| void bibliotheque::update_config | ( | category | categ, |
| const std::string & | name, | ||
| const json & | config, | ||
| const using_set & | refs = std::set<coordinates>() |
||
| ) |
update an existing configuration for that category (name must exist)