xtd - Reference Guide  0.2.0
Modern c++17/20 framework to create console, GUI and unit test applications on Windows, macOS, Linux, iOS and android.
file_system_info.h
Go to the documentation of this file.
1 #pragma once
5 
6 #include <memory>
7 #include "../abstract.h"
8 #include "../core_export.h"
9 #include "../date_time.h"
10 #include "../ustring.h"
11 #include "file_attributes.h"
12 
14 namespace xtd {
16  namespace io {
83  class core_export_ file_system_info abstract_ {
84  public:
86  file_system_info(const file_system_info&) = default;
87  file_system_info& operator=(const file_system_info&) = default;
89 
91 
127  xtd::io::file_attributes attributes() const;
164 
185  const xtd::date_time& creation_time() const;
206  xtd::io::file_system_info& creation_time(const xtd::date_time& value);
207 
222  xtd::date_time creation_time_utc() const;
238  xtd::io::file_system_info& creation_time_utc(const xtd::date_time& value);
239 
243  virtual bool exists() const = 0;
244 
263  virtual xtd::ustring extension() const;
264 
284  xtd::ustring full_name() const;
285 
340  const xtd::date_time& last_access_time() const;
395  xtd::io::file_system_info& last_access_time(const xtd::date_time& value);
396 
410  xtd::date_time last_access_time_utc() const;
426  xtd::io::file_system_info& last_access_time_utc(const xtd::date_time& value);
427 
482  const xtd::date_time& last_write_time() const;
537  xtd::io::file_system_info& last_write_time(const xtd::date_time& value);
538 
551  xtd::date_time last_write_time_utc() const;
564  xtd::io::file_system_info& last_write_time_utc(const xtd::date_time& value);
565 
570  virtual xtd::ustring name() const = 0;
572 
574 
580  void refresh();
581 
585  virtual void remove() const = 0;
586 
592  xtd::ustring to_string() const noexcept override;
594 
595  protected:
597 
600  file_system_info() = default;
602 
604 
611 
612  private:
613  xtd::io::file_attributes attributes_ = static_cast<xtd::io::file_attributes>(0);
614  xtd::date_time creation_time_;
615  xtd::date_time last_access_time_;
616  xtd::date_time last_write_time_;
617  };
618  }
619 }
Provides the base class for both xtd::io::file_info and xtd::io::directory_info objects.
Definition: file_system_info.h:83
file_attributes
Provides attributes for files and directories.
Definition: file_attributes.h:20
The xtd namespace contains all fundamental classes to access Hardware, Os, System, and more.
Definition: system_report.h:17
Represents text as a sequence of UTF-8 code units.
Definition: ustring.h:50
std::string to_string(const date_time &value, const std::string &fmt, const std::locale &loc)
Convert a specified value into a string with specified format and locale.
Definition: date_time.h:1110
Represents an instant in time, typically expressed as a date and time of day.
Definition: date_time.h:71
Contains xtd::io::file_attributes enum class.
#define abstract_
This keyword is used to represents an abstract class.
Definition: abstract.h:52
xtd::ustring full_path_
Represents the fully qualified path of the directory or file.
Definition: file_system_info.h:607
xtd::ustring original_path_
The path originally specified by the user, whether relative or absolute.
Definition: file_system_info.h:609