From 0267ede2d356abdef7b3e9af19d4725605a58947 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 20 Jan 2011 15:38:10 +0200 Subject: Add support for multiple file options and file search callbacks --- cli/runtime-inline.cxx | 43 +++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 41 insertions(+), 2 deletions(-) (limited to 'cli/runtime-inline.cxx') diff --git a/cli/runtime-inline.cxx b/cli/runtime-inline.cxx index 633d7db..4d95a78 100644 --- a/cli/runtime-inline.cxx +++ b/cli/runtime-inline.cxx @@ -189,11 +189,15 @@ generate_runtime_inline (context& ctx) << "const std::string& option," << endl << "bool erase)" << endl << ": argv_scanner (argc, argv, erase)," << endl - << " option_ (option)"; + << " option_ (option)," << endl + << " options_ (&option_info_)," << endl + << " options_count_ (1)"; if (sep) os << "," << endl << " skip_ (false)"; os << "{" + << "option_info_.option = option_.c_str ();" + << "option_info_.search_func = 0;" << "}"; os << inl << "argv_file_scanner::" << endl @@ -203,7 +207,42 @@ generate_runtime_inline (context& ctx) << "const std::string& option," << endl << "bool erase)" << endl << ": argv_scanner (start, argc, argv, erase)," << endl - << " option_ (option)"; + << " option_ (option)," << endl + << " options_ (&option_info_)," << endl + << " options_count_ (1)"; + if (sep) + os << "," << endl + << " skip_ (false)"; + os << "{" + << "option_info_.option = option_.c_str ();" + << "option_info_.search_func = 0;" + << "}"; + + os << inl << "argv_file_scanner::" << endl + << "argv_file_scanner (int& argc," << endl + << "char** argv," << endl + << "const option_info* options," << endl + << "std::size_t options_count," << endl + << "bool erase)" << endl + << ": argv_scanner (argc, argv, erase)," << endl + << " options_ (options)," << endl + << " options_count_ (options_count)"; + if (sep) + os << "," << endl + << " skip_ (false)"; + os << "{" + << "}"; + + os << inl << "argv_file_scanner::" << endl + << "argv_file_scanner (int start," << endl + << "int& argc," << endl + << "char** argv," << endl + << "const option_info* options," << endl + << "std::size_t options_count," << endl + << "bool erase)" << endl + << ": argv_scanner (start, argc, argv, erase)," << endl + << " options_ (options)," << endl + << " options_count_ (options_count)"; if (sep) os << "," << endl << " skip_ (false)"; -- cgit v1.1