1 |
bearsoft |
1.1 |
#include "../../String/String.h"
|
2 |
|
|
#include "../../String/StringInput.h"
|
3 |
|
|
#include "../../System/System.h"
|
4 |
|
|
#include "../../Binary/BinaryInput.h"
|
5 |
|
|
#include "BinaryTest.h"
|
6 |
|
|
#include "../../System/SystemDefine.h"
|
7 |
|
|
|
8 |
|
|
|
9 |
|
|
BinaryTest::BinaryTest(){}
|
10 |
|
|
BinaryTest::~BinaryTest(){}
|
11 |
|
|
|
12 |
|
|
void BinaryTest::run()
|
13 |
|
|
{
|
14 |
|
|
BinaryInput *binaryInput=new BinaryInput();
|
15 |
|
|
binaryInput->setBigEndian(true);
|
16 |
|
|
binaryInput->readFile("data/kub.lwo");
|
17 |
|
|
|
18 |
|
|
System::println(binaryInput->getWord(4));
|
19 |
|
|
System::println(binaryInput->getInt());
|
20 |
|
|
System::println(binaryInput->getWord(4));
|
21 |
|
|
|
22 |
|
|
while (binaryInput->getBinaryStatus())
|
23 |
|
|
{
|
24 |
|
|
System::println(binaryInput->getWord(4));
|
25 |
|
|
int jumpValue=binaryInput->getInt();
|
26 |
|
|
if (jumpValue!=0)
|
27 |
|
|
{
|
28 |
|
|
System::println(jumpValue);
|
29 |
|
|
}
|
30 |
|
|
|
31 |
|
|
binaryInput->jumpForward(jumpValue);
|
32 |
|
|
}
|
33 |
|
|
|
34 |
|
|
|
35 |
|
|
delete binaryInput;
|
36 |
|
|
|
37 |
|
|
|
38 |
|
|
|
39 |
|
|
} |