From 7e2fb834d8ba2eb3fd6453f135d3e8ef30c852c6 Mon Sep 17 00:00:00 2001 From: Trygve Laugstøl Date: Sun, 21 Jun 2015 00:53:28 +0200 Subject: o Using ends_with when checking for which app to launch too. sm-get-value: o Using the io code for writing samples --- apps/generate.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'apps/generate.cpp') diff --git a/apps/generate.cpp b/apps/generate.cpp index f0bf0fd..ca6f8de 100644 --- a/apps/generate.cpp +++ b/apps/generate.cpp @@ -18,7 +18,9 @@ int main(int argc, char *argv[]) { } out << "#pragma once" << endl + << endl << "#include " << endl + << "#include " << endl << endl; vector> apps; @@ -45,7 +47,7 @@ int main(int argc, char *argv[]) { bool first = true; out << "template" << endl - << "int launch_app(int argc, const char *argv[]);" + << "int launch_app(int argc, const char *argv[]);" << endl << endl; out << "int launch(const std::string app_name, int argc, const char *argv[]) {" << endl; @@ -58,7 +60,7 @@ int main(int argc, char *argv[]) { first = false; } - out << "if (app_name == \"" << pair.first << "\") {" << endl + out << "if (boost::ends_with(app_name, \"" << pair.first << "\")) {" << endl << " return launch_app<" << pair.second << ">(argc, argv);" << endl; }); -- cgit v1.2.3