summaryrefslogtreecommitdiff
path: root/server/modules/metadata
diff options
context:
space:
mode:
Diffstat (limited to 'server/modules/metadata')
-rw-r--r--server/modules/metadata/flat_files/flat_files.cbp4
-rw-r--r--server/modules/metadata/flat_files/main.cpp12
-rw-r--r--server/modules/metadata/flat_files/main.h3
3 files changed, 16 insertions, 3 deletions
diff --git a/server/modules/metadata/flat_files/flat_files.cbp b/server/modules/metadata/flat_files/flat_files.cbp
index 7dd9c9f..3081897 100644
--- a/server/modules/metadata/flat_files/flat_files.cbp
+++ b/server/modules/metadata/flat_files/flat_files.cbp
@@ -37,6 +37,10 @@
<Add option="-fexceptions -fPIC" />
<Add directory="../../../include" />
</Compiler>
+ <Linker>
+ <Add library="boost_filesystem" />
+ <Add library="boost_system" />
+ </Linker>
<Unit filename="main.cpp" />
<Unit filename="main.h" />
<Extensions>
diff --git a/server/modules/metadata/flat_files/main.cpp b/server/modules/metadata/flat_files/main.cpp
index 78b8a58..7fd197c 100644
--- a/server/modules/metadata/flat_files/main.cpp
+++ b/server/modules/metadata/flat_files/main.cpp
@@ -22,6 +22,13 @@
#include "main.h"
#include <iostream>
+#include <boost/filesystem.hpp>
+#include <boost/bind.hpp>
+
+void storage_impl::on_modules_loaded()
+{
+ settings = api->get_module_settings(this);
+}
void storage_impl::load(core_api *a)
@@ -30,8 +37,9 @@ 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.1";
+ info.version = "0.0.0.1draft";
info.default_settings["data_path"] = "~/.local/share/udm/metadata";
+ info.on_modules_loaded = boost::bind(&storage_impl::on_modules_loaded, this);
std::cout<<"flat_files metadata module succesfully loaded\n";
}
@@ -74,7 +82,7 @@ module_base::~module_base()
}
-extern "C" void* udm_metadata_module_load()
+extern "C" module_metadata_storage* udm_metadata_module_load()
{
return new storage_impl;
}
diff --git a/server/modules/metadata/flat_files/main.h b/server/modules/metadata/flat_files/main.h
index 5604623..97a2723 100644
--- a/server/modules/metadata/flat_files/main.h
+++ b/server/modules/metadata/flat_files/main.h
@@ -40,9 +40,10 @@ class storage_impl: public module_metadata_storage
bool remove(const std::string &module_name, const std::string &setting_name);
private:
+ void on_modules_loaded();
module_info info;
core_api *api = nullptr;
-
+ std::map<std::string, std::string> settings;
};