Convenience functions for flag testing

This commit is contained in:
Jakob Borg
2014-05-23 12:53:26 +02:00
parent 7bc36cbbd1
commit b60d648e22
6 changed files with 47 additions and 19 deletions

View File

@@ -516,3 +516,19 @@ func (c *rawConnection) Statistics() Statistics {
OutBytesTotal: int(c.cw.Tot()),
}
}
func IsDeleted(bits uint32) bool {
return bits&FlagDeleted != 0
}
func IsInvalid(bits uint32) bool {
return bits&FlagInvalid != 0
}
func IsDirectory(bits uint32) bool {
return bits&FlagDirectory != 0
}
func HasPermissionBits(bits uint32) bool {
return bits&FlagNoPermBits == 0
}