/[cvs]/api/Classes/Examples/String/StringTest2.cpp
ViewVC logotype

Contents of /api/Classes/Examples/String/StringTest2.cpp

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1.1.1 - (show annotations) (vendor branch)
Sun Jul 1 20:47:58 2001 UTC (23 years, 4 months ago) by bearsoft
Branch: lazy, MAIN
CVS Tags: start, HEAD
Changes since 1.1: +0 -0 lines
First import

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 }

root@recompile.se
ViewVC Help
Powered by ViewVC 1.1.26