Class FileId
Represents a validated file identifier.
Namespace: FulcrumFS
Assembly: FulcrumFS.Core.dll
Syntax
public sealed class FileId : ISpanParsable<FileId>, IParsable<FileId>, IEquatable<FileId>
Constructors
| Name | Description |
|---|---|
| FileId(Guid) | Initializes a new instance of the FileId class with the specified GUID. |
Properties
| Name | Description |
|---|---|
| Guid | Gets the underlying GUID representing the file ID. |
| RelativeDirectory | Gets the directory path where the file and its variants are stored relative to the repository's FilesDirectoryName subdirectory. |
Methods
| Name | Description |
|---|---|
| Create(Guid) | Creates a new file ID from the specified GUID. |
| CreateSecure() | Creates a new cryptographically random file ID backed by a version 4 GUID. |
| CreateSequential() | Creates a new sequential file ID backed by a version 7 GUID. |
| Equals(FileId?) | Determines whether the specified FileId is equal to the current FileId. |
| Equals(FileId?, FileId?) | Determines whether two FileId instances are equal. |
| Equals(object?) | Determines whether the specified object is equal to the current object. |
| GetHashCode() | Serves as the default hash function. |
| GetRelativeFilePath(string?, string) | Returns the file path to a main file or its variant relative to the repository's FilesDirectoryName subdirectory. |
| Parse(ReadOnlySpan<char>) | Parses the specified string representation of a file identifier. |
| Parse(string) | Parses the specified string representation of a file identifier. |
| ToString() | Gets the string representation of the file ID. |
| TryParse(ReadOnlySpan<char>, out FileId) | Parses the specified string representation of a file identifier. |
| TryParse(string?, out FileId) | Parses the specified string representation of a file identifier. |
Operators
| Name | Description |
|---|---|
| operator ==(FileId, FileId) | Determines whether two FileId instances are equal. |
| explicit operator FileId(Guid) | |
| implicit operator Guid(FileId) | |
| operator !=(FileId, FileId) | Determines whether two FileId instances are not equal. |
Explicit Interface Implementations
| Name | Description |
|---|---|
| IParsable<FileId>.Parse(string, IFormatProvider?) | Parses a string into a value. |
| IParsable<FileId>.TryParse(string?, IFormatProvider?, out FileId) | Tries to parse a string into a value. |
| ISpanParsable<FileId>.Parse(ReadOnlySpan<char>, IFormatProvider?) | Parses a span of characters into a value. |
| ISpanParsable<FileId>.TryParse(ReadOnlySpan<char>, IFormatProvider?, out FileId) | Tries to parse a span of characters into a value. |