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-header.cxx | 33 ++++++++++++++++++++++++++++++--- 1 file changed, 30 insertions(+), 3 deletions(-) (limited to 'cli/runtime-header.cxx') diff --git a/cli/runtime-header.cxx b/cli/runtime-header.cxx index 1e4941b..41c56c9 100644 --- a/cli/runtime-header.cxx +++ b/cli/runtime-header.cxx @@ -21,6 +21,7 @@ generate_runtime_header (context& ctx) os << "#include " << endl << "#include " << endl + << "#include " << endl << "#include " << endl << endl; @@ -266,13 +267,32 @@ generate_runtime_header (context& ctx) << "public:" << endl << "argv_file_scanner (int& argc," << endl << "char** argv," << endl - << "const std::string& file_option," << endl + << "const std::string& option," << endl << "bool erase = false);" << endl << "argv_file_scanner (int start," << endl << "int& argc," << endl << "char** argv," << endl - << "const std::string& file_option," << endl + << "const std::string& option," << endl + << "bool erase = false);" + << endl + << "struct option_info" + << "{" + << " const char* option;" + << " std::string (*search_func) (const char*, void* arg);" + << " void* arg;" + << "};" + << "argv_file_scanner (int& argc," << endl + << "char** argv," << endl + << "const option_info* options," << endl + << "std::size_t options_count," << endl + << "bool erase = false);" + << 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 = false);" << endl << "virtual bool" << endl @@ -288,12 +308,19 @@ generate_runtime_header (context& ctx) << "skip ();" << endl << "private:" << endl + << "const option_info*" << endl + << "find (const char*) const;" + << endl << "void" << endl - << "load (const char* file);" + << "load (const std::string& file);" << endl << "typedef argv_scanner base;" << endl << "const std::string option_;" + << "option_info option_info_;" + << "const option_info* options_;" + << "std::size_t options_count_;" + << endl << "std::string hold_;" << "std::deque args_;"; -- cgit v1.1