diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2019-07-27 17:28:27 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2019-07-27 17:28:27 +0200 |
commit | 8c1e0035404050376350d5e9b9242f5d39a6b53e (patch) | |
tree | 1aa609d156a4e0c131caf40c2d070d20b304bdbf /cli/runtime-inline.cxx | |
parent | dca38b27afc25d329fd7a7241095b40e2a1ecae2 (diff) |
Add support for direct file loading with argv_file_scanner
Diffstat (limited to 'cli/runtime-inline.cxx')
-rw-r--r-- | cli/runtime-inline.cxx | 33 |
1 files changed, 33 insertions, 0 deletions
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 |