Fix typos

This commit is contained in:
Ne_Eo
2024-12-10 04:35:32 +01:00
parent da717919ba
commit d6dc3ea232
76 changed files with 214 additions and 211 deletions
+10 -10
View File
@@ -35,9 +35,9 @@ class NativeAPI {
/**
* Gets the specified file's (or folder) attributes.
*/
public static function getFileAttributesRaw(path:String, useAbsol:Bool = true):Int {
public static function getFileAttributesRaw(path:String, useAbsolute:Bool = true):Int {
#if windows
if(useAbsol) path = sys.FileSystem.absolutePath(path);
if(useAbsolute) path = sys.FileSystem.absolutePath(path);
return Windows.getFileAttributes(path);
#else
return -1;
@@ -47,16 +47,16 @@ class NativeAPI {
/**
* Gets the specified file's (or folder) attributes and passes it to `FileAttributeWrapper`.
*/
public static function getFileAttributes(path:String, useAbsol:Bool = true):FileAttributeWrapper {
return new FileAttributeWrapper(getFileAttributesRaw(path, useAbsol));
public static function getFileAttributes(path:String, useAbsolute:Bool = true):FileAttributeWrapper {
return new FileAttributeWrapper(getFileAttributesRaw(path, useAbsolute));
}
/**
* Sets the specified file's (or folder) attributes. If it fails, the return value is `0`.
*/
public static function setFileAttributes(path:String, attrib:OneOfThree<NativeAPI.FileAttribute, FileAttributeWrapper, Int>, useAbsol:Bool = true):Int {
public static function setFileAttributes(path:String, attrib:OneOfThree<NativeAPI.FileAttribute, FileAttributeWrapper, Int>, useAbsolute:Bool = true):Int {
#if windows
if(useAbsol) path = sys.FileSystem.absolutePath(path);
if(useAbsolute) path = sys.FileSystem.absolutePath(path);
return Windows.setFileAttributes(path, attrib is FileAttributeWrapper ? cast(attrib, FileAttributeWrapper).getValue() : cast(attrib, Int));
#else
return 0;
@@ -66,9 +66,9 @@ class NativeAPI {
/**
* Removes from the specified file's (or folder) one (or more) specific attribute.
*/
public static function addFileAttributes(path:String, attrib:OneOfTwo<NativeAPI.FileAttribute, Int>, useAbsol:Bool = true):Int {
public static function addFileAttributes(path:String, attrib:OneOfTwo<NativeAPI.FileAttribute, Int>, useAbsolute:Bool = true):Int {
#if windows
return setFileAttributes(path, getFileAttributesRaw(path, useAbsol) | cast(attrib, Int), useAbsol);
return setFileAttributes(path, getFileAttributesRaw(path, useAbsolute) | cast(attrib, Int), useAbsolute);
#else
return 0;
#end
@@ -77,9 +77,9 @@ class NativeAPI {
/**
* Removes from the specified file's (or folder) one (or more) specific attribute.
*/
public static function removeFileAttributes(path:String, attrib:OneOfTwo<NativeAPI.FileAttribute, Int>, useAbsol:Bool = true):Int {
public static function removeFileAttributes(path:String, attrib:OneOfTwo<NativeAPI.FileAttribute, Int>, useAbsolute:Bool = true):Int {
#if windows
return setFileAttributes(path, getFileAttributesRaw(path, useAbsol) & ~cast(attrib, Int), useAbsol);
return setFileAttributes(path, getFileAttributesRaw(path, useAbsolute) & ~cast(attrib, Int), useAbsolute);
#else
return 0;
#end