This commit is contained in:
2026-02-08 16:20:50 +08:00
parent 0ae47e5d6a
commit 8b88904ef7
72 changed files with 5963 additions and 2038 deletions

View File

@@ -31,6 +31,18 @@ int Ifstream_NPK::ReadInt()
return Count;
}
unsigned int Ifstream_NPK::ReadUnsignedInt()
{
char *CountBuffer = new char[4];
for (int i = 0; i < 4; i++)
{
this->get(CountBuffer[i]);
}
unsigned int Count = *(unsigned int *)CountBuffer;
delete[] CountBuffer;
return Count;
}
// 读字符串
std::string Ifstream_NPK::ReadString()
{
@@ -60,7 +72,7 @@ std::string Ifstream_NPK::ReadInfo()
}
// 读LONG
int Ifstream_NPK::ReadLong()
long Ifstream_NPK::ReadLong()
{
char *CountBuffer = new char[8];
for (int i = 0; i < 8; i++)
@@ -72,6 +84,18 @@ int Ifstream_NPK::ReadLong()
return Count;
}
unsigned long Ifstream_NPK::ReadUnsignedLong()
{
char *CountBuffer = new char[8];
for (int i = 0; i < 8; i++)
{
this->get(CountBuffer[i]);
}
unsigned long Count = *(unsigned long *)CountBuffer;
delete[] CountBuffer;
return Count;
}
// 读指定长度数据
BYTE *Ifstream_NPK::ReadCustomSize(int Size)
{

View File

@@ -22,6 +22,9 @@ public:
// 读整数
int ReadInt();
// 读无符号整数
unsigned int ReadUnsignedInt();
// 读字符串
std::string ReadString();
@@ -29,7 +32,9 @@ public:
std::string ReadInfo();
// 读LONG
int ReadLong();
long ReadLong();
// 读取无符号long
unsigned long ReadUnsignedLong();
// 读指定长度数据
BYTE *ReadCustomSize(int Size);