当前位置: 首页>>代码示例>>C++>>正文


C++ FileHandle::GetPointer方法代码示例

本文整理汇总了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;
}
开发者ID:wangscript,项目名称:RadonFramework,代码行数:7,代码来源:FileSystemWindows.cpp

示例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;
}
开发者ID:wangscript,项目名称:RadonFramework,代码行数:9,代码来源:FileSystemWindows.cpp

示例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;
}
开发者ID:wangscript,项目名称:RadonFramework,代码行数:9,代码来源:FileSystemWindows.cpp

示例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;
}
开发者ID:wangscript,项目名称:RadonFramework,代码行数:10,代码来源:FileSystemWindows.cpp

示例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;
}
开发者ID:wangscript,项目名称:RadonFramework,代码行数:10,代码来源:FileSystemWindows.cpp

示例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;
}
开发者ID:wangscript,项目名称:RadonFramework,代码行数:14,代码来源:FileSystemWindows.cpp

示例7: FlushFile

Bool FlushFile(const FileHandle& Handle)
{
    return ::FlushFileBuffers(reinterpret_cast<HANDLE>(Handle.GetPointer())) == TRUE;
}
开发者ID:wangscript,项目名称:RadonFramework,代码行数:4,代码来源:FileSystemWindows.cpp


注:本文中的FileHandle::GetPointer方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。