xtd 0.2.0
Loading...
Searching...
No Matches
file_system_info.hpp
Go to the documentation of this file.
1
4#pragma once
5#include "file_attributes.hpp"
7#include "../abstract.hpp"
8#include "../core_export.hpp"
9#include "../date_time.hpp"
10#include "../string.hpp"
11#include <memory>
12
14namespace xtd {
16 namespace io {
88 public:
90 file_system_info(const file_system_info&) = default;
91 auto operator =(const file_system_info&) -> file_system_info& = default;
93
95
131 [[nodiscard]] auto attributes() const -> xtd::io::file_attributes;
168
189 [[nodiscard]] auto creation_time() const -> const xtd::date_time&;
211
226 [[nodiscard]] auto creation_time_utc() const -> xtd::date_time;
243
247 [[nodiscard]] virtual auto exists() const -> bool = 0;
248
267 [[nodiscard]] virtual auto extension() const -> xtd::string;
268
288 [[nodiscard]] auto full_name() const -> xtd::string;
289
344 [[nodiscard]] auto last_access_time() const -> const xtd::date_time&;
400
414 [[nodiscard]] auto last_access_time_utc() const -> xtd::date_time;
431
486 [[nodiscard]] auto last_write_time() const -> const xtd::date_time&;
542
555 [[nodiscard]] auto last_write_time_utc() const -> xtd::date_time;
569
574 [[nodiscard]] virtual auto name() const -> xtd::string = 0;
575
583 [[nodiscard]] auto permissions() const -> xtd::io::file_permissions;
594
596
602 void refresh();
603
607 virtual void remove() const = 0;
608
614 [[nodiscard]] auto to_string() const noexcept -> xtd::string override;
616
617 protected:
619
622 file_system_info() = default;
624
626
633
634 private:
635 xtd::io::file_attributes attributes_ = static_cast<xtd::io::file_attributes>(0);
636 xtd::date_time creation_time_;
637 xtd::date_time last_access_time_;
638 xtd::date_time last_write_time_;
639 xtd::io::file_permissions permissions_ = xtd::io::file_permissions::none;
640 };
641 }
642}
Contains xtd::abstract_object class.
Represents an instant in time, typically expressed as a date and time of day.
Definition date_time.hpp:83
auto last_access_time_utc() const -> xtd::date_time
Gets the time, in coordinated universal time (UTC), that the current file or directory was last acces...
virtual auto exists() const -> bool=0
Gets a value indicating whether the file or directory exists.
xtd::string full_path_
Represents the fully qualified path of the directory or file.
Definition file_system_info.hpp:629
auto last_write_time() const -> const xtd::date_time &
Gets the time when the current file or directory was last written to.
auto creation_time() const -> const xtd::date_time &
Gets the creation time of the current file or directory.
auto last_access_time() const -> const xtd::date_time &
Gets the time the current file or directory was last accessed.
auto full_name() const -> xtd::string
Gets the full path of the directory or file.
virtual auto extension() const -> xtd::string
Gets the extension part of the file name, including the leading dot . even if it is the entire file n...
auto last_write_time_utc() const -> xtd::date_time
Gets the time, in coordinated universal time (UTC), when the current file or directory was last writt...
xtd::string original_path_
The path originally specified by the user, whether relative or absolute.
Definition file_system_info.hpp:631
void refresh()
Refreshes the state of the object.
file_system_info()=default
Initializes a new instance of the xtd::io::file_system_info class.
auto attributes() const -> xtd::io::file_attributes
Gets the attributes for the current file or directory.
auto creation_time_utc() const -> xtd::date_time
Gets the creation time, in coordinated universal time (UTC), of the current file or directory.
auto permissions() const -> xtd::io::file_permissions
Gets the permissions for the current file or directory.
virtual void remove() const =0
Deletes a file or directory.
auto to_string() const noexcept -> xtd::string override
Returns the original path. Use the xtd::io::file_system_info::full_name or xtd::io::file_system_info:...
Contains core_export_ keyword.
Contains xtd::date_time class.
Contains xtd::io::file_attributes enum class.
Contains xtd::io::file_permissions enum class.
#define core_export_
Define shared library export.
Definition core_export.hpp:13
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
@ none
No permission bits are set.
Definition file_permissions.hpp:26
The xtd::io namespace contains types that allow reading and writing to files and data streams,...
Definition binary_reader.hpp:17
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition abstract_object.hpp:8
Contains xtd::string alias.