[DEV] change the parsing idea ...
This commit is contained in:
parent
7f2ddd4d56
commit
5167ae2332
@ -62,26 +62,53 @@ int32_t exml::EXmlElement::Parse(const etk::UString& _data, int32_t _pos, bool _
|
|||||||
// TODO : an error occured ...
|
// TODO : an error occured ...
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (_data[iii+1] == '?') {
|
// find the end of the balise :
|
||||||
|
int32_t endPos = iii;
|
||||||
|
for (int32_t jjj=iii+1; jjj<_data.Size(); jjj++) {
|
||||||
|
if(_data[jjj] == ">") {
|
||||||
|
endPos = jjj;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (endPos == iii) {
|
||||||
|
// TODO : an error occured ...
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
int32_t sizeElement = endPos-iii;
|
||||||
|
if( sizeElement>2
|
||||||
|
&& _data[iii+1] == '?'
|
||||||
|
&& _data[endPos-1] == '?') {
|
||||||
// find declaration
|
// find declaration
|
||||||
|
|
||||||
// TODO : search end of declaration ...
|
// TODO : ...
|
||||||
|
|
||||||
|
iii = endPos
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if(_data[iii+1] == '!') {
|
if( sizeElement>5
|
||||||
if( iii+3>=_data.Size()
|
&& _data[iii+1] == '!'
|
||||||
|| _data[iii+2] != '-'
|
&& _data[iii+2] == '-'
|
||||||
|| _data[iii+3] != '-') {
|
&& _data[iii+3] == '-'
|
||||||
|
&& _data[endPos-2] == '-'
|
||||||
// TODO : an error occured ...
|
&& _data[endPos-1] == '-') {
|
||||||
return;
|
|
||||||
}
|
|
||||||
// find comment
|
// find comment
|
||||||
|
// TODO : Change the end parsing ...
|
||||||
|
|
||||||
// TODO : search end of comment ...
|
|
||||||
|
// TODO : ...
|
||||||
|
|
||||||
|
iii = endPos
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
// find a normal node ...
|
// find a normal node ...
|
||||||
|
// TODO : ...
|
||||||
|
for (int32_t jjj=iii+1; jjj<_data.Size(); jjj++) {
|
||||||
|
if(_data[jjj] == ">") {
|
||||||
|
// we find the end ...
|
||||||
|
iii = jjj;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
// might to be data text ...
|
// might to be data text ...
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user