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

📄 text.h

📁 一个小的非常好用的电子书阅读器源码
💻 H
字号:
#ifndef __Text_h#define __Text_h#include <stdio.h>#include <sys/stat.h>class Text: public CExpander {  FILE* file;public:  Text() : file(NULL) {};  virtual ~Text() { if (file != NULL) fclose(file); }  virtual int openfile(char *src)    {      if (file != NULL) fclose(file);      return ((file = fopen(src,"rb")) == NULL);    }  virtual int getch() { return fgetc(file); }  virtual unsigned int locate() { return ftell(file); }  virtual void locate(unsigned int n) { fseek(file,n,SEEK_SET); }  virtual bool hasrandomaccess() { return true; }  virtual void sizes(unsigned long& _file, unsigned long& _text)    {      struct stat _stat;      fstat(fileno(file),&_stat);      _text = _file = _stat.st_size;    }};#endif

⌨️ 快捷键说明

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