[DEV] correction of stl-port

This commit is contained in:
Edouard DUPIN 2013-11-13 21:52:12 +01:00
parent 4d02dd677e
commit c24b20b9d2
4 changed files with 11 additions and 11 deletions

View File

@ -47,7 +47,7 @@ bool exml::Attribute::iParse(const std::string& _data, int32_t& _pos, bool _case
break; break;
} }
} }
m_name = std::string(_data, _pos, lastElementName+1); m_name = std::string(_data, _pos, lastElementName+1-(_pos));
if (true == _caseSensitive) { if (true == _caseSensitive) {
m_name = to_lower(m_name); m_name = to_lower(m_name);
} }
@ -91,7 +91,7 @@ bool exml::Attribute::iParse(const std::string& _data, int32_t& _pos, bool _case
break; break;
} }
} }
m_value = std::string(_data, lastElementName+white+2, lastAttributePos); m_value = std::string(_data, lastElementName+white+2, lastAttributePos-(lastElementName+white+2));
EXML_PARSE_ATTRIBUTE(m_pos << " attribute : " << m_name << "=\"" << m_value << "\""); EXML_PARSE_ATTRIBUTE(m_pos << " attribute : " << m_name << "=\"" << m_value << "\"");
@ -110,7 +110,7 @@ bool exml::Attribute::iParse(const std::string& _data, int32_t& _pos, bool _case
break; break;
} }
} }
m_value = std::string(_data, lastElementName+white+3, lastAttributePos); m_value = std::string(_data, lastElementName+white+3, lastAttributePos-(lastElementName+white+3));
EXML_PARSE_ATTRIBUTE(m_pos << " attribute : " << m_name << "=\"" << m_value << "\""); EXML_PARSE_ATTRIBUTE(m_pos << " attribute : " << m_name << "=\"" << m_value << "\"");

View File

@ -41,7 +41,7 @@ bool exml::Comment::iParse(const std::string& _data, int32_t& _pos, bool _caseSe
} }
} }
// find end of value: // find end of value:
m_value = std::string(_data, _pos+white, newEnd); m_value = std::string(_data, _pos+white, newEnd-(_pos+white));
EXML_VERBOSE(" find comment '" << m_value << "'"); EXML_VERBOSE(" find comment '" << m_value << "'");
_pos = iii+2; _pos = iii+2;
return true; return true;

View File

@ -219,7 +219,7 @@ bool exml::Element::subParse(const std::string& _data, int32_t& _pos, bool _case
} }
tmpPos.check(_data[jjj]); tmpPos.check(_data[jjj]);
} }
std::string tmpname = std::string(_data, iii+white+2, endPosName+1); std::string tmpname = std::string(_data, iii+white+2, endPosName+1-(iii+white+2));
if (true == _caseSensitive) { if (true == _caseSensitive) {
tmpname = to_lower(tmpname); tmpname = to_lower(tmpname);
} }
@ -322,7 +322,7 @@ bool exml::Element::subParse(const std::string& _data, int32_t& _pos, bool _case
} }
tmpPos.check(_data[jjj]); tmpPos.check(_data[jjj]);
} }
std::string tmpname = std::string(_data, iii+white+2, endPosName+1); std::string tmpname = std::string(_data, iii+white+2, endPosName+1-(iii+white+2));
if (true == _caseSensitive) { if (true == _caseSensitive) {
tmpname = to_lower(tmpname); tmpname = to_lower(tmpname);
} }
@ -359,13 +359,13 @@ bool exml::Element::subParse(const std::string& _data, int32_t& _pos, bool _case
return false; return false;
} }
if( true == checkAvaillable(_data[iii+white+1], true) ) { if (checkAvaillable(_data[iii+white+1], true) == true) {
++tmpPos; ++tmpPos;
//EXML_DEBUG("Generate node name : '" << _data[iii+1] << "'"); //EXML_DEBUG("Generate node name : '" << _data[iii+1] << "'");
int32_t endPosName = iii+white+1; int32_t endPosName = iii+white+1;
// generate element name ... // generate element name ...
for (int32_t jjj=iii+white+2; jjj<_data.size(); jjj++) { for (int32_t jjj=iii+white+2; jjj<_data.size(); jjj++) {
if(true == checkAvaillable(_data[jjj], false) ) { if(checkAvaillable(_data[jjj], false) == true) {
// we find the end ... // we find the end ...
endPosName = jjj; endPosName = jjj;
} else { } else {
@ -373,7 +373,7 @@ bool exml::Element::subParse(const std::string& _data, int32_t& _pos, bool _case
} }
tmpPos.check(_data[jjj]); tmpPos.check(_data[jjj]);
} }
std::string tmpname = std::string(_data, iii+white+1, endPosName+1); std::string tmpname = std::string(_data, iii+white+1, endPosName+1-(iii+white+1));
if (true == _caseSensitive) { if (true == _caseSensitive) {
to_lower(tmpname); to_lower(tmpname);
} }

View File

@ -51,7 +51,7 @@ bool exml::Text::iParse(const std::string& _data, int32_t& _pos, bool _caseSensi
} }
} }
// find end of value: // find end of value:
m_value = std::string(_data, _pos, newEnd); m_value = std::string(_data, _pos, newEnd-(_pos));
EXML_VERBOSE(" find text '" << m_value << "'"); EXML_VERBOSE(" find text '" << m_value << "'");
_pos = iii-1; _pos = iii-1;
return true; return true;
@ -78,7 +78,7 @@ bool exml::TextCDATA::iParse(const std::string& _data, int32_t& _pos, bool _case
&& _data[iii+2] == '>') { && _data[iii+2] == '>') {
// find end of value: // find end of value:
_filePos += 2; _filePos += 2;
m_value = std::string(_data, _pos, iii); m_value = std::string(_data, _pos, iii-(_pos));
EXML_VERBOSE(" find text CDATA '" << m_value << "'"); EXML_VERBOSE(" find text CDATA '" << m_value << "'");
_pos = iii+2; _pos = iii+2;
return true; return true;