1 |
bearsoft |
1.1 |
#include "../../String/String.h"
|
2 |
|
|
#include "../../String/StringInput.h"
|
3 |
|
|
#include "../../System/System.h"
|
4 |
|
|
#include "StringTest5.h"
|
5 |
|
|
#include "../../System/SystemDefine.h"
|
6 |
|
|
|
7 |
|
|
StringTest5::StringTest5(){}
|
8 |
|
|
StringTest5::~StringTest5(){}
|
9 |
|
|
|
10 |
|
|
void StringTest5::run()
|
11 |
|
|
{
|
12 |
|
|
StringInput *stringInput=new StringInput();
|
13 |
|
|
|
14 |
|
|
stringInput->readFile("data/test.txt");
|
15 |
|
|
|
16 |
|
|
// stringInput->dontDefragMemory(1000); // select this if you want to have intern word buffer == less malloc, free
|
17 |
|
|
|
18 |
|
|
String kalle="kalle";
|
19 |
|
|
|
20 |
|
|
if (stringInput->findWord(kalle.buffer))
|
21 |
|
|
{
|
22 |
|
|
System::println("true");
|
23 |
|
|
}
|
24 |
|
|
|
25 |
|
|
stringInput->resetScanWord(); //moves the pointer to the begining of the string buffer again
|
26 |
|
|
|
27 |
|
|
delete stringInput;
|
28 |
|
|
|
29 |
|
|
|
30 |
|
|
|
31 |
|
|
} |