move to PIIOTextStream
This commit is contained in:
@@ -20,6 +20,7 @@
|
||||
#include "parser.h"
|
||||
#include "generator.h"
|
||||
#include "picli.h"
|
||||
#include "piiostream.h"
|
||||
|
||||
using namespace PICoutManipulators;
|
||||
|
||||
@@ -76,12 +77,16 @@ int main (int argc, char * argv[]) {
|
||||
if (!out_file.isEmpty()) {
|
||||
if (outf.open(out_file, PIIODevice::ReadWrite)) {
|
||||
outf.clear();
|
||||
} else piCout << "Error: can`t open out file";
|
||||
outf << "// Generated by \"PIP Resources Compiler\" " << PIDateTime::current().toString("dd.MM.yyyy hh:mm:ss\n");
|
||||
outf << "// Execute command:\n";
|
||||
} else {
|
||||
piCout << "Error: can`t open out file" << out_file;
|
||||
return 1;
|
||||
}
|
||||
PIIOTextStream ts(&outf);
|
||||
ts << "// Generated by \"PIP Resources Compiler\" " << PIDateTime::current().toString("dd.MM.yyyy hh:mm:ss\n");
|
||||
ts << "// Execute command:\n";
|
||||
piForeachC (PIString & _a, cli.rawArguments())
|
||||
outf << "// \"" << _a << "\"\n";
|
||||
outf << "\n";
|
||||
ts << "// \"" << _a << "\"\n";
|
||||
ts << "\n";
|
||||
if (!generate(init_name, outf, files)) {
|
||||
piCout << "Error: generate fail";
|
||||
return 1;
|
||||
|
||||
Reference in New Issue
Block a user