10 #include "../core_export.h" 11 #include "../date_time.h" 12 #include "../static.h" 13 #include "../ustring.h" 49 template<
typename type_t>
52 for (
const auto& line : contents)
63 template<
typename type_t>
66 for (
const auto& line : contents)
76 template<
typename type_t>
118 static std::ofstream create_text(
const xtd::ustring& path);
191 static std::fstream open(
const xtd::ustring& path, std::ios::openmode mode);
198 static std::ifstream open_read(
const xtd::ustring& path);
205 static std::ifstream open_text(
const xtd::ustring& path);
212 static std::ofstream open_write(
const xtd::ustring& path);
220 static std::vector<xtd::byte> read_all_bytes(
const xtd::ustring& path);
228 template<
typename char_t>
236 static std::vector<xtd::ustring> read_all_lines(
const xtd::ustring& path);
329 template<
typename type_t>
332 for (
const auto& line : contents)
343 template<
typename type_t>
346 for (
const auto& line : contents)
356 template<
typename type_t>
367 static std::ofstream write_text(
const xtd::ustring& path);
370 static std::tuple<time_t, time_t, time_t> get_file_times(
const ustring& path);
Contains xtd::io::stream_writer class.
#define static_
This keyword is use to represent a static object. A static object can't be instantiated (constructors...
Definition: static.h:37
file_attributes
Provides attributes for files and directories.
Definition: file_attributes.h:22
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, this method creates a file, writes the specified lines to the file, and then closes the file.
Definition: file.h:344
The xtd namespace contains all fundamental classes to access Hardware, Os, System, and more.
Definition: system_report.h:17
Provides static methods for the creation, copying, deletion, moving, and opening of files...
Definition: file.h:37
Contains xtd::io::file_permissions enum class.
void write(const xtd::ustring &value) override
Writes the specified string value to the text stream.
Represents text as a sequence of UTF-8 code units.
Definition: ustring.h:46
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, this method creates a file, writes the specified lines to the file, and then closes the file.
Definition: file.h:77
Performs operations on std::basic_string instances that contain file or directory path information...
Definition: path.h:34
static std::vector< xtd::byte > 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:229
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, this method creates a file, writes the specified lines to the file, and then closes the file.
Definition: file.h:330
Represents an instant in time, typically expressed as a date and time of day.
Definition: date_time.h:78
Implements a xtd::io::text_writer for writing characters to a stream.
Definition: stream_writer.h:26
Contains xtd::io::file_attributes enum class.
void write_line()
Writes new line to the text stream.
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, this method creates a file, writes the specified lines to the file, and then closes the file.
Definition: file.h:357
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:50
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:64
Contains xtd::io::stream_reader class.
file_permissions
Provides permissions for files and directories.
Definition: file_permissions.h:22