From 8c1e0035404050376350d5e9b9242f5d39a6b53e Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Sat, 27 Jul 2019 17:28:27 +0200 Subject: Add support for direct file loading with argv_file_scanner --- cli/runtime-inline.cxx | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) (limited to 'cli/runtime-inline.cxx') diff --git a/cli/runtime-inline.cxx b/cli/runtime-inline.cxx index 18c5889..3a62db8 100644 --- a/cli/runtime-inline.cxx +++ b/cli/runtime-inline.cxx @@ -324,6 +324,24 @@ generate_runtime_inline (context& ctx) << "}"; os << inl << "argv_file_scanner::" << endl + << "argv_file_scanner (const std::string& file," << endl + << "const std::string& option)" << endl + << ": argv_scanner (0, zero_argc_, 0)," << endl + << " option_ (option)," << endl + << " options_ (&option_info_)," << endl + << " options_count_ (1)," << endl + << " i_ (1)"; + if (sep) + os << "," << endl + << " skip_ (false)"; + os << "{" + << "option_info_.option = option_.c_str ();" + << "option_info_.search_func = 0;" + << endl + << "load (file);" + << "}"; + + os << inl << "argv_file_scanner::" << endl << "argv_file_scanner (int& argc," << endl << "char** argv," << endl << "const option_info* options," << endl @@ -355,6 +373,21 @@ generate_runtime_inline (context& ctx) << " skip_ (false)"; os << "{" << "}"; + + os << inl << "argv_file_scanner::" << endl + << "argv_file_scanner (const std::string& file," << endl + << "const option_info* options," << endl + << "std::size_t options_count)" << endl + << ": argv_scanner (0, zero_argc_, 0)," << endl + << " options_ (options)," << endl + << " options_count_ (options_count)," << endl + << " i_ (1)"; + if (sep) + os << "," << endl + << " skip_ (false)"; + os << "{" + << "load (file);" + << "}"; } // group_scanner -- cgit v1.1