Run pre-commit on files

This commit is contained in:
realaltffour 2020-04-05 14:54:23 +03:00
parent 5eae19af68
commit 63ad0d6ba1
No known key found for this signature in database
GPG Key ID: 05B35E2E8F56C5A6
12 changed files with 18761 additions and 19678 deletions

View File

@ -1,11 +1,7 @@
#include "data.h"
void to_json(json& j, const Date& date) {
j = json{
{"day", date.day},
{"month", date.day},
{"year", date.year}
};
j = json{{"day", date.day}, {"month", date.day}, {"year", date.year}};
}
void from_json(const json& j, Date& date) {
j.at("day").get_to(date.day);
@ -13,15 +9,13 @@ void from_json(const json& j, Date& date) {
j.at("year").get_to(date.year);
}
void to_json(json& j, const Project& proj) {
j = json{
{"name", proj.name},
j = json{{"name", proj.name},
{"desc", proj.desc},
{"uuid", proj.uuid},
{"pri", proj.pri},
{"creationDate", proj.creationDate},
{"doneDate", proj.doneDate},
{"isDone", proj.isDone}
};
{"isDone", proj.isDone}};
}
void from_json(const json& j, Project& proj) {
j.at("name").get_to(proj.name);
@ -43,11 +37,9 @@ void from_json(const json& j, Skid& skid) {
j.at("creationDate").get_to(skid.creationDate);
}
void to_json(json& j, const DB& db) {
j = json{
{"projects", *db.projects},
j = json{{"projects", *db.projects},
{"creationDate", db.creationDate},
{"lastAccessTime", db.lastAccessTime}
};
{"lastAccessTime", db.lastAccessTime}};
}
void from_json(const json& j, DB& db) {
j.at("projects").get_to(*db.projects);
@ -55,7 +47,6 @@ void from_json(const json& j, DB& db) {
j.at("lastAccessTime").get_to(db.lastAccessTime);
}
void writeDB(DB db, const std::string& dest) {
try {
std::ofstream f(dest);

View File

@ -7,7 +7,9 @@
#include "module.h"
#include "modules/init.h"
Module* get_Mod(std::string name) {return nullptr;};
Module* get_Mod(std::string name) {
return nullptr;
};
void dispatch_Mod(Module* mod, std::string args){};
int main(int argc, const char* argv[]) {
@ -54,15 +56,14 @@ int main(int argc, const char* argv[]) {
if(vm.count("module-args")) {
auto args = vm["module-args"].as<string>();
dispatch_Mod(module, args);
} else dispatch_Mod(module, "");
} else
dispatch_Mod(module, "");
} else {
std::cout << general << "\n";
exit(0);
}
} catch (const error& ex) {
cerr << ex.what() << '\n';
}
} catch(const error& ex) { cerr << ex.what() << '\n'; }
return 0;
}

10379
vendor/json.hpp vendored

File diff suppressed because it is too large Load Diff