Skip to content

Commit

Permalink
Merge pull request #163 from kishikawakatsumi/hashable
Browse files Browse the repository at this point in the history
Make data structures Hashable
  • Loading branch information
kishikawakatsumi authored Nov 21, 2024
2 parents 1c59adc + 673b0ba commit 78ecf6c
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions Sources/SMBClient/SMBClient.swift
Original file line number Diff line number Diff line change
Expand Up @@ -204,12 +204,12 @@ public class SMBClient {
}
}

public struct Share {
public struct Share: Hashable {
public let name: String
public let comment: String
public let type: ShareType

public struct ShareType: OptionSet {
public struct ShareType: OptionSet, Hashable {
public let rawValue: UInt32

public init(rawValue: UInt32) {
Expand Down Expand Up @@ -268,7 +268,7 @@ extension Share.ShareType: CustomStringConvertible {
}
}

public struct File {
public struct File: Hashable {
public let name: String
public var size: UInt64 { fileStat.size }
public var isDirectory: Bool { fileStat.isDirectory }
Expand All @@ -294,7 +294,7 @@ extension File: CustomStringConvertible {
}
}

public struct FileStat {
public struct FileStat: Hashable {
public let size: UInt64
public let isDirectory: Bool
public let isHidden: Bool
Expand Down Expand Up @@ -335,9 +335,3 @@ extension FileStat: CustomStringConvertible {
"{ size: \(size), isDirectory: \(isDirectory), isHidden: \(isHidden), isReadOnly: \(isReadOnly), isSystem: \(isSystem), isArchive: \(isArchive), creationTime: \(creationTime), lastAccessTime: \(lastAccessTime), lastWriteTime: \(lastWriteTime) }"
}
}

public struct FileReadResponse {
public let dataRemaining: UInt32
public let buffer: Data
public let endOfFile: Bool
}

0 comments on commit 78ecf6c

Please sign in to comment.