10#include "../core_export.h"
12#include "../ustring.h"
36 template<
typename type_t>
39 for (
const auto& line : contents)
50 template<
typename type_t>
53 for (
const auto& line : contents)
63 template<
typename type_t>
172 template<
typename char_t>
210 template<
typename type_t>
213 for (
const auto& line : contents)
224 template<
typename type_t>
227 for (
const auto& line : contents)
237 template<
typename type_t>
Provides static methods for the creation, copying, deletion, moving, and opening of files,...
Definition file.h:27
static std::ifstream open_read(const xtd::ustring &path)
Opens an existing file for reading.
static void move(const xtd::ustring &src, const xtd::ustring &dest)
Moves a specified file to a new location, providing the option to specify a new file name.
static void replace(const xtd::ustring &source_file_name, const xtd::ustring &destination_file_name, const xtd::ustring &destination_backup_file_name)
Replaces the contents of a specified file with the contents of another file, deleting the original fi...
static void append_all_text(const xtd::ustring &path, type_t text)
Appends text to a file, and then closes the file. If the specified file does not exist,...
Definition file.h:64
static void write_all_lines(const xtd::ustring &path, type_t contents)
Writes lines to a file, and then closes the file. If the specified file does not exist,...
Definition file.h:211
static std::vector< uint8_t > read_all_bytes(const char_t *path)
Opens a binary file, reads the contents of the file into a byte array, and then closes the file.
Definition file.h:173
static std::ofstream write_text(const xtd::ustring &path)
Creates a std::ofstream that appends text to an existing file.
static void remove(const xtd::ustring &path)
Deletes the specified file.
static std::fstream open(const xtd::ustring &path, std::ios::openmode mode)
Opens a FileStream on the specified path.
static void copy(const xtd::ustring &src, const xtd::ustring &dest, bool overwrite)
Copies an existing file to a new file. Overwriting a file of the same name is allowed.
static std::ofstream create_text(const xtd::ustring &path)
Creates or opens a file for writing text.
static void append_all_lines(const xtd::ustring &path, const std::initializer_list< type_t > &contents)
Appends lines to a file, and then closes the file. If the specified file does not exist,...
Definition file.h:51
static std::ofstream open_write(const xtd::ustring &path)
Opens an existing file for writing.
static void write_all_lines(const xtd::ustring &path, const std::initializer_list< type_t > &contents)
Writes lines to a file, and then closes the file. If the specified file does not exist,...
Definition file.h:225
static std::ifstream open_text(const xtd::ustring &path)
Opens an existing file for reading.
static void append_all_lines(const xtd::ustring &path, type_t contents)
Appends lines to a file, and then closes the file. If the specified file does not exist,...
Definition file.h:37
static void write_all_text(const xtd::ustring &path, type_t text)
Writes text to a file, and then closes the file. If the specified file does not exist,...
Definition file.h:238
static void copy(const xtd::ustring &src, const xtd::ustring &dest)
Copies an existing file to a new file. Overwriting a file of the same name is not allowed.
static xtd::io::file_attributes get_attributes(const xtd::ustring &src)
Gets the xtd::io::file_attributes of the file on the path.
static xtd::ustring read_all_text(const xtd::ustring &path)
Opens a text file, reads all text of the file, and then closes the file.
static std::vector< uint8_t > read_all_bytes(const xtd::ustring &path)
Opens a binary file, reads the contents of the file into a byte array, and then closes the file.
static std::ofstream create(const xtd::ustring &path)
Creates or overwrites a file in the specified path.
static std::vector< xtd::ustring > read_all_lines(const xtd::ustring &path)
Opens a text file, reads all lines of the file, and then closes the file.
static bool exists(const xtd::ustring &path) noexcept
Determines whether the specified file exists.
static std::ofstream append_text(const xtd::ustring &path)
Creates a std::ofstream that appends text to an existing file.
Performs operations on std::basic_string instances that contain file or directory path information....
Definition path.h:29
Implements a xtd::io::text_writer for writing characters to a stream.
Definition stream_writer.h:20
void write(const xtd::ustring &value) override
Writes the specified string value to the text stream.
void write_line()
Writes new line to the text stream.
Represents text as a sequence of UTF-8 code units.
Definition ustring.h:48
Contains xtd::io::file_attributes enum class.
#define static_
This keyword is use to represent a static object. A static object can't be instantiated (constructors...
Definition static.h:38
#define core_export_
Define shared library export.
Definition core_export.h:13
file_attributes
Provides attributes for files and directories.
Definition file_attributes.h:17
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition system_report.h:17
Contains xtd::io::stream_reader class.
Contains xtd::io::stream_writer class.