From c24b20b9d20bfa2d648e51152eb8182fb4537f03 Mon Sep 17 00:00:00 2001 From: Edouard DUPIN Date: Wed, 13 Nov 2013 21:52:12 +0100 Subject: [PATCH] [DEV] correction of stl-port --- exml/Attribute.cpp | 6 +++--- exml/Comment.cpp | 2 +- exml/Element.cpp | 10 +++++----- exml/Text.cpp | 4 ++-- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/exml/Attribute.cpp b/exml/Attribute.cpp index 746f806..453960e 100644 --- a/exml/Attribute.cpp +++ b/exml/Attribute.cpp @@ -47,7 +47,7 @@ bool exml::Attribute::iParse(const std::string& _data, int32_t& _pos, bool _case break; } } - m_name = std::string(_data, _pos, lastElementName+1); + m_name = std::string(_data, _pos, lastElementName+1-(_pos)); if (true == _caseSensitive) { m_name = to_lower(m_name); } @@ -91,7 +91,7 @@ bool exml::Attribute::iParse(const std::string& _data, int32_t& _pos, bool _case 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 << "\""); @@ -110,7 +110,7 @@ bool exml::Attribute::iParse(const std::string& _data, int32_t& _pos, bool _case 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 << "\""); diff --git a/exml/Comment.cpp b/exml/Comment.cpp index 898eeef..8111936 100644 --- a/exml/Comment.cpp +++ b/exml/Comment.cpp @@ -41,7 +41,7 @@ bool exml::Comment::iParse(const std::string& _data, int32_t& _pos, bool _caseSe } } // 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 << "'"); _pos = iii+2; return true; diff --git a/exml/Element.cpp b/exml/Element.cpp index c390a53..938203b 100644 --- a/exml/Element.cpp +++ b/exml/Element.cpp @@ -219,7 +219,7 @@ bool exml::Element::subParse(const std::string& _data, int32_t& _pos, bool _case } 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) { 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]); } - 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) { tmpname = to_lower(tmpname); } @@ -359,13 +359,13 @@ bool exml::Element::subParse(const std::string& _data, int32_t& _pos, bool _case return false; } - if( true == checkAvaillable(_data[iii+white+1], true) ) { + if (checkAvaillable(_data[iii+white+1], true) == true) { ++tmpPos; //EXML_DEBUG("Generate node name : '" << _data[iii+1] << "'"); int32_t endPosName = iii+white+1; // generate element name ... 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 ... endPosName = jjj; } else { @@ -373,7 +373,7 @@ bool exml::Element::subParse(const std::string& _data, int32_t& _pos, bool _case } 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) { to_lower(tmpname); } diff --git a/exml/Text.cpp b/exml/Text.cpp index 72c5adc..2cb0703 100644 --- a/exml/Text.cpp +++ b/exml/Text.cpp @@ -51,7 +51,7 @@ bool exml::Text::iParse(const std::string& _data, int32_t& _pos, bool _caseSensi } } // 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 << "'"); _pos = iii-1; return true; @@ -78,7 +78,7 @@ bool exml::TextCDATA::iParse(const std::string& _data, int32_t& _pos, bool _case && _data[iii+2] == '>') { // find end of value: _filePos += 2; - m_value = std::string(_data, _pos, iii); + m_value = std::string(_data, _pos, iii-(_pos)); EXML_VERBOSE(" find text CDATA '" << m_value << "'"); _pos = iii+2; return true;