Provides the base class for both xtd::io::file_info and xtd::io::directory_info objects.
Protected Fields | |
xtd::string | full_path_ |
Represents the fully qualified path of the directory or file. | |
xtd::string | original_path_ |
The path originally specified by the user, whether relative or absolute. | |
Public Properties | |
xtd::io::file_attributes | attributes () const |
Gets the attributes for the current file or directory. | |
xtd::io::file_system_info & | attributes (xtd::io::file_attributes value) |
Sets the attributes for the current file or directory. | |
const xtd::date_time & | creation_time () const |
Gets the creation time of the current file or directory. | |
xtd::io::file_system_info & | creation_time (const xtd::date_time &value) |
Gets the creation time of the current file or directory. | |
xtd::date_time | creation_time_utc () const |
Gets the creation time, in coordinated universal time (UTC), of the current file or directory. | |
xtd::io::file_system_info & | creation_time_utc (const xtd::date_time &value) |
Sets the creation time, in coordinated universal time (UTC), of the current file or directory. | |
virtual bool | exists () const =0 |
Gets a value indicating whether the file or directory exists. | |
virtual xtd::string | extension () const |
Gets the extension part of the file name, including the leading dot . even if it is the entire file name, or an empty string if no extension is present. | |
xtd::string | full_name () const |
Gets the full path of the directory or file. | |
const xtd::date_time & | last_access_time () const |
Gets the time the current file or directory was last accessed. | |
xtd::io::file_system_info & | last_access_time (const xtd::date_time &value) |
Sets the time the current file or directory was last accessed. | |
xtd::date_time | last_access_time_utc () const |
Gets the time, in coordinated universal time (UTC), that the current file or directory was last accessed. | |
xtd::io::file_system_info & | last_access_time_utc (const xtd::date_time &value) |
Sets the time, in coordinated universal time (UTC), that the current file or directory was last accessed. | |
const xtd::date_time & | last_write_time () const |
Gets the time when the current file or directory was last written to. | |
xtd::io::file_system_info & | last_write_time (const xtd::date_time &value) |
Sets the time when the current file or directory was last written to. | |
xtd::date_time | last_write_time_utc () const |
Gets the time, in coordinated universal time (UTC), when the current file or directory was last written to. | |
xtd::io::file_system_info & | last_write_time_utc (const xtd::date_time &value) |
Sets the time, in coordinated universal time (UTC), when the current file or directory was last written to. | |
virtual xtd::string | name () const =0 |
xtd::io::file_permissions | permissions () const |
Gets the permissions for the current file or directory. | |
xtd::io::file_system_info & | permissions (xtd::io::file_permissions value) |
Sets the permissions for the current file or directory. | |
Public Methods | |
void | refresh () |
Refreshes the state of the object. | |
virtual void | remove () const =0 |
Deletes a file or directory. | |
xtd::string | to_string () const noexcept override |
Returns the original path. Use the xtd::io::file_system_info::full_name or xtd::io::file_system_info::name properties for the full path or file/directory name. | |
Protcted constructors | |
file_system_info ()=default | |
Initializes a new instance of the xtd::io::file_system_info class. | |
Additional Inherited Members | |
Public Member Functions inherited from xtd::object | |
object ()=default | |
Create a new instance of the ultimate base class object. | |
virtual bool | equals (const object &obj) const noexcept |
Determines whether the specified object is equal to the current object. | |
virtual size_t | get_hash_code () const noexcept |
Serves as a hash function for a particular type. | |
virtual type_object | get_type () const noexcept |
Gets the type of the current instance. | |
template<typename object_t > | |
xtd::uptr< object_t > | memberwise_clone () const |
Creates a shallow copy of the current object. | |
Static Public Member Functions inherited from xtd::object | |
template<typename object_a_t , typename object_b_t > | |
static bool | equals (const object_a_t &object_a, const object_b_t &object_b) noexcept |
Determines whether the specified object instances are considered equal. | |
template<typename object_a_t , typename object_b_t > | |
static bool | reference_equals (const object_a_t &object_a, const object_b_t &object_b) noexcept |
Determines whether the specified object instances are the same instance. | |
Protected Member Functions inherited from xtd::abstract_object | |
abstract_object ()=default | |
Initializes a new instance of the xtd::abstract_object class. | |
|
protecteddefault |
Initializes a new instance of the xtd::io::file_system_info class.
xtd::io::file_attributes xtd::io::file_system_info::attributes | ( | ) | const |
Gets the attributes for the current file or directory.
xtd::io::file_not_found_exception | The specified file doesn't exist. Only thrown when setting the property value. |
xtd::io::directory_not_found_exception | The specified path is invalid. For example, it's on an unmapped drive. Only thrown when setting the property value. |
xtd::io::path_too_long_exception | The specified path, file name, or both exceed the system-defined maximum length. |
xtd::argument_exception | The specified path, file name, or both exceed the system-defined maximum length. |
xtd::io::io_exception | xtd::io::file_system_info::refresh() cannot initialize the data. |
example_file.attributes(example_file.attributes() | file_attributes::read_only;
xtd::io::file_system_info & xtd::io::file_system_info::attributes | ( | xtd::io::file_attributes | value | ) |
Sets the attributes for the current file or directory.
value | xtd::io::file_attributes of the current xtd::io::file_system_info. |
xtd::io::file_not_found_exception | The specified file doesn't exist. Only thrown when setting the property value. |
xtd::io::directory_not_found_exception | The specified path is invalid. For example, it's on an unmapped drive. Only thrown when setting the property value. |
xtd::io::path_too_long_exception | The specified path, file name, or both exceed the system-defined maximum length. |
xtd::argument_exception | The specified path, file name, or both exceed the system-defined maximum length. |
xtd::io::io_exception | xtd::io::file_system_info::refresh() cannot initialize the data. |
xtd::platform_not_supported_exception | The opration is not supported on the current operating system. |
example_file.attributes(example_file.attributes() | file_attributes::read_only;
const xtd::date_time & xtd::io::file_system_info::creation_time | ( | ) | const |
Gets the creation time of the current file or directory.
xtd::io::io_exception | system error when retrieving the file information. |
xtd::io::directory_not_found_exception | The specified path is invalid; for example, it is on an unmapped drive. |
xtd::platform_not_supported_exception | The opration is not supported on the current operating system. |
xtd::io::file_system_info & xtd::io::file_system_info::creation_time | ( | const xtd::date_time & | value | ) |
Gets the creation time of the current file or directory.
value | The creation date and time of the current xtd::io::file_system_info object. |
xtd::io::io_exception | system error when retrieving the file information. |
xtd::io::directory_not_found_exception | The specified path is invalid; for example, it is on an unmapped drive. |
xtd::platform_not_supported_exception | The opration is not supported on the current operating system. |
xtd::date_time xtd::io::file_system_info::creation_time_utc | ( | ) | const |
Gets the creation time, in coordinated universal time (UTC), of the current file or directory.
xtd::io::file_system_info & xtd::io::file_system_info::creation_time_utc | ( | const xtd::date_time & | value | ) |
Sets the creation time, in coordinated universal time (UTC), of the current file or directory.
value | The creation date and time in UTC format of the current xtd::io::file_system_info object. |
|
pure virtual |
Gets a value indicating whether the file or directory exists.
Implemented in xtd::io::directory_info, and xtd::io::file_info.
|
virtual |
Gets the extension part of the file name, including the leading dot . even if it is the entire file name, or an empty string if no extension is present.
To do this... | See the example in this topic... |
---|---|
Create a text file. | How to: Write Text to a File |
Write to a text file. | How to: Write Text to a File |
Read from a text file. | How to: Read Text to a File |
Retrieve the fully qualified path of a file. | xtd::io::path::get_full_path |
Retrieve only the file name a path. | xtd::io::path::get_file_name_without_extension |
Retrieve only the directory name from a path. | xtd::io::path::get_directory_name |
Change the extension of a file. | xtd::io::path::change_extrnsion |
xtd::string xtd::io::file_system_info::full_name | ( | ) | const |
Gets the full path of the directory or file.
const xtd::date_time & xtd::io::file_system_info::last_access_time | ( | ) | const |
Gets the time the current file or directory was last accessed.
xtd::io::io_exception | system error when retrieving the file information. |
xtd::io::directory_not_found_exception | The specified path is invalid; for example, it is on an unmapped drive. |
xtd::platform_not_supported_exception | The opration is not supported on the current operating system. |
xtd::io::file_system_info & xtd::io::file_system_info::last_access_time | ( | const xtd::date_time & | value | ) |
Sets the time the current file or directory was last accessed.
value | The time that the current file or directory was last accessed. |
xtd::io::io_exception | system error when retrieving the file information. |
xtd::io::directory_not_found_exception | The specified path is invalid; for example, it is on an unmapped drive. |
xtd::platform_not_supported_exception | The opration is not supported on the current operating system. |
xtd::date_time xtd::io::file_system_info::last_access_time_utc | ( | ) | const |
Gets the time, in coordinated universal time (UTC), that the current file or directory was last accessed.
xtd::io::file_system_info & xtd::io::file_system_info::last_access_time_utc | ( | const xtd::date_time & | value | ) |
Sets the time, in coordinated universal time (UTC), that the current file or directory was last accessed.
vvalue | The UTC time that the current file or directory was last accessed. |
const xtd::date_time & xtd::io::file_system_info::last_write_time | ( | ) | const |
Gets the time when the current file or directory was last written to.
xtd::io::io_exception | system error when retrieving the file information. |
xtd::io::directory_not_found_exception | The specified path is invalid; for example, it is on an unmapped drive. |
xtd::platform_not_supported_exception | The opration is not supported on the current operating system. |
xtd::io::file_system_info & xtd::io::file_system_info::last_write_time | ( | const xtd::date_time & | value | ) |
Sets the time when the current file or directory was last written to.
value | The time the current file was last written. |
xtd::io::io_exception | system error when retrieving the file information. |
xtd::io::directory_not_found_exception | The specified path is invalid; for example, it is on an unmapped drive. |
xtd::platform_not_supported_exception | The opration is not supported on the current operating system. |
xtd::date_time xtd::io::file_system_info::last_write_time_utc | ( | ) | const |
Gets the time, in coordinated universal time (UTC), when the current file or directory was last written to.
xtd::io::file_system_info & xtd::io::file_system_info::last_write_time_utc | ( | const xtd::date_time & | value | ) |
Sets the time, in coordinated universal time (UTC), when the current file or directory was last written to.
value | The UTC time when the current file was last written to. |
|
pure virtual |
Implemented in xtd::io::directory_info, and xtd::io::file_info.
xtd::io::file_permissions xtd::io::file_system_info::permissions | ( | ) | const |
Gets the permissions for the current file or directory.
xtd::io::file_not_found_exception | The specified file doesn't exist. Only thrown when setting the property value. |
xtd::io::directory_not_found_exception | The specified path is invalid. For example, it's on an unmapped drive. Only thrown when setting the property value. |
xtd::io::path_too_long_exception | The specified path, file name, or both exceed the system-defined maximum length. |
xtd::argument_exception | The specified path, file name, or both exceed the system-defined maximum length. |
xtd::io::io_exception | xtd::io::file_system_info::refresh() cannot initialize the data. |
xtd::io::file_system_info & xtd::io::file_system_info::permissions | ( | xtd::io::file_permissions | value | ) |
Sets the permissions for the current file or directory.
value | xtd::io::file_permissions of the current xtd::io::file_system_info. |
xtd::io::file_not_found_exception | The specified file doesn't exist. Only thrown when setting the property value. |
xtd::io::directory_not_found_exception | The specified path is invalid. For example, it's on an unmapped drive. Only thrown when setting the property value. |
xtd::io::path_too_long_exception | The specified path, file name, or both exceed the system-defined maximum length. |
xtd::argument_exception | The specified path, file name, or both exceed the system-defined maximum length. |
xtd::io::io_exception | xtd::io::file_system_info::refresh() cannot initialize the data. |
xtd::platform_not_supported_exception | The opration is not supported on the current operating system. |
void xtd::io::file_system_info::refresh | ( | ) |
Refreshes the state of the object.
xtd::io::io_exception | A device such as a disk drive is not ready. |
|
pure virtual |
Deletes a file or directory.
xtd::io::directory_not_found_exception | The specified path is invalid; for example, it is on an unmapped drive. |
xtd::io::io_exception | There is an open handle on the file or directory, and the operating system is Windows XP or earlier. This open handle can result from enumerating directories and files. For more information, see How to: Enumerate Directories and Files. |
Implemented in xtd::io::directory_info, and xtd::io::file_info.
|
overridevirtualnoexcept |
Returns the original path. Use the xtd::io::file_system_info::full_name or xtd::io::file_system_info::name properties for the full path or file/directory name.
Reimplemented from xtd::object.
|
protected |
Represents the fully qualified path of the directory or file.
|
protected |
The path originally specified by the user, whether relative or absolute.