1 |
bearsoft |
1.1 |
#include "StringElement.h"
|
2 |
|
|
#include "../System/SystemDefine.h"
|
3 |
|
|
#include "../String/StringTools.h"
|
4 |
|
|
|
5 |
|
|
StringElement::StringElement(char *iBuffer, int iLength)
|
6 |
|
|
{
|
7 |
|
|
createElement(iBuffer, iLength);
|
8 |
|
|
}
|
9 |
|
|
|
10 |
|
|
StringElement::~StringElement()
|
11 |
|
|
{
|
12 |
|
|
free(buffer);
|
13 |
|
|
}
|
14 |
|
|
|
15 |
|
|
void StringElement::createElement(char *iBuffer, int iLength)
|
16 |
|
|
{
|
17 |
|
|
StringTools stringTools;
|
18 |
|
|
int size=(int)(sizeof(char)*iLength);
|
19 |
|
|
buffer=(char*)malloc(size+sizeof(char));
|
20 |
|
|
stringTools.copyString(iBuffer, size, buffer);
|
21 |
|
|
length=iLength;
|
22 |
|
|
} |