|
|
|
@ -84,7 +84,7 @@ class SicccPersister
|
|
|
|
|
json_t *root = json_object();
|
|
|
|
|
json_object_set_new(root, "filename", get_json_from_string(so.get_filename()));
|
|
|
|
|
json_object_set_new(root, "filetype", get_json_from_string(so.get_filetype()));
|
|
|
|
|
json_object_set_new(root, "path", get_json_from_string(so.get_path()));
|
|
|
|
|
json_object_set_new(root, "path", get_json_from_string(so.get_filepath()));
|
|
|
|
|
json_object_set_new(root, "size", get_json_from_integer(so.get_size()));
|
|
|
|
|
std::string tmp = time_to_string(so.get_uploadtime());
|
|
|
|
|
json_object_set_new(root, "upload_time", get_json_from_string(tmp));
|
|
|
|
@ -110,7 +110,7 @@ class SicccPersister
|
|
|
|
|
struct dirent *entry = nullptr;
|
|
|
|
|
std::vector<Sicccobject> v;
|
|
|
|
|
json_error_t *error = nullptr;
|
|
|
|
|
if ((dir = opendir(merouter.get_persist_path().c_str())) == NULL) {
|
|
|
|
|
if ((dir = opendir(merouter.get_json_path().c_str())) == NULL) {
|
|
|
|
|
std::cerr << "Error could not open directory" << std::endl;
|
|
|
|
|
return v; // should throw exception instea1d
|
|
|
|
|
}
|
|
|
|
@ -155,7 +155,6 @@ class SicccPersister
|
|
|
|
|
|
|
|
|
|
int write_sicccfile(const Sicccobject&);
|
|
|
|
|
int write_sicccfile();
|
|
|
|
|
/* std::vector<Sicccobject> read_sicccdir(); */
|
|
|
|
|
Sicccobject read_json(const std::string&);
|
|
|
|
|
Sicccobject read_json() { return read_json(json_file_name); }
|
|
|
|
|
|
|
|
|
|