Added indent parameter to ParserKeyword::inlineNew() to beautify generated cpp source

This commit is contained in:
Joakim Hove
2013-09-14 22:14:58 +02:00
parent ccac972d6c
commit 79a59fc629
6 changed files with 14 additions and 13 deletions

View File

@@ -40,10 +40,11 @@ void inlineKeyword(const boost::filesystem::path& file , std::ofstream& of) {
if (ParserKeyword::validName(keyword)) {
Json::JsonObject jsonKeyword(file);
ParserKeywordConstPtr parserKeyword(new ParserKeyword(jsonKeyword));
std::string indent(" ");
of << "{" << std::endl;
of << "ParserKeyword *";
parserKeyword->inlineNew(of , keyword);
of << "addKeyword( ParserKeywordConstPtr(" << keyword << "));" << std::endl;
of << indent << "ParserKeyword *";
parserKeyword->inlineNew(of , keyword , indent);
of << indent << "addKeyword( ParserKeywordConstPtr(" << keyword << "));" << std::endl;
of << "}" << std::endl << std::endl;
}
}