Fix variable names start with underscore

This commit is contained in:
realaltffour 2020-03-29 12:50:37 +03:00
parent 76d3fd6a93
commit 4e98676a18
No known key found for this signature in database
GPG Key ID: 05B35E2E8F56C5A6
4 changed files with 31 additions and 32 deletions

View File

@ -6,7 +6,6 @@
#include <ctime>
#include <map>
#include <boost/uuid/uuid.hpp>
#include <boost/uuid/uuid_generators.hpp>
#include <boost/uuid/uuid_io.hpp>
@ -18,17 +17,17 @@
/////////////// DATA CONTAINING STRUCTURES ///////////////////
struct Project {
std::string _name = "";
std::string _desc = "";
boost::uuids::uuid _uuid;
int _preferredPrior = 0;
time_t _creationDate;
bool _isDone = false;
std::string name = "";
std::string desc = "";
boost::uuids::uuid uuid;
int preferredPrior = 0;
time_t creationDate;
bool isDone = false;
};
struct Skid {
std::vector<Project*> _projects = {};
time_t _creationDate;
std::vector<Project*> projects = {};
time_t creationDate;
};
/////////////// END OF DATA CONTAINING STRUCTURES ////////////
@ -44,24 +43,24 @@ enum EventType {
};
struct Event {
int _id = -1;
EventType _type = EventType::None;
std::string _mesg = "";
int id = -1;
EventType type = EventType::None;
std::string mesg = "";
};
struct EventLog {
std::vector<Event> _events;
std::string _sha512 = "";
std::vector<Event> events;
std::string sha512 = "";
};
/////////////// EVENT END OF HISTORY SYSTEM STRUCTURES /////////////
struct DB {
std::map<std::string, Project> _projects;
EventLog _log;
time_t _creationDate;
time_t _lastAccessTime;
std::map<std::string, Project> projects;
EventLog log;
time_t creationDate;
time_t lastAccessTime;
};
#endif

View File

@ -12,7 +12,7 @@ int main(int argc, const char* argv[]) {
using namespace boost::program_options;
using namespace std;
std::map<string, Module*> lmodules;
lmodules["init"] = new modules::init::_mod;
lmodules["init"] = new modules::init::mod;
try {
options_description general("General Options");
@ -44,7 +44,7 @@ int main(int argc, const char* argv[]) {
exit(1);
}
auto module = lmodules[name];
std::cout << module->_desc << "\n";
std::cout << module->desc << "\n";
}
else if (vm.count("module")) {
auto name = vm["module"].as<string>();

View File

@ -15,27 +15,27 @@
#define MODDISPATCHFNSIG() \
virtual void dispatch(std::string arguments) = 0;
#define MODDISPATCHFNIMPL(code) \
void _mod::dispatch(std::string arguments) {code}
void mod::dispatch(std::string arguments) {code}
#define MODDISPATCHFN() \
void dispatch(std::string arguments) override;
#define MODARGS(code) \
struct _args {code}
struct args {code}
#define MAKEMOD(code) \
struct _mod : _args, Module {code}
#define DEFMOD(name, desc) \
_mod() { \
this->_name = name; \
this->_desc = desc; \
struct mod : args, Module {code}
#define DEFMOD(name_, desc_) \
mod() { \
this->name = name_; \
this->desc = desc_; \
} \
using ModuleFn = std::function<void(std::string arguments)>;
using ModuleFnDispatcher = std::function<void(std::string arguments)>;
struct Module {
std::string _name;
std::string _desc;
std::map<std::string, ModuleFn> _funcs;
std::string name;
std::string desc;
std::map<std::string, ModuleFn> funcs;
MODDISPATCHFNSIG();
};

View File

@ -6,7 +6,7 @@
namespace modules {
namespace init {
MODARGS(
std::string _location;
std::string m_location;
);
MAKEMOD(MODFNSIG(init__create);
MODDISPATCHFN();