Show how to use xtd::io::file_info::open_read method.
#include <xtd/xtd>
class program {
public:
static auto main() {
auto path = "MyTest.txt";
auto fi = file_info {path};
using_(
auto fs = fi.create()) {
auto sw = stream_writer {fs};
sw.write_line("This is some text in the file.");
}
using_(
auto fs = fi.open_read()) {
auto sr = stream_reader {fs};
while (!sr.end_of_stream())
console::write_line(sr.read_line());
}
}
};
#define startup_(main_method)
Defines the entry point to be called when the application loads. Generally this is set either to the ...
Definition startup.hpp:282
#define using_(...)
The specified expression is cleared automatically when the scope is ended.
Definition using.hpp:33