xtd 0.2.0
Loading...
Searching...
No Matches
file_system_info.h
Go to the documentation of this file.
1
4#pragma once
5#include "file_attributes.h"
6#include "file_permissions.h"
7#include "../abstract.h"
8#include "../core_export.h"
9#include "../date_time.h"
10#include "../ustring.h"
11#include <memory>
12
14namespace xtd {
16 namespace io {
86 public:
88 file_system_info(const file_system_info&) = default;
89 file_system_info& operator =(const file_system_info&) = default;
91
93
166
209
241
245 virtual bool exists() const = 0;
246
265 virtual xtd::ustring extension() const;
266
287
398
429
540
567
572 virtual xtd::ustring name() const = 0;
573
592
594
600 void refresh();
601
605 virtual void remove() const = 0;
606
612 xtd::ustring to_string() const noexcept override;
614
615 protected:
617
620 file_system_info() = default;
622
624
627 xtd::ustring full_path_;
629 xtd::ustring original_path_;
631
632 private:
633 xtd::io::file_attributes attributes_ = static_cast<xtd::io::file_attributes>(0);
634 xtd::date_time creation_time_;
635 xtd::date_time last_access_time_;
636 xtd::date_time last_write_time_;
637 xtd::io::file_permissions permissions_ = xtd::io::file_permissions::none;
638 };
639 }
640}
Represents an instant in time, typically expressed as a date and time of day.
Definition date_time.h:79
Provides the base class for both xtd::io::file_info and xtd::io::directory_info objects.
Definition file_system_info.h:85
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_write_time(const xtd::date_time &value)
Sets the time when the current file or directory was last written to.
xtd::ustring to_string() const noexcept override
Returns the original path. Use the xtd::io::file_system_info::full_name or xtd::io::file_system_info:...
xtd::ustring full_name() const
Gets the full path of the directory or file.
xtd::date_time creation_time_utc() const
Gets the creation time, in coordinated universal time (UTC), of 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_attributes attributes() const
Gets the attributes for the current file or directory.
xtd::date_time last_write_time_utc() const
Gets the time, in coordinated universal time (UTC), when the current file or directory was last writt...
xtd::date_time last_access_time_utc() const
Gets the time, in coordinated universal time (UTC), that the current file or directory was last acces...
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.
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 writt...
xtd::io::file_system_info & creation_time(const xtd::date_time &value)
Gets the creation time of 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.
xtd::io::file_system_info & permissions(xtd::io::file_permissions value)
Sets the permissions for the current file or directory.
virtual xtd::ustring extension() const
Gets the extension part of the file name, including the leading dot . even if it is the entire file n...
void refresh()
Refreshes the state of the object.
xtd::io::file_permissions permissions() const
Gets the permissions for the current file or directory.
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_access_time(const xtd::date_time &value)
Sets the time 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 acces...
virtual bool exists() const =0
Gets a value indicating whether the file or directory exists.
virtual void remove() const =0
Deletes a file or directory.
Represents text as a sequence of UTF-8 code units.
Definition ustring.h:47
Contains xtd::io::file_attributes enum class.
Contains xtd::io::file_permissions enum class.
#define abstract_
This keyword is used to represents an abstract class.
Definition abstract.h:23
#define core_export_
Define shared library export.
Definition core_export.h:13
file_attributes
Provides attributes for files and directories.
Definition file_attributes.h:22
file_permissions
Provides permissions for files and directories.
Definition file_permissions.h:22
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition xtd_about_box.h:10