推
This commit is contained in:
@@ -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)
|
||||
{
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user