class CommandLine
Defined at line 57 of file ../../src/lib/fxl/command_line.h
Class that stores processed command lines ("argv[0]", options, and positional
arguments) and provides access to them. For more details, see the file-level
comment above. This class is thread-safe.
Public Methods
void CommandLine ()
Default, copy, and move constructors (to be out-of-lined).
Defined at line 16 of file ../../src/lib/fxl/command_line.cc
void CommandLine (const CommandLine & from)
Defined at line 18 of file ../../src/lib/fxl/command_line.cc
void CommandLine (CommandLine && from)
Defined at line 20 of file ../../src/lib/fxl/command_line.cc
void CommandLine (const std::string & argv0, const std::vector<Option> & options, const std::vector<std::string> & positional_args)
Constructs a |CommandLine| from its "components". This is especially useful
for creating a new |CommandLine| based on an existing |CommandLine| (e.g.,
adding options or arguments).
Defined at line 22 of file ../../src/lib/fxl/command_line.cc
void ~CommandLine ()
Defined at line 29 of file ../../src/lib/fxl/command_line.cc
CommandLine & operator= (const CommandLine & from)
Copy and move assignment (to be out-of-lined).
Defined at line 31 of file ../../src/lib/fxl/command_line.cc
CommandLine & operator= (CommandLine && from)
Defined at line 33 of file ../../src/lib/fxl/command_line.cc
bool HasOption (std::string_view name, size_t * index)
Returns true if this command line has the option |name| (and if |index| is
non-null, sets |*index| to the index of the *last* occurrence of the given
option in |options()|) and false if not.
Defined at line 35 of file ../../src/lib/fxl/command_line.cc
bool GetOptionValue (std::string_view name, std::string * value)
Gets the value of the option |name|. Returns true (and sets |*value|) on
success and false (leaving |*value| alone) on failure.
Defined at line 44 of file ../../src/lib/fxl/command_line.cc
std::vector<std::string_view> GetOptionValues (std::string_view name)
Gets all values of the option |name|. Returns all values, which may be
empty if the option is not specified.
Defined at line 52 of file ../../src/lib/fxl/command_line.cc
std::string GetOptionValueWithDefault (std::string_view name, std::string_view default_value)
Gets the value of the option |name|, with a default if the option is not
specified. (Note: This doesn't return a const reference, since this would
make the |default_value| argument inconvenient/dangerous.)
Defined at line 61 of file ../../src/lib/fxl/command_line.cc
bool has_argv0 ()
Defined at line 93 of file ../../src/lib/fxl/command_line.h
const std::string & argv0 ()
Defined at line 94 of file ../../src/lib/fxl/command_line.h
const std::vector<Option> & options ()
Defined at line 95 of file ../../src/lib/fxl/command_line.h
const std::vector<std::string> & positional_args ()
Defined at line 96 of file ../../src/lib/fxl/command_line.h
bool operator== (const CommandLine & other)
Defined at line 98 of file ../../src/lib/fxl/command_line.h
bool operator!= (const CommandLine & other)
Defined at line 103 of file ../../src/lib/fxl/command_line.h