本文整理汇总了C++中FileHandle::GetPointer方法的典型用法代码示例。如果您正苦于以下问题:C++ FileHandle::GetPointer方法的具体用法?C++ FileHandle::GetPointer怎么用?C++ FileHandle::GetPointer使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FileHandle
的用法示例。
在下文中一共展示了FileHandle::GetPointer方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: CloseFile
Bool CloseFile(FileHandle& Handle)
{
HANDLE file=reinterpret_cast<HANDLE>(Handle.GetPointer());
Bool result=static_cast<Bool>(CloseHandle(file) == TRUE);
Handle=FileHandle::Zero();
return result;
}
示例2: TellFile
UInt64 TellFile(const FileHandle& Handle)
{
long hi=0, lo;
lo=SetFilePointer(reinterpret_cast<HANDLE>(Handle.GetPointer()), 0, &hi, FILE_CURRENT);
if (lo!=INVALID_SET_FILE_POINTER)
return (static_cast<UInt64>(hi) << 32) + lo;
else
return 0;
}
示例3: SeekFile
UInt64 SeekFile(const FileHandle& Handle, const UInt64 Offset, const SeekOrigin::Type Origin)
{
long hi=static_cast<long>(Offset), lo=Offset>>32;
lo=SetFilePointer(reinterpret_cast<HANDLE>(Handle.GetPointer()), lo, &hi, GetNativeSeekOrigin(Origin));
if (lo!=INVALID_SET_FILE_POINTER)
return (static_cast<UInt64>(hi) << 32) + lo;
else
return 0;
}
示例4: WriteFile
Bool WriteFile(const FileHandle& Handle, const UInt8* Buffer, const UInt64 WriteBytes, UInt64& BytesWritten)
{
DWORD lowWriteBytes = 0;
BOOL result = ::WriteFile(reinterpret_cast<HANDLE>(Handle.GetPointer()),
reinterpret_cast<const void*>(Buffer), static_cast<DWORD>(WriteBytes),
reinterpret_cast<DWORD*>(&lowWriteBytes),
reinterpret_cast<LPOVERLAPPED>(0)) == TRUE;
BytesWritten = lowWriteBytes;
return result == TRUE;
}
示例5: ReadFile
Bool ReadFile(const FileHandle& Handle, UInt8* Buffer, const UInt64 ReadBytes, UInt64& BytesRead)
{
DWORD lowReadBytes=0;
BOOL result = ::ReadFile(reinterpret_cast<HANDLE>(Handle.GetPointer()),
reinterpret_cast<void*>(Buffer), static_cast<DWORD>(ReadBytes),
reinterpret_cast<DWORD*>(&lowReadBytes),
reinterpret_cast<LPOVERLAPPED>(0)) == TRUE;
BytesRead = lowReadBytes;
return result == TRUE;
}
示例6: MapFileIntoMemory
MemoryMappingHandle MapFileIntoMemory(const FileHandle& Handle)
{
MemoryMappingHandle result;
HANDLE file=CreateFileMapping(reinterpret_cast<HANDLE>(Handle.GetPointer()),
0, PAGE_READWRITE | SEC_RESERVE, 0, 0, 0);
if (file)
{
FileMapping* fileMapping=new FileMapping;
fileMapping->fileMapping=file;
fileMapping->data=MapViewOfFile(file, FILE_MAP_WRITE|FILE_MAP_READ, 0, 0, 0);
result=MemoryMappingHandle::GenerateFromPointer(fileMapping);
}
return result;
}
示例7: FlushFile
Bool FlushFile(const FileHandle& Handle)
{
return ::FlushFileBuffers(reinterpret_cast<HANDLE>(Handle.GetPointer())) == TRUE;
}