BIG deep clean

This commit is contained in:
2020-06-10 13:14:16 +03:00
parent f579718e0b
commit c59579d5d5
222 changed files with 2392 additions and 11600 deletions

View File

@@ -365,52 +365,6 @@ void writeModel(PICodeParser & parser, PICLI & cli, const PIString out, bool met
f << "#include \"" << out << ".h\"\n";
if (inc_cpp) f << inc_string;
f << "\nusing namespace PICodeInfo;\n\n";
/*
PIString entry, argtype, rettype, args;
piForeachC (PICodeParser::Entity * e, parser.entities) {
if (e->name.find("::") >= 0 || e->name.startsWith("_PI")) continue;
entry.clear();
entry << "\nPIVariant execFunction(" << e->name << " * object, const char * function, const PIVariant & arg0, const PIVariant & arg1, const PIVariant & arg2, const PIVariant & arg3) {\n";
const PIVector<PICodeParser::Member> & fl(e->functions);
bool efunc = true;
piForeachC (PICodeParser::Member & m, fl) {
if (m.name.startsWith("__stat") || m.attributes[PICodeParser::Static]) continue;
//piCout << e->name << m.name << m.visibility;
args.clear();
rettype = m.type;
if (rettype.startsWith("const") && rettype.endsWith("&"))
rettype.cutLeft(5).cutRight(1).trim();
if (rettype.endsWith("&")) continue;
bool aok = true, ret = (m.type != "void");
if (m.arguments_full.size() > 4 || m.visibility != PICodeParser::Public) continue;
for (int i = 0; i < m.arguments_full.size_s(); ++i) {
if (i > 0) args << ", ";
argtype = m.arguments_type[i];
if (argtype.startsWith("const") && argtype.endsWith("&"))
argtype.cutLeft(5).cutRight(1).trim();
if (argtype.endsWith("&")) {
aok = false;
continue;
}
//entry << "(" << m.arguments_type[i] << ")";
//if (parser.isEnum(m.arguments_type[i])) entry << "(int)";
args << "arg" << i << ".toValue<" << argtype << " >()";
}
if (!aok) continue;
efunc = false;
entry << "\tif (strcmp(function, \"" << m.name << "\") == 0) {";
if (ret) entry << "return PIVariant::fromValue<" << rettype << " >(";
entry << "object->" << m.name << "(" << args << ")";
if (ret) entry << ");";
else entry << "; return PIVariant();";
entry << "}\n";
}
if (efunc) continue;
f << entry << "\tPICout(PICoutManipulators::AddNewLine) << \"Can`t find function \\\"\" << function << \"\\\" in "
<< e->type << " \\\"" << e->name << "\\\"!\";\n\treturn PIVariant();\n}\n";
ventities << e;
}
*/
if (meta || enums || getters) {
if (getters) {
@@ -476,16 +430,6 @@ void writeModel(PICodeParser & parser, PICLI & cli, const PIString out, bool met
f << "#ifndef " << defname << "\n#define " << defname << "\n\n";
f << "#include \"pivariant.h\"\n#include \"picodeinfo.h\"";
if (inc_h) f << inc_string;
/*
f << "\n\n";
piForeachC (PICodeParser::Entity * e, ventities)
f << e->type << " " << e->name << ";\n";
f << "\n";
piForeachC (PICodeParser::Entity * e, ventities) {
f << "\nPIVariant execFunction(" << e->name << " * object, const char * function, const PIVariant & arg0 = PIVariant(), \
const PIVariant & arg1 = PIVariant(), const PIVariant & arg2 = PIVariant(), const PIVariant & arg3 = PIVariant());";
}
*/
if (streams) {
f << "\n\n// Stream operators\n";
piForeachC (PICodeParser::Entity * e, parser.entities) {