11 #include "../core_export.h" 12 #include "../date_time.h" 13 #include "../static.h" 14 #include "../ustring.h" 46 template<
typename type_t>
49 for (
const auto& line : contents)
60 template<
typename type_t>
63 for (
const auto& line : contents)
73 template<
typename type_t>
115 static std::ofstream create_text(
const xtd::ustring& path);
182 static std::fstream open(
const xtd::ustring& path, std::ios::openmode mode);
189 static std::ifstream open_read(
const xtd::ustring& path);
196 static std::ifstream open_text(
const xtd::ustring& path);
203 static std::ofstream open_write(
const xtd::ustring& path);
211 static std::vector<uint8_t> read_all_bytes(
const xtd::ustring& path);
219 template<
typename char_t>
227 static std::vector<xtd::ustring> read_all_lines(
const xtd::ustring& path);
257 template<
typename type_t>
260 for (
const auto& line : contents)
271 template<
typename type_t>
274 for (
const auto& line : contents)
284 template<
typename type_t>
295 static std::ofstream write_text(
const xtd::ustring& path);
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:220
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:38
file_attributes
Provides attributes for files and directories.
Definition: file_attributes.h:20
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:272
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:34
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:50
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:74
Performs operations on std::basic_string instances that contain file or directory path information...
Definition: path.h:32
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:258
Represents an instant in time, typically expressed as a date and time of day.
Definition: date_time.h:71
Implements a xtd::io::text_writer for writing characters to a stream.
Definition: stream_writer.h:25
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:285
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:47
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:61
Contains xtd::io::stream_reader class.