MCPcopy Create free account
hub / github.com/daniele77/cli / CliFileSession

Method CliFileSession

include/cli/clifilesession.h:45–58  ·  view source on GitHub ↗

@throw std::invalid_argument if @c _in or @c out are invalid streams

Source from the content-addressed store, hash-verified

43public:
44 /// @throw std::invalid_argument if @c _in or @c out are invalid streams
45 explicit CliFileSession(Cli& _cli, std::istream& _in=std::cin, std::ostream& _out=std::cout) :
46 CliSession(_cli, _out, 1),
47 exit(false),
48 in(_in)
49 {
50 if (!_in.good()) throw std::invalid_argument("istream invalid");
51 if (!_out.good()) throw std::invalid_argument("ostream invalid");
52 ExitAction(
53 [this](std::ostream&) noexcept
54 {
55 exit = true;
56 }
57 );
58 }
59 void Start()
60 {
61 Enter();

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected