diff options
author | Trygve Laugstøl <trygvis@inamo.no> | 2015-06-21 00:53:28 +0200 |
---|---|---|
committer | Trygve Laugstøl <trygvis@inamo.no> | 2015-06-21 00:55:21 +0200 |
commit | 7e2fb834d8ba2eb3fd6453f135d3e8ef30c852c6 (patch) | |
tree | 166f6400567834834442d6b167cc42f1d58a57b2 /apps/generate.cpp | |
parent | c56840f03cf139d60c6d90b55cf16e70f6ae2bc2 (diff) | |
download | ble-toys-7e2fb834d8ba2eb3fd6453f135d3e8ef30c852c6.tar.gz ble-toys-7e2fb834d8ba2eb3fd6453f135d3e8ef30c852c6.tar.bz2 ble-toys-7e2fb834d8ba2eb3fd6453f135d3e8ef30c852c6.tar.xz ble-toys-7e2fb834d8ba2eb3fd6453f135d3e8ef30c852c6.zip |
o Using ends_with when checking for which app to launch too.
sm-get-value:
o Using the io code for writing samples
Diffstat (limited to 'apps/generate.cpp')
-rw-r--r-- | apps/generate.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
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 <string>" << endl + << "#include <boost/algorithm/string/predicate.hpp>" << endl << endl; vector<pair<string, string>> apps; @@ -45,7 +47,7 @@ int main(int argc, char *argv[]) { bool first = true; out << "template<typename App>" << 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; }); |