remove filepath from sicccobject
This commit is contained in:
parent
9c0b563837
commit
e5af37f305
|
@ -2,15 +2,15 @@
|
|||
#include "DynamicObjects.H"
|
||||
|
||||
//add parameter for ordering??
|
||||
std::string DynamicObjects::render_object_list(){
|
||||
|
||||
std::string DynamicObjects::render_object_list()
|
||||
{
|
||||
std::string output = u8R"FOO(
|
||||
<ul id="down">
|
||||
)FOO";
|
||||
|
||||
for (auto& it : this->m_thevec){
|
||||
output += u8"<li>\n";
|
||||
output += u8"<a href=\"" + m_merouterin->get_baseurl() + it.get_filepath() + it.get_filename() + u8"\">"; //we could include baseurl here?
|
||||
output += u8"<a href=\"" + m_merouterin->get_baseurl() + it.get_filename() + u8"\">"; //we could include baseurl here?
|
||||
output += it.get_filename();
|
||||
output += u8"</a> <span class=\"size\">";
|
||||
output += it.get_pretty_sized();
|
||||
|
|
|
@ -84,7 +84,6 @@ 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_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));
|
||||
|
|
|
@ -18,7 +18,6 @@ class Sicccobject {
|
|||
const size_t sz)
|
||||
: filename(file),
|
||||
filetype(ftype),
|
||||
filepath(fpath),
|
||||
size(sz)
|
||||
{
|
||||
upload_date = std::chrono::system_clock::now();
|
||||
|
@ -30,7 +29,6 @@ class Sicccobject {
|
|||
const size_t sz)
|
||||
: filename(file),
|
||||
filetype(ftype),
|
||||
filepath(fpath),
|
||||
size(sz)
|
||||
{
|
||||
upload_date = std::chrono::system_clock::now();
|
||||
|
@ -43,7 +41,6 @@ class Sicccobject {
|
|||
const std::chrono::time_point<std::chrono::system_clock>& date)
|
||||
: filename(file),
|
||||
filetype(ftype),
|
||||
filepath(fpath),
|
||||
size(sz),
|
||||
upload_date(date) { }
|
||||
|
||||
|
@ -54,7 +51,6 @@ class Sicccobject {
|
|||
|
||||
std::string get_filename() const { return filename; }
|
||||
std::string get_filetype() const { return filetype; }
|
||||
std::string get_filepath() const { return filepath; }
|
||||
size_t get_size() const { return size; }
|
||||
std::chrono::time_point<std::chrono::system_clock>
|
||||
get_uploadtime() const { return upload_date; }
|
||||
|
@ -77,7 +73,6 @@ class Sicccobject {
|
|||
private:
|
||||
std::string filename;
|
||||
std::string filetype;
|
||||
std::string filepath;
|
||||
size_t size;
|
||||
std::chrono::time_point<std::chrono::system_clock> upload_date;
|
||||
};
|
||||
|
|
|
@ -12,8 +12,6 @@ Sicccobject::Sicccobject(const json_t *j)
|
|||
filename = SicccPersister::get_string_from_json(val);
|
||||
val = json_object_get(j, "filetype");
|
||||
filetype = SicccPersister::get_string_from_json(val);
|
||||
val = json_object_get(j, "path");
|
||||
filepath = SicccPersister::get_string_from_json(val);
|
||||
val = json_object_get(j, "size");
|
||||
size = SicccPersister::get_integer_from_json(val);
|
||||
val = json_object_get(j, "upload_time");
|
||||
|
@ -25,7 +23,6 @@ Sicccobject::Sicccobject(const Sicccobject& obj)
|
|||
{
|
||||
filename = obj.filename;
|
||||
filetype = obj.filetype;
|
||||
filepath = obj.filepath;
|
||||
size = obj.size;
|
||||
upload_date = obj.upload_date;
|
||||
}
|
||||
|
@ -38,7 +35,6 @@ Sicccobject::operator = (const Sicccobject& obj)
|
|||
|
||||
this->filename = obj.filename;
|
||||
this->filetype = obj.filetype;
|
||||
this->filepath = obj.filepath;
|
||||
this->size = obj.size;
|
||||
this->upload_date = obj.upload_date;
|
||||
|
||||
|
@ -52,7 +48,6 @@ operator << (std::ostream& out, const Sicccobject& obj)
|
|||
std::chrono::system_clock::to_time_t(obj.get_uploadtime());
|
||||
out << "[Filename] " << obj.get_filename() << std::endl
|
||||
<< "[Filetype] " << obj.get_filetype() << std::endl
|
||||
<< "[Path] " << obj.get_filepath() << std::endl
|
||||
<< "[Size] " << obj.get_size() << std::endl
|
||||
<< "[Uploaded] " << std::ctime(&time) << std::endl;
|
||||
return out;
|
||||
|
|
Loading…
Reference in New Issue