Lines Matching +full:stdout +full:- +full:path
37 #include "utils/fs/path.hpp"
46 /// Constant that represents the path to stdout.
47 static const fs::path stdout_path("/dev/stdout");
50 /// Constant that represents the path to stderr.
51 static const fs::path stderr_path("/dev/stderr");
57 /// Opens a new file for output, respecting the stdout and stderr streams.
59 /// \param path The path to the output file to be created.
63 utils::open_ostream(const fs::path& path) in open_ostream() argument
66 if (path == stdout_path) { in open_ostream()
68 out->copyfmt(std::cout); in open_ostream()
69 out->clear(std::cout.rdstate()); in open_ostream()
70 out->rdbuf(std::cout.rdbuf()); in open_ostream()
71 } else if (path == stderr_path) { in open_ostream()
73 out->copyfmt(std::cerr); in open_ostream()
74 out->clear(std::cerr.rdstate()); in open_ostream()
75 out->rdbuf(std::cerr.rdbuf()); in open_ostream()
77 out.reset(new std::ofstream(path.c_str())); in open_ostream()
79 throw std::runtime_error(F("Cannot open output file %s") % path); in open_ostream()
115 /// \param path The file to read.
121 utils::read_file(const fs::path& path) in read_file() argument
123 std::ifstream input(path.c_str()); in read_file()
125 throw std::runtime_error(F("Failed to open '%s' for read") % path); in read_file()