51 template<
class type_t>
54 for (
const auto& line : contents)
65 template<
class type_t>
68 for (
const auto& line : contents)
78 template<
class type_t>
230 template<
class char_t>
331 template<
class type_t>
334 for (
const auto& line : contents)
345 template<
class type_t>
348 for (
const auto& line : contents)
358 template<
class type_t>
372 [[nodiscard]]
static auto get_file_times(
const string&
path) -> std::tuple<std::time_t, std::time_t, std::time_t>;
Contains xtd::array class.
Contains std::chrono::days, std::chrono::weeks, std::chrono::months and std::chrono::years duration t...
Provides methods for creating, manipulating, searching, and sorting arrays, thereby serving as the ba...
Definition array.hpp:64
Represents an instant in time, typically expressed as a date and time of day.
Definition date_time.hpp:83
Provides static methods for the creation, copying, deletion, moving, and opening of files,...
Definition file.hpp:39
static auto open(const xtd::string &path, std::ios::openmode mode) -> std::fstream
Opens a FileStream on the specified path.
static auto open_write(const xtd::string &path) -> std::ofstream
Opens an existing file for writing.
static auto append_all_lines(const xtd::string &path, const std::initializer_list< type_t > &contents) -> void
Appends lines to a file, and then closes the file. If the specified file does not exist,...
Definition file.hpp:66
static auto write_all_lines(const xtd::string &path, const std::initializer_list< type_t > &contents) -> void
Writes lines to a file, and then closes the file. If the specified file does not exist,...
Definition file.hpp:346
static auto write_all_lines(const xtd::string &path, type_t contents) -> void
Writes lines to a file, and then closes the file. If the specified file does not exist,...
Definition file.hpp:332
static auto exists(const xtd::string &path) noexcept -> bool
Determines whether the specified file exists.
static auto copy(const xtd::string &src, const xtd::string &dest, bool overwrite) -> void
Copies an existing file to a new file. Overwriting a file of the same name is allowed.
static auto open_read(const xtd::string &path) -> std::ifstream
Opens an existing file for reading.
static auto create(const xtd::string &path) -> std::ofstream
Creates or overwrites a file in the specified path.
static auto read_all_lines(const xtd::string &path) -> xtd::array< xtd::string >
Opens a text file, reads all lines of the file, and then closes the file.
static auto get_last_access_time(const xtd::string &path) -> xtd::date_time
Returns the date and time the specified file or directory was last accessed.
static auto write_all_text(const xtd::string &path, type_t text) -> void
Writes text to a file, and then closes the file. If the specified file does not exist,...
Definition file.hpp:359
static auto get_permissions(const xtd::string &path) -> xtd::io::file_permissions
Gets the xtd::io::file_permissions of the file on the path.
static auto get_last_write_time(const xtd::string &path) -> xtd::date_time
Returns the date and time the specified file or directory was last written to.
static auto create_text(const xtd::string &path) -> xtd::io::stream_writer
Creates or opens a file for writing text.
static auto set_permissions(const xtd::string &path, xtd::io::file_permissions permissions) -> void
Sets the specified xtd::io::file_permissions of the file on the specified path.
static auto replace(const xtd::string &source_file_name, const xtd::string &destination_file_name, const xtd::string &destination_backup_file_name) -> void
Replaces the contents of a specified file with the contents of another file, deleting the original fi...
static auto append_text(const xtd::string &path) -> std::ofstream
Creates a std::ofstream that appends text to an existing file.
static auto append_all_text(const xtd::string &path, type_t text) -> void
Appends text to a file, and then closes the file. If the specified file does not exist,...
Definition file.hpp:79
static auto write_text(const xtd::string &path) -> xtd::io::stream_writer
Creates a std::ofstream that appends text to an existing file.
static auto read_all_text(const xtd::string &path) -> xtd::string
Opens a text file, reads all text of the file, and then closes the file.
static auto set_last_access_time(const xtd::string &path, const xtd::date_time &last_access_time) -> void
Sets the date and time the specified file was last accessed.
static auto copy(const xtd::string &src, const xtd::string &dest) -> void
Copies an existing file to a new file. Overwriting a file of the same name is not allowed.
static auto set_last_write_time(const xtd::string &path, const xtd::date_time &last_write_time) -> void
Sets the date and time that the specified file was last written to.
static auto append_all_lines(const xtd::string &path, type_t contents) -> void
Appends lines to a file, and then closes the file. If the specified file does not exist,...
Definition file.hpp:52
static auto move(const xtd::string &src, const xtd::string &dest) -> void
Moves a specified file to a new location, providing the option to specify a new file name.
static auto set_creation_time(const xtd::string &path, const xtd::date_time &creation_time) -> void
Sets the date and time the file was created.
static auto set_attributes(const xtd::string &path, xtd::io::file_attributes attributes) -> void
Sets the specified xtd::io::file_attributes of the file on the specified path.
static auto read_all_bytes(const xtd::string &path) -> xtd::array< xtd::byte >
Opens a binary file, reads the contents of the file into a byte array, and then closes the file.
static auto get_attributes(const xtd::string &path) -> xtd::io::file_attributes
Gets the xtd::io::file_attributes of the file on the path.
static auto open_text(const xtd::string &path) -> xtd::io::stream_reader
Opens an existing file for reading.
static auto remove(const xtd::string &path) -> void
Deletes the specified file.
static auto move(const xtd::string &src, const xtd::string &dest, bool overwrite) -> void
Moves a specified file to a new location, providing the options to specify a new file name and to ove...
static auto read_all_bytes(const char_t *path) -> xtd::array< xtd::byte >
Opens a binary file, reads the contents of the file into a byte array, and then closes the file.
Definition file.hpp:231
static auto get_creation_time(const xtd::string &path) -> xtd::date_time
Returns the creation date and time of the specified file or directory.
Performs operations on std::basic_string instances that contain file or directory path information....
Definition path.hpp:37
Implements a xtd::io::text_reader that reads characters from a byte stream.
Definition stream_reader.hpp:28
Implements a xtd::io::text_writer for writing characters to a stream.
Definition stream_writer.hpp:28
auto write(const xtd::string &value) -> void override
Writes the specified string value to the text stream.
auto write_line() -> void
Writes new line to the text stream.
Contains core_export_ keyword.
Contains xtd::date_time class.
Contains xtd::io::file_attributes enum class.
Contains xtd::io::file_permissions enum class.
#define static_
This keyword is use to represent a static object. A static object can't be instantiated (constructors...
Definition static.hpp:37
#define core_export_
Define shared library export.
Definition core_export.hpp:13
xtd::basic_string< char > string
Represents text as a sequence of UTF-8 code units.
Definition __string_definitions.hpp:43
file_attributes
Provides attributes for files and directories.
Definition file_attributes.hpp:24
file_permissions
Provides permissions for files and directories.
Definition file_permissions.hpp:24
The xtd::io namespace contains types that allow reading and writing to files and data streams,...
Definition binary_reader.hpp:17
Contains classes that represent ASCII and Unicode character encodings; abstract base classes for conv...
Definition basic_string_builder.hpp:17
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition abstract_object.hpp:8
Contains xtd::static_object class.
Contains xtd::io::stream_reader class.
Contains xtd::io::stream_writer class.
Contains xtd::string alias.