[-] OS specific types derived from AFileHandle
This commit is contained in:
parent
5555e99488
commit
c5ab03cbfc
@ -93,12 +93,7 @@ namespace Aurora::IO
|
||||
}
|
||||
}
|
||||
|
||||
struct NTIOHandle final : AFileHandle
|
||||
{
|
||||
bool InitFromPath(HandleCreate create) override;
|
||||
};
|
||||
|
||||
bool NTIOHandle::InitFromPath(HandleCreate create)
|
||||
bool AFileHandle::InitFromPath(HandleCreate create)
|
||||
{
|
||||
HANDLE hFileHandle;
|
||||
|
||||
@ -367,16 +362,4 @@ namespace Aurora::IO
|
||||
|
||||
return dwType == FILE_TYPE_DISK;
|
||||
}
|
||||
|
||||
AUKN_SYM IIOHandle *IOHandleNew()
|
||||
{
|
||||
return _new NTIOHandle();
|
||||
}
|
||||
|
||||
AUKN_SYM void IOHandleRelease(IIOHandle *pIOHandle)
|
||||
{
|
||||
AuSafeDelete<NTIOHandle *>(pIOHandle);
|
||||
}
|
||||
|
||||
AUROXTL_INTERFACE_SOO_SRC_EX(AURORA_SYMBOL_EXPORT, IOHandle, NTIOHandle)
|
||||
}
|
@ -104,12 +104,7 @@ namespace Aurora::IO
|
||||
this->uOSReadHandle = this->uOSWriteHandle = DupHandle(bError ? STDERR_FILENO : STDOUT_FILENO, true, bSharing);
|
||||
}
|
||||
|
||||
struct UnixIOHandle final : AFileHandle
|
||||
{
|
||||
bool InitFromPath(HandleCreate create) override;
|
||||
};
|
||||
|
||||
bool UnixIOHandle::InitFromPath(HandleCreate create)
|
||||
bool AFileHandle::InitFromPath(HandleCreate create)
|
||||
{
|
||||
int iFileDescriptor { -1 };
|
||||
|
||||
@ -274,16 +269,4 @@ namespace Aurora::IO
|
||||
|
||||
return S_ISREG(st.st_mode);
|
||||
}
|
||||
|
||||
AUKN_SYM IIOHandle *IOHandleNew()
|
||||
{
|
||||
return _new UnixIOHandle();
|
||||
}
|
||||
|
||||
AUKN_SYM void IOHandleRelease(IIOHandle *pIOHandle)
|
||||
{
|
||||
AuSafeDelete<UnixIOHandle *>(pIOHandle);
|
||||
}
|
||||
|
||||
AUROXTL_INTERFACE_SOO_SRC_EX(AURORA_SYMBOL_EXPORT, IOHandle, UnixIOHandle)
|
||||
}
|
@ -286,4 +286,16 @@ namespace Aurora::IO
|
||||
{
|
||||
return FS::UnapplyFileSectionLock(AuUnsafeRaiiToShared(this), uOffset, uLength);
|
||||
}
|
||||
|
||||
AUKN_SYM IIOHandle *IOHandleNew()
|
||||
{
|
||||
return _new AFileHandle();
|
||||
}
|
||||
|
||||
AUKN_SYM void IOHandleRelease(IIOHandle *pIOHandle)
|
||||
{
|
||||
AuSafeDelete<AFileHandle *>(pIOHandle);
|
||||
}
|
||||
|
||||
AUROXTL_INTERFACE_SOO_SRC_EX(AURORA_SYMBOL_EXPORT, IOHandle, AFileHandle)
|
||||
}
|
@ -32,6 +32,8 @@ namespace Aurora::IO
|
||||
|
||||
bool InitFromStreamEnum(EStandardStream eStream) override;
|
||||
|
||||
bool InitFromPath(HandleCreate create) override;
|
||||
|
||||
AuUInt64 GetOSHandle() override;
|
||||
|
||||
AuOptionalEx<AuUInt64> GetOSHandleSafe() override;
|
||||
|
Loading…
Reference in New Issue
Block a user