10#include "../core_export.h"
11#include "../date_time.h"
51 template<
typename type_t>
54 for (
const auto& line : contents)
65 template<
typename type_t>
68 for (
const auto& line : contents)
78 template<
typename type_t>
230 template<
typename char_t>
331 template<
typename type_t>
334 for (
const auto& line : contents)
345 template<
typename type_t>
348 for (
const auto& line : contents)
358 template<
typename type_t>
372 static std::tuple<time_t, time_t, time_t> get_file_times(
const string&
path);
Represents text as a sequence of character units.
Definition basic_string.h:79
Represents an instant in time, typically expressed as a date and time of day.
Definition date_time.h:85
Provides static methods for the creation, copying, deletion, moving, and opening of files,...
Definition file.h:39
static std::ofstream append_text(const xtd::string &path)
Creates a std::ofstream that appends text to an existing file.
static void copy(const xtd::string &src, const xtd::string &dest, bool overwrite)
Copies an existing file to a new file. Overwriting a file of the same name is allowed.
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:231
static void append_all_lines(const xtd::string &path, type_t contents)
Appends lines to a file, and then closes the file. If the specified file does not exist,...
Definition file.h:52
static void append_all_text(const xtd::string &path, type_t text)
Appends text to a file, and then closes the file. If the specified file does not exist,...
Definition file.h:79
static void write_all_lines(const xtd::string &path, type_t contents)
Writes lines to a file, and then closes the file. If the specified file does not exist,...
Definition file.h:332
static std::ofstream create(const xtd::string &path)
Creates or overwrites a file in the specified path.
static void replace(const xtd::string &source_file_name, const xtd::string &destination_file_name, const xtd::string &destination_backup_file_name)
Replaces the contents of a specified file with the contents of another file, deleting the original fi...
static std::ifstream open_text(const xtd::string &path)
Opens an existing file for reading.
static std::ofstream open_write(const xtd::string &path)
Opens an existing file for writing.
static void set_attributes(const xtd::string &path, xtd::io::file_attributes attributes)
Sets the specified xtd::io::file_attributes of the file on the specified path.
static std::ofstream write_text(const xtd::string &path)
Creates a std::ofstream that appends text to an existing file.
static xtd::date_time get_last_write_time(const xtd::string &path)
Returns the date and time the specified file or directory was last written to.
static void set_creation_time(const xtd::string &path, const xtd::date_time &creation_time)
Sets the date and time the file was created.
static std::vector< xtd::byte > read_all_bytes(const xtd::string &path)
Opens a binary file, reads the contents of the file into a byte array, and then closes the file.
static std::ifstream open_read(const xtd::string &path)
Opens an existing file for reading.
static void append_all_lines(const xtd::string &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:66
static void move(const xtd::string &src, const xtd::string &dest)
Moves a specified file to a new location, providing the option to specify a new file name.
static void write_all_lines(const xtd::string &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:346
static void copy(const xtd::string &src, const xtd::string &dest)
Copies an existing file to a new file. Overwriting a file of the same name is not allowed.
static void set_last_access_time(const xtd::string &path, const xtd::date_time &last_access_time)
Sets the date and time the specified file was last accessed.
static std::ofstream create_text(const xtd::string &path)
Creates or opens a file for writing text.
static xtd::date_time get_creation_time(const xtd::string &path)
Returns the creation date and time of the specified file or directory.
static xtd::date_time get_last_access_time(const xtd::string &path)
Returns the date and time the specified file or directory was last accessed.
static std::vector< xtd::string > read_all_lines(const xtd::string &path)
Opens a text file, reads all lines of the file, and then closes the file.
static xtd::string read_all_text(const xtd::string &path)
Opens a text file, reads all text of the file, and then closes the file.
static xtd::io::file_permissions get_permissions(const xtd::string &path)
Gets the xtd::io::file_permissions of the file on the path.
static void move(const xtd::string &src, const xtd::string &dest, bool overwrite)
Moves a specified file to a new location, providing the options to specify a new file name and to ove...
static void remove(const xtd::string &path)
Deletes the specified file.
static xtd::io::file_attributes get_attributes(const xtd::string &path)
Gets the xtd::io::file_attributes of the file on the path.
static void set_last_write_time(const xtd::string &path, const xtd::date_time &last_write_time)
Sets the date and time that the specified file was last written to.
static void set_permissions(const xtd::string &path, xtd::io::file_permissions permissions)
Sets the specified xtd::io::file_permissions of the file on the specified path.
static std::fstream open(const xtd::string &path, std::ios::openmode mode)
Opens a FileStream on the specified path.
static void write_all_text(const xtd::string &path, type_t text)
Writes text to a file, and then closes the file. If the specified file does not exist,...
Definition file.h:359
static bool exists(const xtd::string &path) noexcept
Determines whether the specified file exists.
Performs operations on std::basic_string instances that contain file or directory path information....
Definition path.h:36
Implements a xtd::io::text_writer for writing characters to a stream.
Definition stream_writer.h:28
void write(const xtd::string &value) override
Writes the specified string value to the text stream.
void write_line()
Writes new line to the text stream.
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.h:37
#define core_export_
Define shared library export.
Definition core_export.h:13
file_attributes
Provides attributes for files and directories.
Definition file_attributes.h:24
file_permissions
Provides permissions for files and directories.
Definition file_permissions.h:24
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition xtd_about_box.h:10
Contains xtd::io::stream_reader class.
Contains xtd::io::stream_writer class.