From 7ae4ea7215d688ea18b8983912b78dfa7015ebd5 Mon Sep 17 00:00:00 2001 From: Edouard DUPIN Date: Tue, 19 Jun 2018 22:13:47 +0200 Subject: [PATCH] [DEV] update etk null --- exml/Attribute.cpp | 24 +++++++------- exml/Attribute.hpp | 2 +- exml/AttributeList.cpp | 38 +++++++++++----------- exml/AttributeList.hpp | 4 +-- exml/Comment.cpp | 4 +-- exml/Declaration.cpp | 8 ++--- exml/Document.cpp | 44 +++++++++++++------------- exml/Element.cpp | 24 +++++++------- exml/Element.hpp | 4 +-- exml/Node.cpp | 26 +++++++-------- exml/Node.hpp | 24 +++++++------- exml/Text.cpp | 4 +-- exml/internal/AttributeList.cpp | 20 ++++++------ exml/internal/Declaration.cpp | 2 +- exml/internal/Document.cpp | 2 +- exml/internal/Element.cpp | 56 ++++++++++++++++----------------- exml/internal/Node.cpp | 24 +++++++------- exml/internal/Node.hpp | 24 +++++++------- 18 files changed, 167 insertions(+), 167 deletions(-) diff --git a/exml/Attribute.cpp b/exml/Attribute.cpp index 8d415ed..2de081f 100644 --- a/exml/Attribute.cpp +++ b/exml/Attribute.cpp @@ -10,12 +10,12 @@ exml::Attribute::Attribute(ememory::SharedPtr _internalNode) : exml::Node(_internalNode) { - if (m_data == nullptr) { + if (m_data == null) { return; } if (m_data->isAttribute() == false) { // try to set wrong type inside ... ==> remove it ... - m_data = nullptr; + m_data = null; } } @@ -24,8 +24,8 @@ exml::Attribute::Attribute(const exml::Attribute& _obj) : } /* -exml::Attribute::Attribute(nullptr) : - exml::Node(nullptr) { +exml::Attribute::Attribute(null) : + exml::Node(null) { } */ @@ -40,33 +40,33 @@ exml::Attribute& exml::Attribute::operator= (const exml::Attribute& _obj) { } void exml::Attribute::setName(const etk::String& _name){ - if (m_data == nullptr) { - EXML_DEBUG(" can not setName (nullptr) ..."); + if (m_data == null) { + EXML_DEBUG(" can not setName (null) ..."); return; } static_cast(m_data.get())->setName(_name); } const etk::String& exml::Attribute::getName() const { - if (m_data == nullptr) { + if (m_data == null) { static etk::String errorValue = ""; - EXML_DEBUG(" can not setName (nullptr) ..."); + EXML_DEBUG(" can not setName (null) ..."); return errorValue; } return static_cast(m_data.get())->getName(); } void exml::Attribute::clear() { - if (m_data == nullptr) { - EXML_DEBUG(" can not setName (nullptr) ..."); + if (m_data == null) { + EXML_DEBUG(" can not setName (null) ..."); return; } static_cast(m_data.get())->clear(); } etk::Pair exml::Attribute::getPair() const { - if (m_data == nullptr) { - EXML_DEBUG(" can not setName (nullptr) ..."); + if (m_data == null) { + EXML_DEBUG(" can not setName (null) ..."); return etk::Pair("",""); } return etk::Pair(static_cast(m_data.get())->getName(), diff --git a/exml/Attribute.hpp b/exml/Attribute.hpp index 1480151..11b2344 100644 --- a/exml/Attribute.hpp +++ b/exml/Attribute.hpp @@ -28,7 +28,7 @@ namespace exml { * @brief Copy constructor * @param[in] _obj Object to copy */ - // TODO : Attribute(nullptr); + // TODO : Attribute(null); /** * @brief Copy constructor * @param[in] _obj Object to copy diff --git a/exml/AttributeList.cpp b/exml/AttributeList.cpp index 7344466..97c2fcd 100644 --- a/exml/AttributeList.cpp +++ b/exml/AttributeList.cpp @@ -27,7 +27,7 @@ exml::AttributeListData::AttributeListData(exml::AttributeList* _list) : } size_t exml::AttributeListData::size() const { - if (m_data->m_data == nullptr) { + if (m_data->m_data == null) { EXML_DEBUG(" can not sizeAttribute ..."); return 0; } @@ -36,40 +36,40 @@ size_t exml::AttributeListData::size() const { } exml::Attribute exml::AttributeListData::operator[] (int32_t _id) { - if (m_data->m_data == nullptr) { - EXML_DEBUG(" can not getAttr (nullptr) ..."); - return exml::Attribute(ememory::SharedPtr(nullptr)); + if (m_data->m_data == null) { + EXML_DEBUG(" can not getAttr (null) ..."); + return exml::Attribute(ememory::SharedPtr(null)); } return exml::Attribute(static_cast(m_data->m_data.get())->getAttr(_id)); } const exml::Attribute exml::AttributeListData::operator[] (int32_t _id) const { - if (m_data->m_data == nullptr) { - EXML_DEBUG(" can not getAttr (nullptr) ..."); - return exml::Attribute(ememory::SharedPtr(nullptr)); + if (m_data->m_data == null) { + EXML_DEBUG(" can not getAttr (null) ..."); + return exml::Attribute(ememory::SharedPtr(null)); } return exml::Attribute(static_cast(m_data->m_data.get())->getAttr(_id)); } etk::Pair exml::AttributeListData::getPair(int32_t _id) const { - if (m_data->m_data == nullptr) { - EXML_DEBUG(" can not getAttrPair (nullptr) ..."); + if (m_data->m_data == null) { + EXML_DEBUG(" can not getAttrPair (null) ..."); return etk::Pair("",""); } return static_cast(m_data->m_data.get())->getAttrPair(_id); } void exml::AttributeListData::add(exml::Attribute _attr) { - if (m_data->m_data == nullptr) { - EXML_DEBUG(" can not appendAttribute (nullptr) ..."); + if (m_data->m_data == null) { + EXML_DEBUG(" can not appendAttribute (null) ..."); return; } static_cast(m_data->m_data.get())->appendAttribute(_attr.getInternalAttribute()); } const etk::String& exml::AttributeListData::operator[](const etk::String& _name) const { - if (m_data->m_data == nullptr) { - EXML_DEBUG(" can not getAttribute (nullptr) ..."); + if (m_data->m_data == null) { + EXML_DEBUG(" can not getAttribute (null) ..."); static etk::String errorValue(""); return errorValue; } @@ -77,24 +77,24 @@ const etk::String& exml::AttributeListData::operator[](const etk::String& _name) } bool exml::AttributeListData::exist(const etk::String& _name) const { - if (m_data->m_data == nullptr) { - EXML_DEBUG(" can not getAttribute (nullptr) ..."); + if (m_data->m_data == null) { + EXML_DEBUG(" can not getAttribute (null) ..."); return false; } return static_cast(m_data->m_data.get())->existAttribute(_name); } bool exml::AttributeListData::remove(const etk::String& _name) { - if (m_data->m_data == nullptr) { - EXML_DEBUG(" can not removeAttribute (nullptr) ..."); + if (m_data->m_data == null) { + EXML_DEBUG(" can not removeAttribute (null) ..."); return false; } return static_cast(m_data->m_data.get())->removeAttribute(_name); } void exml::AttributeListData::set(const etk::String& _name, const etk::String& _value) { - if (m_data->m_data == nullptr) { - EXML_DEBUG(" can not setAttribute (nullptr) ..."); + if (m_data->m_data == null) { + EXML_DEBUG(" can not setAttribute (null) ..."); return; } static_cast(m_data->m_data.get())->setAttribute(_name, _value); diff --git a/exml/AttributeList.hpp b/exml/AttributeList.hpp index d1a1e2a..b9e9340 100644 --- a/exml/AttributeList.hpp +++ b/exml/AttributeList.hpp @@ -16,11 +16,11 @@ namespace exml { */ class AttributeListData { private: - exml::AttributeList* m_data; //!< Pointer on the Attribute list class (must not be nullptr) + exml::AttributeList* m_data; //!< Pointer on the Attribute list class (must not be null) public: /** * @brief Constructor on the AttributeListData class - * @param[in] _list Point on the parrent class (must not be nullptr) + * @param[in] _list Point on the parrent class (must not be null) */ AttributeListData(exml::AttributeList* _list); public: diff --git a/exml/Comment.cpp b/exml/Comment.cpp index ea2595d..6e67c7b 100644 --- a/exml/Comment.cpp +++ b/exml/Comment.cpp @@ -10,12 +10,12 @@ exml::Comment::Comment(ememory::SharedPtr _internalNode) : exml::Node(_internalNode) { - if (m_data == nullptr) { + if (m_data == null) { return; } if (m_data->isComment() == false) { // try to set wrong type inside ... ==> remove it ... - m_data = nullptr; + m_data = null; } } diff --git a/exml/Declaration.cpp b/exml/Declaration.cpp index 72ec36b..a568aef 100644 --- a/exml/Declaration.cpp +++ b/exml/Declaration.cpp @@ -10,12 +10,12 @@ exml::Declaration::Declaration(ememory::SharedPtr _internalNode) : exml::AttributeList(_internalNode) { - if (m_data == nullptr) { + if (m_data == null) { return; } if (m_data->isDeclaration() == false) { // try to set wrong type inside ... ==> remove it ... - m_data = nullptr; + m_data = null; } } @@ -39,13 +39,13 @@ exml::Declaration& exml::Declaration::operator= (const exml::Declaration& _obj) exml::DeclarationXML::DeclarationXML(ememory::SharedPtr _internalNode) : exml::Declaration(_internalNode) { - if (m_data == nullptr) { + if (m_data == null) { return; } // TODO: Do it better if (m_data->isDeclaration() == false) { // try to set wrong type inside ... ==> remove it ... - m_data = nullptr; + m_data = null; } } diff --git a/exml/Document.cpp b/exml/Document.cpp index ac59866..2c86a58 100644 --- a/exml/Document.cpp +++ b/exml/Document.cpp @@ -10,12 +10,12 @@ exml::Document::Document(ememory::SharedPtr _internalNode) : exml::Element(_internalNode) { - if (m_data == nullptr) { + if (m_data == null) { return; } if (m_data->isDocument() == false) { // try to set wrong type inside ... ==> remove it ... - m_data = nullptr; + m_data = null; } } @@ -35,80 +35,80 @@ exml::Document& exml::Document::operator= (const exml::Document& _obj) { } bool exml::Document::parse(const etk::String& _data) { - if (m_data == nullptr) { - EXML_DEBUG("Can not parse (nullptr) ..."); + if (m_data == null) { + EXML_DEBUG("Can not parse (null) ..."); return false; } return static_cast(m_data.get())->parse(_data); } bool exml::Document::generate(etk::String& _data) { - if (m_data == nullptr) { - EXML_DEBUG("Can not generate (nullptr) ..."); + if (m_data == null) { + EXML_DEBUG("Can not generate (null) ..."); return false; } return static_cast(m_data.get())->generate(_data); } bool exml::Document::load(const etk::String& _file) { - if (m_data == nullptr) { - EXML_DEBUG("Can not load (nullptr) ..."); + if (m_data == null) { + EXML_DEBUG("Can not load (null) ..."); return false; } return static_cast(m_data.get())->load(_file); } bool exml::Document::store(const etk::String& _file) { - if (m_data == nullptr) { - EXML_DEBUG("Can not store (nullptr) ..."); + if (m_data == null) { + EXML_DEBUG("Can not store (null) ..."); return false; } return static_cast(m_data.get())->store(_file); } void exml::Document::display() { - if (m_data == nullptr) { - EXML_DEBUG("Can not display (nullptr) ..."); + if (m_data == null) { + EXML_DEBUG("Can not display (null) ..."); return; } static_cast(m_data.get())->display(); } void exml::Document::setCaseSensitive(bool _val) { - if (m_data == nullptr) { - EXML_DEBUG("Can not setCaseSensitive (nullptr) ..."); + if (m_data == null) { + EXML_DEBUG("Can not setCaseSensitive (null) ..."); return; } static_cast(m_data.get())->setCaseSensitive(_val); } bool exml::Document::getCaseSensitive() const { - if (m_data == nullptr) { - EXML_DEBUG("Can not getCaseSensitive (nullptr) ..."); + if (m_data == null) { + EXML_DEBUG("Can not getCaseSensitive (null) ..."); return false; } return static_cast(m_data.get())->getCaseSensitive(); } void exml::Document::setDisplayError(bool _value){ - if (m_data == nullptr) { - EXML_DEBUG("Can not setDisplayError (nullptr) ..."); + if (m_data == null) { + EXML_DEBUG("Can not setDisplayError (null) ..."); return; } static_cast(m_data.get())->setDisplayError(_value); } bool exml::Document::getDisplayError() { - if (m_data == nullptr) { - EXML_DEBUG("Can not getDisplayError (nullptr) ..."); + if (m_data == null) { + EXML_DEBUG("Can not getDisplayError (null) ..."); return false; } return static_cast(m_data.get())->getDisplayError(); } void exml::Document::displayError() { - if (m_data == nullptr) { - EXML_DEBUG("Can not displayError (nullptr) ..."); + if (m_data == null) { + EXML_DEBUG("Can not displayError (null) ..."); return; } static_cast(m_data.get())->displayError(); diff --git a/exml/Element.cpp b/exml/Element.cpp index b22fc34..5a7e4e3 100644 --- a/exml/Element.cpp +++ b/exml/Element.cpp @@ -12,13 +12,13 @@ exml::Element::Element(const ememory::SharedPtr& _internalNode) : exml::AttributeList(_internalNode), nodes(this) { - if (m_data == nullptr) { + if (m_data == null) { return; } if ( m_data->isElement() == false && m_data->isDocument() == false) { // try to set wrong type inside ... ==> remove it ... - m_data = nullptr; + m_data = null; } } @@ -61,7 +61,7 @@ exml::ElementData::ElementData(exml::Element* _elem) : } size_t exml::ElementData::size() const { - if (m_data->m_data == nullptr) { + if (m_data->m_data == null) { EXML_DEBUG(" can not get type ..."); return 0; } @@ -69,7 +69,7 @@ size_t exml::ElementData::size() const { } enum exml::nodeType exml::ElementData::getType(int32_t _id) const { - if (m_data->m_data == nullptr) { + if (m_data->m_data == null) { EXML_DEBUG(" can not get type ..."); return exml::nodeType::unknow; } @@ -77,7 +77,7 @@ enum exml::nodeType exml::ElementData::getType(int32_t _id) const { } exml::Node exml::ElementData::operator[](int32_t _id) { - if (m_data->m_data == nullptr) { + if (m_data->m_data == null) { EXML_DEBUG(" can not get type ..."); return exml::Node(); } @@ -85,7 +85,7 @@ exml::Node exml::ElementData::operator[](int32_t _id) { } const exml::Node exml::ElementData::operator[](int32_t _id) const { - if (m_data->m_data == nullptr) { + if (m_data->m_data == null) { EXML_DEBUG(" can not get type ..."); return exml::Node(); } @@ -93,7 +93,7 @@ const exml::Node exml::ElementData::operator[](int32_t _id) const { } exml::Element exml::ElementData::operator[](const etk::String& _name) { - if (m_data->m_data == nullptr) { + if (m_data->m_data == null) { EXML_DEBUG(" can not get type ..."); return exml::Element(); } @@ -101,7 +101,7 @@ exml::Element exml::ElementData::operator[](const etk::String& _name) { } const exml::Element exml::ElementData::operator[] (const etk::String& _name) const { - if (m_data->m_data == nullptr) { + if (m_data->m_data == null) { EXML_DEBUG(" can not get type ..."); return exml::Element(); } @@ -109,7 +109,7 @@ const exml::Element exml::ElementData::operator[] (const etk::String& _name) con } void exml::ElementData::add(const exml::Node& _node) { - if (m_data->m_data == nullptr) { + if (m_data->m_data == null) { EXML_DEBUG(" can not APPEND on null element ..."); return; } @@ -117,7 +117,7 @@ void exml::ElementData::add(const exml::Node& _node) { } void exml::ElementData::remove(const etk::String& _nodeName) { - if (m_data->m_data == nullptr) { + if (m_data->m_data == null) { EXML_DEBUG(" can not APPEND on null element ..."); return; } @@ -125,7 +125,7 @@ void exml::ElementData::remove(const etk::String& _nodeName) { } etk::String exml::Element::getText() const { - if (m_data == nullptr) { + if (m_data == null) { EXML_DEBUG(" can not APPEND on null element ..."); return ""; } @@ -133,7 +133,7 @@ etk::String exml::Element::getText() const { } void exml::Element::clear() { - if (m_data == nullptr) { + if (m_data == null) { EXML_DEBUG(" can not CLEAR on null element ..."); return; } diff --git a/exml/Element.hpp b/exml/Element.hpp index f0dbec9..50f95cd 100644 --- a/exml/Element.hpp +++ b/exml/Element.hpp @@ -19,11 +19,11 @@ namespace exml { */ class ElementData { private: - exml::Element* m_data; //!< Pointer on the exml::Element class (must not be nullptr) + exml::Element* m_data; //!< Pointer on the exml::Element class (must not be null) public: /** * @brief constructor on the ElementData class - * @param[in] _list Get pointer on the exml::Element class (must not be nullptr) + * @param[in] _list Get pointer on the exml::Element class (must not be null) */ ElementData(exml::Element* _list); public: diff --git a/exml/Node.cpp b/exml/Node.cpp index 9b8d5de..23a14c1 100644 --- a/exml/Node.cpp +++ b/exml/Node.cpp @@ -31,26 +31,26 @@ exml::Node::Node(const ememory::SharedPtr& _internalNode) } exml::Node::Node() : - m_data(nullptr) { + m_data(null) { } bool exml::Node::exist() const { - if (m_data == nullptr) { + if (m_data == null) { return false; } return true; } exml::FilePos exml::Node::getPos() const { - if (m_data == nullptr) { + if (m_data == null) { return exml::FilePos(0,0); } return m_data->getPos(); } void exml::Node::setValue(etk::String _value) { - if (m_data == nullptr) { + if (m_data == null) { EXML_ERROR(" can not set value: '" << _value << "'"); return; } @@ -58,7 +58,7 @@ void exml::Node::setValue(etk::String _value) { } const etk::String& exml::Node::getValue() const { - if (m_data == nullptr) { + if (m_data == null) { static etk::String errorString = ""; EXML_DEBUG(" can not get value ..."); return errorString; @@ -67,7 +67,7 @@ const etk::String& exml::Node::getValue() const { } enum exml::nodeType exml::Node::getType() const { - if (m_data == nullptr) { + if (m_data == null) { EXML_DEBUG("Can not get type ..."); return exml::nodeType::unknow; } @@ -123,49 +123,49 @@ const exml::Text exml::Node::toText() const { } bool exml::Node::isDocument() const { - if (m_data == nullptr) { + if (m_data == null) { return false; } return m_data->isDocument(); } bool exml::Node::isAttribute() const { - if (m_data == nullptr) { + if (m_data == null) { return false; } return m_data->isAttribute(); } bool exml::Node::isComment() const { - if (m_data == nullptr) { + if (m_data == null) { return false; } return m_data->isComment(); } bool exml::Node::isDeclaration() const { - if (m_data == nullptr) { + if (m_data == null) { return false; } return m_data->isDeclaration(); } bool exml::Node::isElement() const { - if (m_data == nullptr) { + if (m_data == null) { return false; } return m_data->isElement() || m_data->isDocument(); } bool exml::Node::isText() const { - if (m_data == nullptr) { + if (m_data == null) { return false; } return m_data->isText(); } void exml::Node::clear() { - if (m_data == nullptr) { + if (m_data == null) { return; } return m_data->clear(); diff --git a/exml/Node.hpp b/exml/Node.hpp index 75311ef..992cf56 100644 --- a/exml/Node.hpp +++ b/exml/Node.hpp @@ -77,62 +77,62 @@ namespace exml { enum nodeType getType() const; /** * @brief Cast the element in a Document if it is possible. - * @return pointer on the class or nullptr. + * @return pointer on the class or null. */ exml::Document toDocument(); /** * @brief Cast the element in a Document if it is possible. - * @return CONST pointer on the class or nullptr. + * @return CONST pointer on the class or null. */ const exml::Document toDocument() const; /** * @brief Cast the element in a Attribute if it is possible. - * @return pointer on the class or nullptr. + * @return pointer on the class or null. */ exml::Attribute toAttribute(); /** * @brief Cast the element in a Attribute if it is possible. - * @return CONST pointer on the class or nullptr. + * @return CONST pointer on the class or null. */ const exml::Attribute toAttribute() const; /** * @brief Cast the element in a Comment if it is possible. - * @return pointer on the class or nullptr. + * @return pointer on the class or null. */ exml::Comment toComment(); /** * @brief Cast the element in a Comment if it is possible. - * @return CONST pointer on the class or nullptr. + * @return CONST pointer on the class or null. */ const exml::Comment toComment() const; /** * @brief Cast the element in a Declaration if it is possible. - * @return pointer on the class or nullptr. + * @return pointer on the class or null. */ exml::Declaration toDeclaration(); /** * @brief Cast the element in a Declaration if it is possible. - * @return CONST pointer on the class or nullptr. + * @return CONST pointer on the class or null. */ const exml::Declaration toDeclaration() const; /** * @brief Cast the element in a Element if it is possible. - * @return pointer on the class or nullptr. + * @return pointer on the class or null. */ exml::Element toElement(); /** * @brief Cast the element in a Element if it is possible. - * @return CONST pointer on the class or nullptr. + * @return CONST pointer on the class or null. */ const exml::Element toElement() const; /** * @brief Cast the element in a Text if it is possible. - * @return pointer on the class or nullptr. + * @return pointer on the class or null. */ exml::Text toText(); /** * @brief Cast the element in a Text if it is possible. - * @return CONST pointer on the class or nullptr. + * @return CONST pointer on the class or null. */ const exml::Text toText() const; /** diff --git a/exml/Text.cpp b/exml/Text.cpp index 558d804..2615ed9 100644 --- a/exml/Text.cpp +++ b/exml/Text.cpp @@ -10,12 +10,12 @@ exml::Text::Text(ememory::SharedPtr _internalNode) : exml::Node(_internalNode) { - if (m_data == nullptr) { + if (m_data == null) { return; } if (m_data->isText() == false) { // try to set wrong type inside ... ==> remove it ... - m_data = nullptr; + m_data = null; } } diff --git a/exml/internal/AttributeList.cpp b/exml/internal/AttributeList.cpp index 55bd137..68dc2f7 100644 --- a/exml/internal/AttributeList.cpp +++ b/exml/internal/AttributeList.cpp @@ -10,7 +10,7 @@ ememory::SharedPtr exml::internal::AttributeList::getAttr(int32_t _id) { if ( _id < 0 || size_t(_id) >= m_listAttribute.size()) { - return nullptr; + return null; } return m_listAttribute[_id]; } @@ -18,14 +18,14 @@ ememory::SharedPtr exml::internal::AttributeList::get ememory::SharedPtr exml::internal::AttributeList::getAttr(int32_t _id) const { if ( _id < 0 || size_t(_id) >= m_listAttribute.size()) { - return nullptr; + return null; } return m_listAttribute[_id]; } etk::Pair exml::internal::AttributeList::getAttrPair(int32_t _id) const { ememory::SharedPtr att = getAttr(_id); - if (att == nullptr) { + if (att == null) { return etk::makePair("",""); } return etk::makePair(att->getName(),att->getValue()); @@ -33,7 +33,7 @@ etk::Pair exml::internal::AttributeList::getAttrPair(i void exml::internal::AttributeList::appendAttribute(const ememory::SharedPtr& _attr) { - if (_attr == nullptr) { + if (_attr == null) { EXML_ERROR("Try to set an empty node"); return; } @@ -52,7 +52,7 @@ const etk::String& exml::internal::AttributeList::getAttribute(const etk::String return errorReturn; } for (size_t iii=0; iiigetName() == _name) { return m_listAttribute[iii]->getValue(); } @@ -66,7 +66,7 @@ bool exml::internal::AttributeList::existAttribute(const etk::String& _name) con return false; } for (size_t iii=0; iiigetName() == _name) { return true; } @@ -80,7 +80,7 @@ bool exml::internal::AttributeList::removeAttribute(const etk::String& _name) { } auto it = m_listAttribute.begin(); while (it != m_listAttribute.end()) { - if (*it == nullptr) { + if (*it == null) { it = m_listAttribute.erase(it); continue; } @@ -96,7 +96,7 @@ bool exml::internal::AttributeList::removeAttribute(const etk::String& _name) { void exml::internal::AttributeList::setAttribute(const etk::String& _name, const etk::String& _value) { // check if attribute already det : for (size_t iii=0; iiigetName() == _name) { // update the value : m_listAttribute[iii]->setValue(_value); @@ -104,7 +104,7 @@ void exml::internal::AttributeList::setAttribute(const etk::String& _name, const } } ememory::SharedPtr attr = exml::internal::Attribute::create(_name, _value); - if (attr == nullptr) { + if (attr == null) { EXML_ERROR("memory allocation error..."); } m_listAttribute.pushBack(attr); @@ -112,7 +112,7 @@ void exml::internal::AttributeList::setAttribute(const etk::String& _name, const bool exml::internal::AttributeList::iGenerate(etk::String& _data, int32_t _indent) const { for (size_t iii=0; iiiiGenerate(_data, _indent); } } diff --git a/exml/internal/Declaration.cpp b/exml/internal/Declaration.cpp index 8c3deb5..e1855cc 100644 --- a/exml/internal/Declaration.cpp +++ b/exml/internal/Declaration.cpp @@ -77,7 +77,7 @@ bool exml::internal::Declaration::iParse(const etk::String& _data, int32_t& _pos if (checkAvaillable(_data[iii], true) == true) { // we find an attibute == > create an element and parse it: ememory::SharedPtr attribute = exml::internal::Attribute::create(); - if (attribute == nullptr) { + if (attribute == null) { CREATE_ERROR(_doc, _data, _pos, _filePos, " Allocation error ..."); return false; } diff --git a/exml/internal/Document.cpp b/exml/internal/Document.cpp index 2ed1ac3..73194e5 100644 --- a/exml/internal/Document.cpp +++ b/exml/internal/Document.cpp @@ -24,7 +24,7 @@ exml::internal::Document::Document() : bool exml::internal::Document::iGenerate(etk::String& _data, int32_t _indent) const { for (size_t iii=0; iiiiGenerate(_data, _indent); } } diff --git a/exml/internal/Element.cpp b/exml/internal/Element.cpp index dacdb57..de80693 100644 --- a/exml/internal/Element.cpp +++ b/exml/internal/Element.cpp @@ -28,7 +28,7 @@ ememory::SharedPtr exml::internal::Element::create(cons enum exml::nodeType exml::internal::Element::getType(int32_t _id) const { ememory::SharedPtr tmpp = getNode(_id); - if (tmpp == nullptr) { + if (tmpp == null) { return exml::nodeType::unknow; } return tmpp->getType(); @@ -37,7 +37,7 @@ enum exml::nodeType exml::internal::Element::getType(int32_t _id) const { ememory::SharedPtr exml::internal::Element::getNode(int32_t _id) { if ( _id <0 || (size_t)_id>=m_listSub.size()) { - return nullptr; + return null; } return m_listSub[_id]; } @@ -45,7 +45,7 @@ ememory::SharedPtr exml::internal::Element::getNode(int32_ const ememory::SharedPtr exml::internal::Element::getNode(int32_t _id) const { if ( _id <0 || (size_t)_id>=m_listSub.size()) { - return nullptr; + return null; } return m_listSub[_id]; } @@ -53,56 +53,56 @@ const ememory::SharedPtr exml::internal::Element::getNode( ememory::SharedPtr exml::internal::Element::getElement(int32_t _id) { ememory::SharedPtr tmpp = getNode(_id); - if (tmpp == nullptr) { - return nullptr; + if (tmpp == null) { + return null; } return tmpp->toElement(); } const ememory::SharedPtr exml::internal::Element::getElement(int32_t _id) const { const ememory::SharedPtr tmpp = getNode(_id); - if (tmpp == nullptr) { - return nullptr; + if (tmpp == null) { + return null; } return tmpp->toElement(); } ememory::SharedPtr exml::internal::Element::getNamed(const etk::String& _name) { if (_name.size() == 0) { - return nullptr; + return null; } for (size_t iii=0; iiigetType() == exml::nodeType::element && m_listSub[iii]->getValue() == _name) { - if (m_listSub[iii] == nullptr) { - return nullptr; + if (m_listSub[iii] == null) { + return null; } return m_listSub[iii]->toElement(); } } - return nullptr; + return null; } const ememory::SharedPtr exml::internal::Element::getNamed(const etk::String& _name) const { if (_name.size() == 0) { - return nullptr; + return null; } for (size_t iii=0; iiigetType() == exml::nodeType::element && m_listSub[iii]->getValue() == _name) { - if (m_listSub[iii] == nullptr) { - return nullptr; + if (m_listSub[iii] == null) { + return null; } return m_listSub[iii]->toElement(); } } - return nullptr; + return null; } void exml::internal::Element::append(const ememory::SharedPtr& _node) { - if (_node == nullptr) { + if (_node == null) { EXML_ERROR("Try to set an empty node"); return; } @@ -125,7 +125,7 @@ void exml::internal::Element::remove(const etk::String& _nodeName) { } auto it = m_listSub.begin(); while (it != m_listSub.end()) { - if (*it == nullptr) { + if (*it == null) { it = m_listSub.erase(it); } else if ((*it)->getValue() == _nodeName) { it = m_listSub.erase(it); @@ -145,7 +145,7 @@ etk::String exml::internal::Element::getText() const { } } else { for (size_t iii=0; iiiiGenerate(res, 0); } } @@ -161,7 +161,7 @@ bool exml::internal::Element::iGenerate(etk::String& _data, int32_t _indent) con if (m_listSub.size()>0) { if( m_listSub.size() == 1 - && m_listSub[0] != nullptr + && m_listSub[0] != null && m_listSub[0]->getType() == exml::nodeType::text && ememory::dynamicPointerCast(m_listSub[0])->countLines() == 1) { _data += ">"; @@ -171,7 +171,7 @@ bool exml::internal::Element::iGenerate(etk::String& _data, int32_t _indent) con _data += ">\n"; for (size_t iii=0; iiiiGenerate(_data, _indent+1); } } @@ -236,7 +236,7 @@ bool exml::internal::Element::subParse(const etk::String& _data, int32_t& _pos, } // Find declaration balise ememory::SharedPtr declaration = exml::internal::Declaration::create(tmpname); - if (declaration == nullptr) { + if (declaration == null) { CREATE_ERROR(_doc, _data, _pos, _filePos, "Allocation Error..."); return false; } @@ -269,7 +269,7 @@ bool exml::internal::Element::subParse(const etk::String& _data, int32_t& _pos, ++tmpPos; // find comment: ememory::SharedPtr comment = exml::internal::Comment::create(); - if (comment == nullptr) { + if (comment == null) { CREATE_ERROR(_doc, _data, _pos, _filePos, "Allocation error ..."); return false; } @@ -298,7 +298,7 @@ bool exml::internal::Element::subParse(const etk::String& _data, int32_t& _pos, tmpPos+=6; // find text: ememory::SharedPtr text = exml::internal::TextCDATA::create(); - if (text == nullptr) { + if (text == null) { CREATE_ERROR(_doc, _data, _pos, _filePos, "Allocation error ..."); return false; } @@ -387,7 +387,7 @@ bool exml::internal::Element::subParse(const etk::String& _data, int32_t& _pos, //EXML_INFO("find node named : '" << tmpname << "'"); // find text: ememory::SharedPtr element = exml::internal::Element::create(tmpname); - if (element == nullptr) { + if (element == null) { CREATE_ERROR(_doc, _data, _pos, _filePos, "Allocation error ..."); return false; } @@ -418,7 +418,7 @@ bool exml::internal::Element::subParse(const etk::String& _data, int32_t& _pos, } else { // find data == > parse it... ememory::SharedPtr text = exml::internal::Text::create(); - if (text == nullptr) { + if (text == null) { CREATE_ERROR(_doc, _data, _pos, _filePos, "Allocation error ..."); return false; } @@ -476,7 +476,7 @@ bool exml::internal::Element::iParse(const etk::String& _data, if (checkAvaillable(_data[iii], true) == true) { // we find an attibute == > create an element and parse it: ememory::SharedPtr attribute = exml::internal::Attribute::create(); - if (attribute == nullptr) { + if (attribute == null) { CREATE_ERROR(_doc, _data, _pos, _filePos, "Allocation error ..."); return false; } diff --git a/exml/internal/Node.cpp b/exml/internal/Node.cpp index b0f7b1c..33c9802 100644 --- a/exml/internal/Node.cpp +++ b/exml/internal/Node.cpp @@ -134,51 +134,51 @@ enum exml::nodeType exml::internal::Node::getType() const { } ememory::SharedPtr exml::internal::Node::toDocument() { - return nullptr; + return null; } const ememory::SharedPtr exml::internal::Node::toDocument() const { - return nullptr; + return null; } ememory::SharedPtr exml::internal::Node::toAttribute() { - return nullptr; + return null; } const ememory::SharedPtr exml::internal::Node::toAttribute() const { - return nullptr; + return null; } ememory::SharedPtr exml::internal::Node::toComment() { - return nullptr; + return null; } const ememory::SharedPtr exml::internal::Node::toComment() const { - return nullptr; + return null; } ememory::SharedPtr exml::internal::Node::toDeclaration() { - return nullptr; + return null; } const ememory::SharedPtr exml::internal::Node::toDeclaration() const { - return nullptr; + return null; } ememory::SharedPtr exml::internal::Node::toElement() { - return nullptr; + return null; } const ememory::SharedPtr exml::internal::Node::toElement() const { - return nullptr; + return null; } ememory::SharedPtr exml::internal::Node::toText() { - return nullptr; + return null; } const ememory::SharedPtr exml::internal::Node::toText() const{ - return nullptr; + return null; } bool exml::internal::Node::isDocument() const { diff --git a/exml/internal/Node.hpp b/exml/internal/Node.hpp index 02a90a8..95bfd14 100644 --- a/exml/internal/Node.hpp +++ b/exml/internal/Node.hpp @@ -136,62 +136,62 @@ namespace exml { public: /** * @brief Cast the element in a Document if it is possible. - * @return pointer on the class or nullptr. + * @return pointer on the class or null. */ virtual ememory::SharedPtr toDocument(); /** * @brief Cast the element in a Document if it is possible. - * @return CONST pointer on the class or nullptr. + * @return CONST pointer on the class or null. */ virtual const ememory::SharedPtr toDocument() const; /** * @brief Cast the element in a Attribute if it is possible. - * @return pointer on the class or nullptr. + * @return pointer on the class or null. */ virtual ememory::SharedPtr toAttribute(); /** * @brief Cast the element in a Attribute if it is possible. - * @return CONST pointer on the class or nullptr. + * @return CONST pointer on the class or null. */ virtual const ememory::SharedPtr toAttribute() const; /** * @brief Cast the element in a Comment if it is possible. - * @return pointer on the class or nullptr. + * @return pointer on the class or null. */ virtual ememory::SharedPtr toComment(); /** * @brief Cast the element in a Comment if it is possible. - * @return CONST pointer on the class or nullptr. + * @return CONST pointer on the class or null. */ virtual const ememory::SharedPtr toComment() const; /** * @brief Cast the element in a Declaration if it is possible. - * @return pointer on the class or nullptr. + * @return pointer on the class or null. */ virtual ememory::SharedPtr toDeclaration(); /** * @brief Cast the element in a Declaration if it is possible. - * @return CONST pointer on the class or nullptr. + * @return CONST pointer on the class or null. */ virtual const ememory::SharedPtr toDeclaration() const; /** * @brief Cast the element in a Element if it is possible. - * @return pointer on the class or nullptr. + * @return pointer on the class or null. */ virtual ememory::SharedPtr toElement(); /** * @brief Cast the element in a Element if it is possible. - * @return CONST pointer on the class or nullptr. + * @return CONST pointer on the class or null. */ virtual const ememory::SharedPtr toElement() const; /** * @brief Cast the element in a Text if it is possible. - * @return pointer on the class or nullptr. + * @return pointer on the class or null. */ virtual ememory::SharedPtr toText(); /** * @brief Cast the element in a Text if it is possible. - * @return CONST pointer on the class or nullptr. + * @return CONST pointer on the class or null. */ virtual const ememory::SharedPtr toText() const;