diff options
| author | Gluzskiy Alexandr <sss@sss.chaoslab.ru> | 2015-08-28 21:21:02 +0300 |
|---|---|---|
| committer | Gluzskiy Alexandr <sss@sss.chaoslab.ru> | 2015-08-28 21:21:02 +0300 |
| commit | 6f3f670abe3d2d78a13cd3862e3a587dd4fe4e85 (patch) | |
| tree | 0d681fd23bf2e70e385d053aee1e54dbe08668b1 /server/modules/metadata | |
| parent | ba8247eaf522e8a129b7fbbf09a6fab010746e3a (diff) | |
protocol:
typo fix
added description to setting_info
server:
api:
using structure with setting info instead of hust string for just value (a bit of necessary complication)
renamed few structs to avoid collision with protobuf ones
defined few module variables in api itself (a bit of simplification for module developer)
modules:
adapted to api changes
Diffstat (limited to 'server/modules/metadata')
| -rw-r--r-- | server/modules/metadata/flat_files/main.cpp | 8 | ||||
| -rw-r--r-- | server/modules/metadata/flat_files/main.h | 8 |
2 files changed, 7 insertions, 9 deletions
diff --git a/server/modules/metadata/flat_files/main.cpp b/server/modules/metadata/flat_files/main.cpp index f1583c5..d0e1040 100644 --- a/server/modules/metadata/flat_files/main.cpp +++ b/server/modules/metadata/flat_files/main.cpp @@ -78,23 +78,23 @@ void storage_impl::load(core_api *a) info.name = "flat_files_metadata"; info.description = "this module provide metadata storage in flat files"; info.version = "0.0.0.1draft"; - info.default_settings["data_path"] = "~/.local/share/udm/metadata"; + info.default_settings["data_path"].value = "~/.local/share/udm/metadata"; info.on_modules_loaded = boost::bind(&storage_impl::on_modules_loaded, this); //optional definition of function which is called after all modules loaded //std::cout<<"flat_files metadata module succesfully loaded\n"; //working fine } -const module_info &storage_impl::get_module_info() +const module_info_base &storage_impl::get_module_info() { return info; } -void storage_impl::set_module_settings(const std::map<std::string, std::string> &settings) +void storage_impl::set_module_settings(const std::map<std::string, setting_s> &settings) { this->settings = settings; - parsed_data_path = replace_home_var(this->settings["data_path"]); + parsed_data_path = replace_home_var(this->settings["data_path"].value); } diff --git a/server/modules/metadata/flat_files/main.h b/server/modules/metadata/flat_files/main.h index 0798674..b315d62 100644 --- a/server/modules/metadata/flat_files/main.h +++ b/server/modules/metadata/flat_files/main.h @@ -32,8 +32,8 @@ class storage_impl: public module_metadata_storage storage_impl(); //module base void load(core_api *a); - const module_info &get_module_info(); - void set_module_settings(const std::map<std::string, std::string> &settings); + const module_info_base &get_module_info(); + void set_module_settings(const std::map<std::string, setting_s> &settings); //metadata module bool set(const std::string &module_name, const std::string &setting_name, const std::vector<char> &data); bool get(const std::string &module_name, const std::string &setting_name, std::vector<char> &data); @@ -41,9 +41,7 @@ class storage_impl: public module_metadata_storage private: void on_modules_loaded(); - module_info info; - core_api *api = nullptr; - std::map<std::string, std::string> settings; + module_info_base info; std::string parsed_data_path; }; |
