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 "../string.h"
11#include <memory>
12
14namespace xtd {
16 namespace io {
88 public:
90 file_system_info(const file_system_info&) = default;
91 file_system_info& operator =(const file_system_info&) = default;
93
95
168
211
243
247 virtual bool exists() const = 0;
248
267 virtual xtd::string extension() const;
268
289
400
431
542
569
574 virtual xtd::string name() const = 0;
575
594
596
602 void refresh();
603
607 virtual void remove() const = 0;
608
614 xtd::string to_string() const noexcept override;
616
617 protected:
619
622 file_system_info() = default;
624
626
629 xtd::string full_path_;
631 xtd::string original_path_;
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}
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 the base class for both xtd::io::file_info and xtd::io::directory_info objects.
Definition file_system_info.h:87
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::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::string full_name() const
Gets the full path of the directory or file.
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.
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::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:...
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.
virtual xtd::string extension() const
Gets the extension part of the file name, including the leading dot . even if it is the entire file n...
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:25
#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