37 lines
557 B
C++
37 lines
557 B
C++
#pragma once
|
|
#include <fstream>
|
|
#include <string>
|
|
|
|
typedef unsigned char BYTE;
|
|
|
|
class Ifstream_NPK : public std::ifstream
|
|
{
|
|
private:
|
|
const BYTE Key[256];
|
|
|
|
public:
|
|
// 构造函数
|
|
Ifstream_NPK();
|
|
|
|
// char* 转整数
|
|
int CharToInt(char *Str);
|
|
|
|
// char* 转Long
|
|
long CharToLong(char *Str);
|
|
|
|
// 读整数
|
|
int ReadInt();
|
|
|
|
// 读字符串
|
|
std::string ReadString();
|
|
|
|
// 读取信息
|
|
std::string ReadInfo();
|
|
|
|
// 读LONG
|
|
int ReadLong();
|
|
|
|
// 读指定长度数据
|
|
BYTE *ReadCustomSize(int Size);
|
|
};
|