You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
57 lines
1.2 KiB
C++
57 lines
1.2 KiB
C++
/////////////////////////////////////////////////////////////////////////////
|
|
//主要功能:
|
|
// SegY读写类
|
|
//
|
|
//程序编写: 2008-11-09
|
|
//
|
|
//
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
#pragma once
|
|
#include "filesegy.h"
|
|
#include ".\filemapping.h"
|
|
|
|
namespace NFile64
|
|
{
|
|
|
|
class CFileSegyMapping :
|
|
public CFileSegy
|
|
{
|
|
public:
|
|
CFileSegyMapping(void);
|
|
virtual ~CFileSegyMapping(void);
|
|
|
|
virtual BOOL Open(LPCTSTR lpFileName);
|
|
virtual __int64 Seek(__int64 offset, int origin);
|
|
virtual UINT Read(void* lpBuf, UINT nCount);
|
|
virtual void Close(void);
|
|
virtual BOOL IsOpen(void);
|
|
|
|
BOOL IsMappingOpen(void);
|
|
BOOL IsRemapping(ULONGLONG offset);
|
|
CFileMapping* GetFileMapping(void);
|
|
void SetRemappingSize(DWORD nSize); //设置重新映射尺寸,当分段映射时如果所读的位置到映射结尾不足指定长度时重新映射,缺省为1M
|
|
void SetMappingSize(DWORD nSize); //设置一次映射的长度,缺省为512M
|
|
|
|
protected:
|
|
CFileMapping* m_pfMap;
|
|
ULONGLONG m_ulFileLength;
|
|
DWORD m_nRemappingSize;
|
|
DWORD m_nMappingSize;
|
|
};
|
|
|
|
};
|
|
|
|
inline CFileMapping* CFileSegyMapping::GetFileMapping(void)
|
|
{
|
|
return m_pfMap;
|
|
}
|
|
|
|
inline BOOL CFileSegyMapping::IsMappingOpen(void)
|
|
{
|
|
if(m_pfMap)
|
|
if(m_pfMap->IsOpen()) return TRUE;
|
|
return FALSE;
|
|
}
|