⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 memoryfilestream.h

📁 自己写的一个IO库
💻 H
字号:

/*------------------------------------------------------------------------------

  @filename : MemoryFileStream.h


/********************************************************************************


*/


#ifndef _MEMORYFILE_H_
#define _MEMORYFILE_H_

#include <cstdio>
#include <cstdlib>
#include <memory>

#include "IFileStream.h"

namespace IMS_IO
{
	class CMemoryFileStream : public IFileStream  
	{
		struct SHead
		{
			SHead()
			{
				this->nLength = 0;
				this->nCurPos = 0;
				this->pContent = 0;
				this->bClose   = false;
				this->bClose   = false;
			}

			long nLength;
			long nCurPos;   //当前位置
			bool bOPen  ;   //是否打开了
			bool bClose ;   //是否关闭了
			unsigned char *pContent;
		};

	public:
		CMemoryFileStream();
		virtual ~CMemoryFileStream();
	
	public:
		bool open(const char *pHandler,int length,char *pFlag);
	
		int seek(long offset,int origin);

		int read(void *pBuffer,int size,int count);

		bool close();

		long length();

		long getPos();
	public :
		SHead  m_memFileHandler ;
	};
}

#endif 

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -