1 |
#include "../../String/String.h"
|
2 |
#include "../../String/StringInput.h"
|
3 |
#include "../../System/System.h"
|
4 |
#include "StringTest2.h"
|
5 |
#include "../../System/SystemDefine.h"
|
6 |
|
7 |
StringTest2::StringTest2(){}
|
8 |
StringTest2::~StringTest2(){}
|
9 |
|
10 |
void StringTest2::run()
|
11 |
{
|
12 |
StringInput *stringInput = new StringInput();
|
13 |
|
14 |
stringInput->readFile("data/motion.txt");
|
15 |
|
16 |
stringInput->dontDefragMemory(1000); // select this if you want to have intern word buffer == less malloc, free
|
17 |
|
18 |
int howMany=4;
|
19 |
|
20 |
while(stringInput->getScanWordStatus())
|
21 |
{
|
22 |
float *fbuffer=stringInput->findWordReturnFloats("ObjectMotion",2,howMany);
|
23 |
|
24 |
if ( fbuffer != null )
|
25 |
{
|
26 |
for ( int r=0; r<howMany ; r++ )
|
27 |
{
|
28 |
System::println(fbuffer[r]);
|
29 |
}
|
30 |
}
|
31 |
}
|
32 |
|
33 |
stringInput->resetScanWord();
|
34 |
|
35 |
float *fbuffer=stringInput->findWordReturnFloats("ObjectMotion",2,howMany);
|
36 |
|
37 |
if ( fbuffer != null )
|
38 |
{
|
39 |
for ( int r=0; r<howMany ; r++ )
|
40 |
{
|
41 |
String floatName="floatValue ";
|
42 |
// String result=floatName + Parse::floatToString(fbuffer[r]);
|
43 |
// System::println(result.buffer);
|
44 |
}
|
45 |
}
|
46 |
|
47 |
stringInput->resetScanWord(); //moves the pointer to the begining of the string buffer again
|
48 |
|
49 |
delete stringInput;
|
50 |
|
51 |
|
52 |
} |