29 Cmdline(
int argc,
const char *
const *argv) : _argc(static_cast<unsigned int>(argc)), _argv{argv}
34 std::string
get(
unsigned int index)
const;
35 std::string
get_or(
unsigned int index,
const std::string &)
const;
39 const char *
const *_argv;
45 std::istream *
in()
const {
return _in ? _in.get() : &std::cin; }
46 std::ostream *
out()
const {
return _out ? _out.get() : &std::cout; }
49 void in(std::unique_ptr<std::istream> &&
in) { _in = std::move(
in); }
50 void out(std::unique_ptr<std::ostream> &&
out) { _out = std::move(
out); }
53 std::unique_ptr<std::istream> _in;
54 std::unique_ptr<std::ostream> _out;
Cmdline(int argc, const char *const *argv)
std::string get(unsigned int index) const
std::string get_or(unsigned int index, const std::string &) const
void out(std::unique_ptr< std::ostream > &&out)
std::ostream * out() const
std::istream * in() const
void in(std::unique_ptr< std::istream > &&in)
std::unique_ptr< UI > make_ui(const Cmdline &cmdargs)