
#include "Util/StringUtil.H"#include "Util/log.H"#include <string>

Go to the source code of this file.
Functions | |
| template<class Factory > | |
| Factory::ProductType | parseStreamArg (const std::string &arg, std::string &extrainfo, const Factory *typeFactory, const Factory *extFactory) |
| Parse a command-line arg and return a product from the appropriate factory. | |
Definition in file ParseArg.H.
| Factory::ProductType parseStreamArg | ( | const std::string & | arg, | |
| std::string & | extrainfo, | |||
| const Factory * | typeFactory, | |||
| const Factory * | extFactory | |||
| ) | [inline] |
Parse a command-line arg and return a product from the appropriate factory.
This is where all of the parsing of --in, --out, and --io options happens. In principle, it is a simple procedure, looking for formats of the form type:spec, except it's not simple because we also implement a number of special cases to allow for less verbose command-line options. The algorithm is like this:
(1) if we find a colon, then we split 'type:spec' on the colon and we're done.
(2) With no colon, we try to see if we can infer that the user has passed either a bare 'type' or a bare 'spec', as follows:
(3) Check if it's a bare 'spec' -- see if there is a filename extension that we recognize and for which we can guess an appropriate FrameIstream type; if so, we're done.
(4) Check if it's a bare 'type', one of the particular type names that we know; if so, we're done.
(5) Give up with an LFATAL() -- in particular, we DON'T try to do some default option, which could cause a future backward compatibility headache.
Note that the sets of known types and filename extensions are set up in makeFrameIstream() and makeFrameOstream() below; if you want to add a new FrameIstream or FrameOstream type, you should add it to one of those functions.
Definition at line 78 of file ParseArg.H.
References stdLineWrap().
Referenced by makeFrameIstream(), and makeFrameOstream().
1.6.3