#include <xtd/io/file_info>
#include <xtd/io/path>
#include <xtd/console>
#include <xtd/startup>
#include <xtd/using>
class program {
public:
static auto main() {
auto path = path::get_temp_file_name();
sw.write_line("Hello");
sw.write_line("And");
sw.write_line("Welcome");
}
while (!sr.end_of_stream())
console::write_line(sr.read_line());
}
try {
auto path2 = path::get_temp_file_name();
console::write_line(
"{} was copied to {}.",
path, path2);
console::write_line("{} was successfully deleted.", path2);
console::write_line("The process failed: {}", e.to_string());
}
}
};
Provides static methods for the creation, copying, deletion, moving, and opening of files,...
Definition file_info.h:39
xtd::io::stream_reader open_text() const
Creates a xtd::io::stream_reader that reads from an existing text file.
xtd::io::file_info copy_to(const xtd::ustring &dest_file_name) const
Copies an existing file to a new file, disallowing the overwriting of an existing file.
xtd::io::stream_writer create_text() const
Creates a std::ofstream that writes a new text file.
void remove() const override
Permanently deletes a file.
Performs operations on std::basic_string instances that contain file or directory path information....
Definition path.h:34
Defines the base class for predefined exceptions in the xtd namespace.
Definition system_exception.h:25
#define startup_(main_method)
Defines the entry point to be called when the application loads. Generally this is set either to the ...
Definition startup.h:166
#define using_(...)
The specified expression is cleared automatically when the scope is ended.
Definition using.h:33
The xtd::io namespace contains types that allow reading and writing to files and data streams,...
Definition binary_reader.h:16
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition xtd_about_box.h:10