#include "Support.hpp"
#include <memory>
#include <cassert>
#include <fstream>
#include <stdexcept>
Go to the source code of this file.
◆ make_ui()
std::unique_ptr< UI > make_ui |
( |
const Cmdline & |
cmdargs | ) |
|
Definition at line 61 of file Support.cpp.
62{
63 auto iocfg = std::make_unique<UI>();
64
65 auto in = open_fstream<std::ifstream>(cmdargs.
get_or(0,
"-"), std::ios::in | std::ios::binary);
66 iocfg->in(std::move(in));
67
68 auto out = open_fstream<std::ofstream>(cmdargs.
get_or(1,
"-"), std::ios::out | std::ios::binary);
69 iocfg->out(std::move(out));
70
71 return iocfg;
72}
std::string get_or(unsigned int index, const std::string &) const
References Cmdline::get_or().