Make members of FileEntryInfo fields until we migrate to .NET 6.

This commit is contained in:
2021-05-31 19:14:10 +01:00
parent 493ba5dd4c
commit c0002b1f4f

View File

@@ -40,6 +40,7 @@
using System; using System;
using System.Diagnostics.CodeAnalysis; using System.Diagnostics.CodeAnalysis;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
using System.Text.Json.Serialization;
namespace Aaru.CommonTypes.Structs namespace Aaru.CommonTypes.Structs
{ {
@@ -155,25 +156,25 @@ namespace Aaru.CommonTypes.Structs
public class FileEntryInfo public class FileEntryInfo
{ {
/// <summary>File attributes</summary> /// <summary>File attributes</summary>
public FileAttributes Attributes; public FileAttributes Attributes { get; set; }
/// <summary>File length in blocks</summary> /// <summary>File length in blocks</summary>
public long Blocks; public long Blocks { get; set; }
/// <summary>File block size in bytes</summary> /// <summary>File block size in bytes</summary>
public long BlockSize; public long BlockSize { get; set; }
/// <summary>If file points to a device, device number. Null if the underlying filesystem does not support them.</summary> /// <summary>If file points to a device, device number. Null if the underlying filesystem does not support them.</summary>
public ulong? DeviceNo; public ulong? DeviceNo { get; set; }
/// <summary>POSIX group ID. Null if the underlying filesystem does not support them.</summary> /// <summary>POSIX group ID. Null if the underlying filesystem does not support them.</summary>
public ulong? GID; public ulong? GID { get; set; }
/// <summary>inode number for this file (or other unique identifier for the volume)</summary> /// <summary>inode number for this file (or other unique identifier for the volume)</summary>
public ulong Inode; public ulong Inode { get; set; }
/// <summary>File length in bytes</summary> /// <summary>File length in bytes</summary>
public long Length; public long Length { get; set; }
/// <summary>Number of hard links pointing to this file (. and .. entries count as hard links)</summary> /// <summary>Number of hard links pointing to this file (. and .. entries count as hard links)</summary>
public ulong Links; public ulong Links { get; set; }
/// <summary>POSIX permissions/mode for this file. Null if the underlying filesystem does not support them.</summary> /// <summary>POSIX permissions/mode for this file. Null if the underlying filesystem does not support them.</summary>
public uint? Mode; public uint? Mode { get; set; }
/// <summary>POSIX owner ID. Null if the underlying filesystem does not support them.</summary> /// <summary>POSIX owner ID. Null if the underlying filesystem does not support them.</summary>
public ulong? UID; public ulong? UID { get; set; }
/// <summary>File creation date in UTC. Null if the underlying filesystem does not support them.</summary> /// <summary>File creation date in UTC. Null if the underlying filesystem does not support them.</summary>
public DateTime? CreationTimeUtc { get; set; } public DateTime? CreationTimeUtc { get; set; }
/// <summary>File last access date in UTC. Null if the underlying filesystem does not support them.</summary> /// <summary>File last access date in UTC. Null if the underlying filesystem does not support them.</summary>
@@ -186,6 +187,7 @@ namespace Aaru.CommonTypes.Structs
public DateTime? LastWriteTimeUtc { get; set; } public DateTime? LastWriteTimeUtc { get; set; }
/// <summary>File creation date. Null if the underlying filesystem does not support them.</summary> /// <summary>File creation date. Null if the underlying filesystem does not support them.</summary>
[JsonIgnore]
public DateTime? CreationTime public DateTime? CreationTime
{ {
get => CreationTimeUtc?.ToLocalTime(); get => CreationTimeUtc?.ToLocalTime();
@@ -193,6 +195,7 @@ namespace Aaru.CommonTypes.Structs
} }
/// <summary>File last access date. Null if the underlying filesystem does not support them.</summary> /// <summary>File last access date. Null if the underlying filesystem does not support them.</summary>
[JsonIgnore]
public DateTime? AccessTime public DateTime? AccessTime
{ {
get => AccessTimeUtc?.ToLocalTime(); get => AccessTimeUtc?.ToLocalTime();
@@ -200,6 +203,7 @@ namespace Aaru.CommonTypes.Structs
} }
/// <summary>File attributes change date. Null if the underlying filesystem does not support them.</summary> /// <summary>File attributes change date. Null if the underlying filesystem does not support them.</summary>
[JsonIgnore]
public DateTime? StatusChangeTime public DateTime? StatusChangeTime
{ {
get => StatusChangeTimeUtc?.ToLocalTime(); get => StatusChangeTimeUtc?.ToLocalTime();
@@ -207,6 +211,7 @@ namespace Aaru.CommonTypes.Structs
} }
/// <summary>File last backup date. Null if the underlying filesystem does not support them.</summary> /// <summary>File last backup date. Null if the underlying filesystem does not support them.</summary>
[JsonIgnore]
public DateTime? BackupTime public DateTime? BackupTime
{ {
get => BackupTimeUtc?.ToLocalTime(); get => BackupTimeUtc?.ToLocalTime();
@@ -214,6 +219,7 @@ namespace Aaru.CommonTypes.Structs
} }
/// <summary>File last modification date. Null if the underlying filesystem does not support them.</summary> /// <summary>File last modification date. Null if the underlying filesystem does not support them.</summary>
[JsonIgnore]
public DateTime? LastWriteTime public DateTime? LastWriteTime
{ {
get => LastWriteTimeUtc?.ToLocalTime(); get => LastWriteTimeUtc?.ToLocalTime();