-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #41 from JaniruTEC/improved-enumintegers
Merge pull request #41 from JaniruTEC/improved-enumintegers: Improve EnumInteger-System Added new package conv (conversion) Added convenience methods Added missing static methods Added IntegerConvertible as base interface of EnumInteger Added MaskValue as special case of EnumInteger that is used to express masks Renamed EnumIntegerSet to MaskValueSet and changed it to only accept MaskValues Made EnumIntegerSet an interface and added EnumIntegerSetImpl as implementation Renamed enumSetFromInt to maskValueSet
- Loading branch information
Showing
33 changed files
with
372 additions
and
306 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 15 additions & 10 deletions
25
src/main/java/dev/dokan/dokan_java/constants/microsoft/DirectoryAccessMask.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,30 @@ | ||
package dev.dokan.dokan_java.constants.microsoft; | ||
|
||
import dev.dokan.dokan_java.constants.EnumInteger; | ||
import com.sun.jna.platform.win32.WinNT; | ||
import dev.dokan.dokan_java.masking.MaskValueEnum; | ||
import dev.dokan.dokan_java.masking.MaskValueSet; | ||
|
||
/** | ||
* Additional {@link AccessMask} values specific to directories. | ||
* | ||
* @see <a href="https://docs.microsoft.com/en-us/windows-hardware/drivers/ddi/content/wdm/nf-wdm-zwcreatefile">Microsoft documentation of ZwCreateFile</a>, Section Parameters, Parameter {@code DesiredAccess} | ||
*/ | ||
public enum DirectoryAccessMask implements EnumInteger { | ||
public enum DirectoryAccessMask implements MaskValueEnum { | ||
LIST_DIRECTORY(WinNT.FILE_LIST_DIRECTORY), | ||
TRAVERSE(WinNT.FILE_TRAVERSE); | ||
|
||
private final int mask; | ||
private final int maskingValue; | ||
|
||
DirectoryAccessMask(int mask) { | ||
this.mask = mask; | ||
} | ||
DirectoryAccessMask(int maskingValue) { | ||
this.maskingValue = maskingValue; | ||
} | ||
|
||
@Override | ||
public int getMask() { | ||
return mask; | ||
} | ||
public static MaskValueSet<DirectoryAccessMask> maskValueSet(final int mask) { | ||
return MaskValueSet.maskValueSet(mask, values()); | ||
} | ||
|
||
@Override | ||
public int intValue() { | ||
return this.maskingValue; | ||
} | ||
} |
Oops, something went wrong.