diff options
Diffstat (limited to 'src/Notepad/Domain/FileSystem/AbsoluteFilePath.cs')
| -rw-r--r-- | src/Notepad/Domain/FileSystem/AbsoluteFilePath.cs | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/src/Notepad/Domain/FileSystem/AbsoluteFilePath.cs b/src/Notepad/Domain/FileSystem/AbsoluteFilePath.cs new file mode 100644 index 0000000..31ef07b --- /dev/null +++ b/src/Notepad/Domain/FileSystem/AbsoluteFilePath.cs @@ -0,0 +1,34 @@ +namespace Notepad.Domain.FileSystem {
+ public class AbsoluteFilePath : IFilePath {
+ private readonly string rawFilePath;
+
+ public AbsoluteFilePath(string rawFilePath) {
+ this.rawFilePath = rawFilePath;
+ }
+
+ public string RawPathToFile() {
+ return rawFilePath;
+ }
+
+ public bool Equals(IFilePath other) {
+ if (ReferenceEquals(null, other)) {
+ return false;
+ }
+ return ReferenceEquals(this, other) || Equals(other.RawPathToFile(), rawFilePath);
+ }
+
+ public override bool Equals(object other) {
+ if (ReferenceEquals(null, other)) {
+ return false;
+ }
+ if (ReferenceEquals(this, other)) {
+ return true;
+ }
+ return other.GetType() == typeof (AbsoluteFilePath) && Equals((AbsoluteFilePath) other);
+ }
+
+ public override int GetHashCode() {
+ return (rawFilePath != null ? rawFilePath.GetHashCode() : 0);
+ }
+ }
+}
\ No newline at end of file |
