git-svn-id: svn://db.shs.com.ru/pip@323 12ceb7fc-bf1f-11e4-8940-5bc7170c53b5

This commit is contained in:
2017-03-28 11:35:52 +00:00
parent 922f30e39e
commit f9b50e84b5
3 changed files with 74 additions and 36 deletions

View File

@@ -153,7 +153,7 @@ void makeClassStreamHeader(PIFile & f, const PICodeParser::Entity * e) {
}
void writeModel(PICodeParser & parser, const PIString out, bool meta, bool enums, bool streams, bool texts) {
void writeModel(PICodeParser & parser, PICLI & cli, const PIString out, bool meta, bool enums, bool streams, bool texts) {
PIVector<const PICodeParser::Entity * > ventities;
PIString defname = out.replaceAll(".", "_").replaceAll("/", "_").replaceAll(":", "_").replaceAll("-", "_").toUpperCase() + "_H";
@@ -259,7 +259,11 @@ void writeModel(PICodeParser & parser, const PIString out, bool meta, bool enums
f.setPath(out + ".h");
f.clear();
f.open(PIIODevice::WriteOnly);
f << "// Generated by \"PIP Code model generator\" " << PIDateTime::current().toString("dd.MM.yyyy hh:mm:ss\n\n");
f << "// Generated by \"PIP Code model generator\" " << PIDateTime::current().toString("dd.MM.yyyy hh:mm:ss\n");
f << "// Execute command:\n";
piForeachC (PIString & _a, cli.rawArguments())
f << "// \"" << _a << "\"\n";
f << "\n";
f << "#ifndef " << defname << "\n#define " << defname << "\n\n";
f << "#include \"pivariant.h\"\n#include \"picodeinfo.h\"";
/*
@@ -322,10 +326,10 @@ int main(int argc, char * argv[]) {
piCout << Cyan << Bold << "Parsing done";
piCout << Cyan << Bold << "Writing code model ...";
bool all = cli.hasArgument("All");
writeModel(parser, cli.argumentValue("output"), cli.hasArgument("Metainfo") || all,
cli.hasArgument("Enum") || all,
cli.hasArgument("Stream") || all,
cli.hasArgument("Text") || all);
writeModel(parser, cli, cli.argumentValue("output"), cli.hasArgument("Metainfo") || all,
cli.hasArgument("Enum") || all,
cli.hasArgument("Stream") || all,
cli.hasArgument("Text") || all);
piCout << Cyan << Bold << "Writing done";
if (cli.hasArgument("print") || cli.hasArgument("Print")) {
bool womain = cli.hasArgument("print");