diff --git a/ejson/Array.cpp b/ejson/Array.cpp index b0fc8cd..9071b1f 100644 --- a/ejson/Array.cpp +++ b/ejson/Array.cpp @@ -13,12 +13,12 @@ ejson::Array::Array(ememory::SharedPtr _internalValue) : ejson::Value(_internalValue) { - if (m_data == nullptr) { + if (m_data == null) { return; } if (m_data->getType() != ejson::valueType::array) { // try to set wrong type inside ... ==> remove it ... - m_data = nullptr; + m_data = null; } } @@ -38,48 +38,48 @@ ejson::Array& ejson::Array::operator= (const ejson::Array& _obj) { } size_t ejson::Array::size() const { - if (m_data == nullptr) { - EJSON_DEBUG("Can not size (nullptr) ..."); + if (m_data == null) { + EJSON_DEBUG("Can not size (null) ..."); return 0; } return static_cast(m_data.get())->size(); } ejson::Value ejson::Array::operator[] (size_t _id) { - if (m_data == nullptr) { - EJSON_DEBUG("Can not get (nullptr) ..."); - return ejson::Value(nullptr); + if (m_data == null) { + EJSON_DEBUG("Can not get (null) ..."); + return ejson::Value(null); } return ejson::Value(static_cast(m_data.get())->get(_id)); } const ejson::Value ejson::Array::operator[] (size_t _id) const { - if (m_data == nullptr) { - EJSON_DEBUG("Can not get (nullptr) ..."); - return ejson::Value(nullptr);; + if (m_data == null) { + EJSON_DEBUG("Can not get (null) ..."); + return ejson::Value(null);; } return ejson::Value(static_cast(m_data.get())->get(_id)); } bool ejson::Array::add(const ejson::Value& _element) { - if (m_data == nullptr) { - EJSON_DEBUG("Can not add (nullptr) ..."); + if (m_data == null) { + EJSON_DEBUG("Can not add (null) ..."); return false; } return static_cast(m_data.get())->add(_element.m_data); } void ejson::Array::remove(size_t _id) { - if (m_data == nullptr) { - EJSON_DEBUG("Can not remove (nullptr) ..."); + if (m_data == null) { + EJSON_DEBUG("Can not remove (null) ..."); return; } static_cast(m_data.get())->remove(_id); } ejson::Array::iterator ejson::Array::remove(const ejson::Array::iterator& _it) { - if (m_data == nullptr) { - EJSON_DEBUG("Can not remove (nullptr) ..."); + if (m_data == null) { + EJSON_DEBUG("Can not remove (null) ..."); return _it; } static_cast(m_data.get())->remove(_it.getId()); diff --git a/ejson/Array.hpp b/ejson/Array.hpp index b337594..c7dc4c3 100644 --- a/ejson/Array.hpp +++ b/ejson/Array.hpp @@ -44,13 +44,13 @@ namespace ejson { /** * @brief get the pointer on an element reference with his ID. * @param[in] _id Id of the element. - * @return nullptr if the element does not exist. + * @return null if the element does not exist. */ ejson::Value operator[] (size_t _id); /** * @brief get the pointer on an element reference with his ID. * @param[in] _id Id of the element. - * @return nullptr if the element does not exist. + * @return null if the element does not exist. */ const ejson::Value operator[] (size_t _id) const; /** diff --git a/ejson/Boolean.cpp b/ejson/Boolean.cpp index 7790542..65af37f 100644 --- a/ejson/Boolean.cpp +++ b/ejson/Boolean.cpp @@ -11,12 +11,12 @@ ejson::Boolean::Boolean(ememory::SharedPtr _internalValue) : ejson::Value(_internalValue) { - if (m_data == nullptr) { + if (m_data == null) { return; } if (m_data->getType() != ejson::valueType::boolean) { // try to set wrong type inside ... ==> remove it ... - m_data = nullptr; + m_data = null; } } @@ -36,16 +36,16 @@ ejson::Boolean& ejson::Boolean::operator= (const ejson::Boolean& _obj) { } void ejson::Boolean::set(bool _value) { - if (m_data == nullptr) { - EJSON_DEBUG("Can not set (nullptr) ..."); + if (m_data == null) { + EJSON_DEBUG("Can not set (null) ..."); return; } static_cast(m_data.get())->set(_value); } bool ejson::Boolean::get(bool _errorValue) const { - if (m_data == nullptr) { - EJSON_DEBUG("Can not get (nullptr) ..."); + if (m_data == null) { + EJSON_DEBUG("Can not get (null) ..."); return _errorValue; } return static_cast(m_data.get())->get(); diff --git a/ejson/Document.cpp b/ejson/Document.cpp index 2f6971a..249b8db 100644 --- a/ejson/Document.cpp +++ b/ejson/Document.cpp @@ -10,12 +10,12 @@ ejson::Document::Document(ememory::SharedPtr _internalValue) : ejson::Object(_internalValue) { - if (m_data == nullptr) { + if (m_data == null) { return; } if (m_data->getType() != ejson::valueType::document) { // try to set wrong type inside ... ==> remove it ... - m_data = nullptr; + m_data = null; } } @@ -35,40 +35,40 @@ ejson::Document& ejson::Document::operator= (const ejson::Document& _obj) { } bool ejson::Document::parse(const etk::String& _data) { - if (m_data == nullptr) { - EJSON_DEBUG("Can not parse (nullptr) ..."); + if (m_data == null) { + EJSON_DEBUG("Can not parse (null) ..."); return false; } return static_cast(m_data.get())->parse(_data); } bool ejson::Document::generate(etk::String& _data) { - if (m_data == nullptr) { - EJSON_DEBUG("Can not generate (nullptr) ..."); + if (m_data == null) { + EJSON_DEBUG("Can not generate (null) ..."); return false; } return static_cast(m_data.get())->generate(_data); } bool ejson::Document::load(const etk::String& _file) { - if (m_data == nullptr) { - EJSON_DEBUG("Can not load (nullptr) ..."); + if (m_data == null) { + EJSON_DEBUG("Can not load (null) ..."); return false; } return static_cast(m_data.get())->load(_file); } bool ejson::Document::store(const etk::String& _file) { - if (m_data == nullptr) { - EJSON_DEBUG("Can not store (nullptr) ..."); + if (m_data == null) { + EJSON_DEBUG("Can not store (null) ..."); return false; } return static_cast(m_data.get())->store(_file); } bool ejson::Document::storeSafe(const etk::String& _file) { - if (m_data == nullptr) { - EJSON_DEBUG("Can not store (nullptr) ..."); + if (m_data == null) { + EJSON_DEBUG("Can not store (null) ..."); return false; } bool done = static_cast(m_data.get())->store(_file+".tmp"); @@ -79,24 +79,24 @@ bool ejson::Document::storeSafe(const etk::String& _file) { } void ejson::Document::setDisplayError(bool _value){ - if (m_data == nullptr) { - EJSON_DEBUG("Can not setDisplayError (nullptr) ..."); + if (m_data == null) { + EJSON_DEBUG("Can not setDisplayError (null) ..."); return; } static_cast(m_data.get())->setDisplayError(_value); } bool ejson::Document::getDisplayError() { - if (m_data == nullptr) { - EJSON_DEBUG("Can not getDisplayError (nullptr) ..."); + if (m_data == null) { + EJSON_DEBUG("Can not getDisplayError (null) ..."); return false; } return static_cast(m_data.get())->getDisplayError(); } void ejson::Document::displayError() { - if (m_data == nullptr) { - EJSON_DEBUG("Can not displayError (nullptr) ..."); + if (m_data == null) { + EJSON_DEBUG("Can not displayError (null) ..."); return; } static_cast(m_data.get())->displayError(); diff --git a/ejson/Null.cpp b/ejson/Null.cpp index 46a17df..d70409b 100644 --- a/ejson/Null.cpp +++ b/ejson/Null.cpp @@ -9,12 +9,12 @@ ejson::Null::Null(ememory::SharedPtr _internalValue) : ejson::Value(_internalValue) { - if (m_data == nullptr) { + if (m_data == null) { return; } if (m_data->getType() != ejson::valueType::null) { // try to set wrong type inside ... ==> remove it ... - m_data = nullptr; + m_data = null; } } diff --git a/ejson/Number.cpp b/ejson/Number.cpp index 4d2ac5e..d66003f 100644 --- a/ejson/Number.cpp +++ b/ejson/Number.cpp @@ -10,12 +10,12 @@ ejson::Number::Number(ememory::SharedPtr _internalValue) : ejson::Value(_internalValue) { - if (m_data == nullptr) { + if (m_data == null) { return; } if (m_data->getType() != ejson::valueType::number) { // try to set wrong type inside ... ==> remove it ... - m_data = nullptr; + m_data = null; } } @@ -35,56 +35,56 @@ ejson::Number& ejson::Number::operator= (const ejson::Number& _obj) { } void ejson::Number::set(double _value) { - if (m_data == nullptr) { - EJSON_DEBUG("Can not set (nullptr) ..."); + if (m_data == null) { + EJSON_DEBUG("Can not set (null) ..."); return; } static_cast(m_data.get())->set(_value); } void ejson::Number::set(uint64_t _value) { - if (m_data == nullptr) { - EJSON_DEBUG("Can not set (nullptr) ..."); + if (m_data == null) { + EJSON_DEBUG("Can not set (null) ..."); return; } static_cast(m_data.get())->set(_value); } void ejson::Number::set(int64_t _value) { - if (m_data == nullptr) { - EJSON_DEBUG("Can not set (nullptr) ..."); + if (m_data == null) { + EJSON_DEBUG("Can not set (null) ..."); return; } static_cast(m_data.get())->set(_value); } double ejson::Number::get(double _errorValue) const { - if (m_data == nullptr) { - EJSON_DEBUG("Can not get (nullptr) ..."); + if (m_data == null) { + EJSON_DEBUG("Can not get (null) ..."); return _errorValue; } return static_cast(m_data.get())->get(); } uint64_t ejson::Number::getU64(uint64_t _errorValue) const { - if (m_data == nullptr) { - EJSON_DEBUG("Can not get (nullptr) ..."); + if (m_data == null) { + EJSON_DEBUG("Can not get (null) ..."); return _errorValue; } return static_cast(m_data.get())->getU64(); } int64_t ejson::Number::getI64(int64_t _errorValue) const { - if (m_data == nullptr) { - EJSON_DEBUG("Can not get (nullptr) ..."); + if (m_data == null) { + EJSON_DEBUG("Can not get (null) ..."); return _errorValue; } return static_cast(m_data.get())->getI64(); } ejson::internal::Number::type ejson::Number::getType() const { - if (m_data == nullptr) { - EJSON_DEBUG("Can not get (nullptr) ..."); + if (m_data == null) { + EJSON_DEBUG("Can not get (null) ..."); return ejson::internal::Number::type::tDouble; } return static_cast(m_data.get())->getType(); diff --git a/ejson/Object.cpp b/ejson/Object.cpp index 5a85a3a..2b70a2d 100644 --- a/ejson/Object.cpp +++ b/ejson/Object.cpp @@ -10,13 +10,13 @@ ejson::Object::Object(ememory::SharedPtr _internalValue) : ejson::Value(_internalValue) { - if (m_data == nullptr) { + if (m_data == null) { return; } if ( m_data->getType() != ejson::valueType::object && m_data->getType() != ejson::valueType::document) { // try to set wrong type inside ... ==> remove it ... - m_data = nullptr; + m_data = null; } } @@ -42,96 +42,96 @@ ejson::Object& ejson::Object::operator= (const ejson::Object& _obj) { } bool ejson::Object::valueExist(const etk::String& _name) const { - if (m_data == nullptr) { - EJSON_DEBUG("Can not exist (nullptr) ..."); + if (m_data == null) { + EJSON_DEBUG("Can not exist (null) ..."); return false; } return static_cast(m_data.get())->exist(_name); } ejson::Value ejson::Object::operator[] (const etk::String& _name) { - if (m_data == nullptr) { - EJSON_DEBUG("Can not operator[] (nullptr) ..."); - return ejson::Value(nullptr); + if (m_data == null) { + EJSON_DEBUG("Can not operator[] (null) ..."); + return ejson::Value(null); } return ejson::Value(static_cast(m_data.get())->get(_name)); } const ejson::Value ejson::Object::operator[] (const etk::String& _name) const { - if (m_data == nullptr) { - EJSON_DEBUG("Can not operator[] (nullptr) ..."); - return ejson::Value(nullptr); + if (m_data == null) { + EJSON_DEBUG("Can not operator[] (null) ..."); + return ejson::Value(null); } return ejson::Value(static_cast(m_data.get())->get(_name)); } etk::Vector ejson::Object::getKeys() const { - if (m_data == nullptr) { - EJSON_DEBUG("Can not getKeys (nullptr) ..."); + if (m_data == null) { + EJSON_DEBUG("Can not getKeys (null) ..."); return etk::Vector(); } return static_cast(m_data.get())->getKeys(); } size_t ejson::Object::size() const { - if (m_data == nullptr) { - EJSON_DEBUG("Can not size (nullptr) ..."); + if (m_data == null) { + EJSON_DEBUG("Can not size (null) ..."); return 0; } return static_cast(m_data.get())->size(); } ejson::Value ejson::Object::operator[] (size_t _id) { - if (m_data == nullptr) { - EJSON_DEBUG("Can not operator[] (nullptr) ..."); - return ejson::Value(nullptr); + if (m_data == null) { + EJSON_DEBUG("Can not operator[] (null) ..."); + return ejson::Value(null); } return ejson::Value(static_cast(m_data.get())->get(_id)); } const ejson::Value ejson::Object::operator[] (size_t _id) const { - if (m_data == nullptr) { - EJSON_DEBUG("Can not operator[] (nullptr) ..."); - return ejson::Value(nullptr); + if (m_data == null) { + EJSON_DEBUG("Can not operator[] (null) ..."); + return ejson::Value(null); } return ejson::Value(static_cast(m_data.get())->get(_id)); } etk::String ejson::Object::getKey(size_t _id) const { - if (m_data == nullptr) { - EJSON_DEBUG("Can not getKey (nullptr) ..."); + if (m_data == null) { + EJSON_DEBUG("Can not getKey (null) ..."); return ""; } return static_cast(m_data.get())->getKey(_id); } bool ejson::Object::add(const etk::String& _name, const ejson::Value& _value) { - if (m_data == nullptr) { - EJSON_DEBUG("Can not add (nullptr) ..."); + if (m_data == null) { + EJSON_DEBUG("Can not add (null) ..."); return false; } return static_cast(m_data.get())->add(_name, _value.m_data); } void ejson::Object::remove(const etk::String& _name) { - if (m_data == nullptr) { - EJSON_DEBUG("Can not remove (nullptr) ..."); + if (m_data == null) { + EJSON_DEBUG("Can not remove (null) ..."); return; } static_cast(m_data.get())->remove(_name); } void ejson::Object::remove(size_t _id) { - if (m_data == nullptr) { - EJSON_DEBUG("Can not remove (nullptr) ..."); + if (m_data == null) { + EJSON_DEBUG("Can not remove (null) ..."); return; } static_cast(m_data.get())->remove(_id); } ejson::Object::iterator ejson::Object::remove(const ejson::Object::iterator& _it) { - if (m_data == nullptr) { - EJSON_DEBUG("Can not remove (nullptr) ..."); + if (m_data == null) { + EJSON_DEBUG("Can not remove (null) ..."); return _it; } static_cast(m_data.get())->remove(_it.getId()); diff --git a/ejson/String.cpp b/ejson/String.cpp index 3d93fc5..401671e 100644 --- a/ejson/String.cpp +++ b/ejson/String.cpp @@ -9,12 +9,12 @@ ejson::String::String(ememory::SharedPtr _internalValue) : ejson::Value(_internalValue) { - if (m_data == nullptr) { + if (m_data == null) { return; } if (m_data->getType() != ejson::valueType::string) { // try to set wrong type inside ... ==> remove it ... - m_data = nullptr; + m_data = null; } } @@ -34,16 +34,16 @@ ejson::String& ejson::String::operator= (const ejson::String& _obj) { } void ejson::String::set(const etk::String& _value) { - if (m_data == nullptr) { - EJSON_DEBUG("Can not set (nullptr) ..."); + if (m_data == null) { + EJSON_DEBUG("Can not set (null) ..."); return; } static_cast(m_data.get())->set(_value); } etk::String ejson::String::get(const etk::String& _errorValue) const { - if (m_data == nullptr) { - EJSON_DEBUG("Can not get (nullptr) ..."); + if (m_data == null) { + EJSON_DEBUG("Can not get (null) ..."); return _errorValue; } return static_cast(m_data.get())->get(); diff --git a/ejson/Value.cpp b/ejson/Value.cpp index a4f8708..a7af837 100644 --- a/ejson/Value.cpp +++ b/ejson/Value.cpp @@ -10,7 +10,7 @@ #include ejson::Value ejson::empty() { - return ejson::Value(ememory::SharedPtr(nullptr)); + return ejson::Value(ememory::SharedPtr(null)); } @@ -28,7 +28,7 @@ etk::Stream& ejson::operator <<(etk::Stream& _os, const ejson::Value& _obj) { } enum ejson::valueType ejson::Value::getType() const { - if (m_data == nullptr) { + if (m_data == null) { EJSON_DEBUG("Can not get type ..."); return ejson::valueType::unknow; } @@ -36,7 +36,7 @@ enum ejson::valueType ejson::Value::getType() const { } bool ejson::Value::exist() const { - if (m_data == nullptr) { + if (m_data == null) { return false; } return true; @@ -44,8 +44,8 @@ bool ejson::Value::exist() const { etk::String ejson::Value::generateHumanString() const { etk::String out; - if (m_data == nullptr) { - EJSON_DEBUG("Can not remove (nullptr) ..."); + if (m_data == null) { + EJSON_DEBUG("Can not remove (null) ..."); return out; } static_cast(m_data.get())->iGenerate(out, 0); @@ -54,8 +54,8 @@ etk::String ejson::Value::generateHumanString() const { etk::String ejson::Value::generateMachineString() const { etk::String out; - if (m_data == nullptr) { - EJSON_DEBUG("Can not remove (nullptr) ..."); + if (m_data == null) { + EJSON_DEBUG("Can not remove (null) ..."); return out; } static_cast(m_data.get())->iMachineGenerate(out); @@ -64,7 +64,7 @@ etk::String ejson::Value::generateMachineString() const { /* ejson::FilePos ejson::Value::getPos() const { - if (m_data == nullptr) { + if (m_data == null) { return ejson::FilePos(0,0); } return m_data->getPos(); @@ -77,7 +77,7 @@ ejson::Value::Value(const ememory::SharedPtr& _internalV } ejson::Value::Value() : - m_data(nullptr) { + m_data(null) { } @@ -131,8 +131,8 @@ const ejson::Null ejson::Value::toNull() const{ } void ejson::Value::display() const { - if (m_data == nullptr) { - EJSON_DEBUG("Can not Display (nullptr) ..."); + if (m_data == null) { + EJSON_DEBUG("Can not Display (null) ..."); return; } return m_data->display(); @@ -140,7 +140,7 @@ void ejson::Value::display() const { bool ejson::Value::isDocument() const { - if (m_data == nullptr) { + if (m_data == null) { return false; } enum ejson::valueType type = m_data->getType(); @@ -148,42 +148,42 @@ bool ejson::Value::isDocument() const { } bool ejson::Value::isArray() const { - if (m_data == nullptr) { + if (m_data == null) { return false; } return m_data->getType() == ejson::valueType::array; } bool ejson::Value::isObject() const { - if (m_data == nullptr) { + if (m_data == null) { return false; } return m_data->getType() == ejson::valueType::object; } bool ejson::Value::isString() const { - if (m_data == nullptr) { + if (m_data == null) { return false; } return m_data->getType() == ejson::valueType::string; } bool ejson::Value::isNumber() const { - if (m_data == nullptr) { + if (m_data == null) { return false; } return m_data->getType() == ejson::valueType::number; } bool ejson::Value::isBoolean() const { - if (m_data == nullptr) { + if (m_data == null) { return false; } return m_data->getType() == ejson::valueType::boolean; } bool ejson::Value::isNull() const { - if (m_data == nullptr) { + if (m_data == null) { return false; } return m_data->getType() == ejson::valueType::null; @@ -191,24 +191,24 @@ bool ejson::Value::isNull() const { void ejson::Value::clear() { - if (m_data == nullptr) { - EJSON_DEBUG("Can not Clear (nullptr) ..."); + if (m_data == null) { + EJSON_DEBUG("Can not Clear (null) ..."); return; } return m_data->clear(); } bool ejson::Value::transfertIn(ejson::Value& _obj) { - if (m_data == nullptr) { - EJSON_DEBUG("Can not transfert In (nullptr) ..."); + if (m_data == null) { + EJSON_DEBUG("Can not transfert In (null) ..."); return false; } return m_data->transfertIn(_obj.m_data); } ejson::Value ejson::Value::clone() const { - if (m_data == nullptr) { - EJSON_DEBUG("Can not transfert In (nullptr) ..."); + if (m_data == null) { + EJSON_DEBUG("Can not transfert In (null) ..."); return ejson::Value(m_data); } return ejson::Value(m_data->clone()); diff --git a/ejson/Value.hpp b/ejson/Value.hpp index cca2199..d2da3f0 100644 --- a/ejson/Value.hpp +++ b/ejson/Value.hpp @@ -67,72 +67,72 @@ namespace ejson { bool exist() 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. */ ejson::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 ejson::Document toDocument() const; /** * @brief Cast the element in a Array if it is possible. - * @return pointer on the class or nullptr. + * @return pointer on the class or null. */ ejson::Array toArray(); /** * @brief Cast the element in a Array if it is possible. - * @return CONST pointer on the class or nullptr. + * @return CONST pointer on the class or null. */ const ejson::Array toArray() const; /** * @brief Cast the element in a Object if it is possible. - * @return pointer on the class or nullptr. + * @return pointer on the class or null. */ ejson::Object toObject(); /** * @brief Cast the element in a Object if it is possible. - * @return CONST pointer on the class or nullptr. + * @return CONST pointer on the class or null. */ const ejson::Object toObject() const; /** * @brief Cast the element in a String if it is possible. - * @return pointer on the class or nullptr. + * @return pointer on the class or null. */ ejson::String toString(); /** * @brief Cast the element in a String if it is possible. - * @return CONST pointer on the class or nullptr. + * @return CONST pointer on the class or null. */ const ejson::String toString() const; /** * @brief Cast the element in a Number if it is possible. - * @return pointer on the class or nullptr. + * @return pointer on the class or null. */ ejson::Number toNumber(); /** * @brief Cast the element in a Number if it is possible. - * @return CONST pointer on the class or nullptr. + * @return CONST pointer on the class or null. */ const ejson::Number toNumber() const; /** * @brief Cast the element in a Boolean if it is possible. - * @return pointer on the class or nullptr. + * @return pointer on the class or null. */ ejson::Boolean toBoolean(); /** * @brief Cast the element in a Boolean if it is possible. - * @return CONST pointer on the class or nullptr. + * @return CONST pointer on the class or null. */ const ejson::Boolean toBoolean() const; /** * @brief Cast the element in a Null if it is possible. - * @return pointer on the class or nullptr. + * @return pointer on the class or null. */ ejson::Null toNull(); /** * @brief Cast the element in a Null if it is possible. - * @return CONST pointer on the class or nullptr. + * @return CONST pointer on the class or null. */ const ejson::Null toNull() const; @@ -184,7 +184,7 @@ namespace ejson { bool transfertIn(ejson::Value& _obj); /** * @brief Copy the curent node and all the child in the curent one. - * @return nullptr in an error occured, the pointer on the element otherwise + * @return null in an error occured, the pointer on the element otherwise */ ejson::Value clone() const; public: diff --git a/ejson/internal/Array.cpp b/ejson/internal/Array.cpp index 82cb6e8..9c9f4d7 100644 --- a/ejson/internal/Array.cpp +++ b/ejson/internal/Array.cpp @@ -51,7 +51,7 @@ bool ejson::internal::Array::iParse(const etk::String& _data, size_t& _pos, ejso // find an object: EJSON_PARSE_ELEMENT("find Object"); ememory::SharedPtr tmpElement = ejson::internal::Object::create(); - if (tmpElement == nullptr) { + if (tmpElement == null) { EJSON_CREATE_ERROR(_doc, _data, iii, _filePos, "Allocation error in object"); _pos=iii; return false; @@ -63,7 +63,7 @@ bool ejson::internal::Array::iParse(const etk::String& _data, size_t& _pos, ejso // find a string: EJSON_PARSE_ELEMENT("find String quoted"); ememory::SharedPtr tmpElement = ejson::internal::String::create(); - if (tmpElement == nullptr) { + if (tmpElement == null) { EJSON_CREATE_ERROR(_doc, _data, iii, _filePos, "Allocation error in String"); _pos=iii; return false; @@ -74,7 +74,7 @@ bool ejson::internal::Array::iParse(const etk::String& _data, size_t& _pos, ejso // find a list: EJSON_PARSE_ELEMENT("find List"); ememory::SharedPtr tmpElement = ejson::internal::Array::create(); - if (tmpElement == nullptr) { + if (tmpElement == null) { EJSON_CREATE_ERROR(_doc, _data, iii, _filePos, "Allocation error in Array"); _pos=iii; return false; @@ -95,7 +95,7 @@ bool ejson::internal::Array::iParse(const etk::String& _data, size_t& _pos, ejso // find boolean: EJSON_PARSE_ELEMENT("find Boolean"); ememory::SharedPtr tmpElement = ejson::internal::Boolean::create(); - if (tmpElement == nullptr) { + if (tmpElement == null) { EJSON_CREATE_ERROR(_doc, _data, iii, _filePos, "Allocation error in Boolean"); _pos=iii; return false; @@ -110,7 +110,7 @@ bool ejson::internal::Array::iParse(const etk::String& _data, size_t& _pos, ejso // find null: EJSON_PARSE_ELEMENT("find Null"); ememory::SharedPtr tmpElement = ejson::internal::Null::create(); - if (tmpElement == nullptr) { + if (tmpElement == null) { EJSON_CREATE_ERROR(_doc, _data, iii, _filePos, "Allocation error in Boolean"); _pos = iii; return false; @@ -121,7 +121,7 @@ bool ejson::internal::Array::iParse(const etk::String& _data, size_t& _pos, ejso // find number: EJSON_PARSE_ELEMENT("find Number"); ememory::SharedPtr tmpElement = ejson::internal::Number::create(); - if (tmpElement == nullptr) { + if (tmpElement == null) { EJSON_CREATE_ERROR(_doc, _data, iii, _filePos, "Allocation error in Boolean"); _pos=iii; return false; @@ -157,7 +157,7 @@ bool ejson::internal::Array::iGenerate(etk::String& _data, size_t _indent) const } else { for (size_t iii=0; iii tmp = m_value[iii]; - if (tmp == nullptr) { + if (tmp == null) { continue; } if ( tmp->getType() == ejson::valueType::object @@ -187,7 +187,7 @@ bool ejson::internal::Array::iGenerate(etk::String& _data, size_t _indent) const if (false == oneLine) { addIndent(_data, _indent); } - if (m_value[iii] != nullptr) { + if (m_value[iii] != null) { m_value[iii]->iGenerate(_data, _indent+1); if (iii ejson::internal::Array::get(siz } bool ejson::internal::Array::add(ememory::SharedPtr _element) { - if (_element == nullptr) { - EJSON_ERROR("Request add on an nullptr pointer"); + if (_element == null) { + EJSON_ERROR("Request add on an null pointer"); return false; } m_value.pushBack(_element); @@ -252,8 +252,8 @@ void ejson::internal::Array::remove(size_t _id) { bool ejson::internal::Array::transfertIn(ememory::SharedPtr _obj) { - if (_obj == nullptr) { - EJSON_ERROR("Request transfer on an nullptr pointer"); + if (_obj == null) { + EJSON_ERROR("Request transfer on an null pointer"); return false; } if (_obj->getType() != ejson::valueType::array) { @@ -273,13 +273,13 @@ bool ejson::internal::Array::transfertIn(ememory::SharedPtr ejson::internal::Array::clone() const { ememory::SharedPtr output = ejson::internal::Array::create(); - if (output == nullptr) { + if (output == null) { EJSON_ERROR("Allocation error ..."); return ememory::SharedPtr(); } for (size_t iii=0; iii val = m_value[iii]; - if (val == nullptr) { + if (val == null) { continue; } output->add(val->clone()); diff --git a/ejson/internal/Array.hpp b/ejson/internal/Array.hpp index ca11ffd..4c377e9 100644 --- a/ejson/internal/Array.hpp +++ b/ejson/internal/Array.hpp @@ -38,13 +38,13 @@ namespace ejson { /** * @brief get the pointer on an element reference with his ID. * @param[in] _id Id of the element. - * @return nullptr if the element does not exist. + * @return null if the element does not exist. */ ememory::SharedPtr get(size_t _id); /** * @brief get the const pointer on an element reference with his ID. * @param[in] _id Id of the element. - * @return nullptr if the element does not exist. + * @return null if the element does not exist. */ const ememory::SharedPtr get(size_t _id) const; /** diff --git a/ejson/internal/Boolean.cpp b/ejson/internal/Boolean.cpp index 9c46a73..18148fe 100644 --- a/ejson/internal/Boolean.cpp +++ b/ejson/internal/Boolean.cpp @@ -73,7 +73,7 @@ void ejson::internal::Boolean::iMachineGenerate(etk::String& _data) const { bool ejson::internal::Boolean::transfertIn(ememory::SharedPtr _obj) { - if (_obj == nullptr) { + if (_obj == null) { EJSON_ERROR("Request transfer on an NULL pointer"); return false; } @@ -90,7 +90,7 @@ bool ejson::internal::Boolean::transfertIn(ememory::SharedPtr ejson::internal::Boolean::clone() const { ememory::SharedPtr output = ejson::internal::Boolean::create(m_value); - if (output == nullptr) { + if (output == null) { EJSON_ERROR("Allocation error ..."); return ememory::SharedPtr(); } diff --git a/ejson/internal/Null.cpp b/ejson/internal/Null.cpp index aac7ef6..729d05b 100644 --- a/ejson/internal/Null.cpp +++ b/ejson/internal/Null.cpp @@ -46,8 +46,8 @@ void ejson::internal::Null::iMachineGenerate(etk::String& _data) const { bool ejson::internal::Null::transfertIn(ememory::SharedPtr _obj) { - if (_obj == nullptr) { - EJSON_ERROR("Request transfer on an nullptr pointer"); + if (_obj == null) { + EJSON_ERROR("Request transfer on an null pointer"); return false; } if (_obj->getType() == ejson::valueType::null) { @@ -59,7 +59,7 @@ bool ejson::internal::Null::transfertIn(ememory::SharedPtr ejson::internal::Null::clone() const { ememory::SharedPtr output = ejson::internal::Null::create(); - if (output == nullptr) { + if (output == null) { EJSON_ERROR("Allocation error ..."); return ememory::SharedPtr(); } diff --git a/ejson/internal/Number.cpp b/ejson/internal/Number.cpp index 08a365b..784aae3 100644 --- a/ejson/internal/Number.cpp +++ b/ejson/internal/Number.cpp @@ -116,8 +116,8 @@ void ejson::internal::Number::iMachineGenerate(etk::String& _data) const { bool ejson::internal::Number::transfertIn(ememory::SharedPtr _obj) { - if (_obj == nullptr) { - EJSON_ERROR("Request transfer on an nullptr pointer"); + if (_obj == null) { + EJSON_ERROR("Request transfer on an null pointer"); return false; } if (_obj->getType() != ejson::valueType::number) { @@ -156,7 +156,7 @@ ememory::SharedPtr ejson::internal::Number::clone() cons output = ejson::internal::Number::create(m_valueU64); break; } - if (output == nullptr) { + if (output == null) { EJSON_ERROR("Allocation error ..."); return ememory::SharedPtr(); } diff --git a/ejson/internal/Object.cpp b/ejson/internal/Object.cpp index 7a58098..8d2fdd2 100644 --- a/ejson/internal/Object.cpp +++ b/ejson/internal/Object.cpp @@ -122,7 +122,7 @@ bool ejson::internal::Object::iParse(const etk::String& _data, size_t& _pos, ejs // find an object: EJSON_PARSE_ELEMENT("find Object"); ememory::SharedPtr tmpElement = ejson::internal::Object::create(); - if (tmpElement == nullptr) { + if (tmpElement == null) { EJSON_CREATE_ERROR(_doc, _data, iii, _filePos, "Allocation error in object"); _pos=iii; return false; @@ -135,7 +135,7 @@ bool ejson::internal::Object::iParse(const etk::String& _data, size_t& _pos, ejs // find a string: EJSON_PARSE_ELEMENT("find String quoted"); ememory::SharedPtr tmpElement = ejson::internal::String::create(); - if (tmpElement == nullptr) { + if (tmpElement == null) { EJSON_CREATE_ERROR(_doc, _data, iii, _filePos, "Allocation error in String"); _pos=iii; return false; @@ -147,7 +147,7 @@ bool ejson::internal::Object::iParse(const etk::String& _data, size_t& _pos, ejs // find a list: EJSON_PARSE_ELEMENT("find List"); ememory::SharedPtr tmpElement = ejson::internal::Array::create(); - if (tmpElement == nullptr) { + if (tmpElement == null) { EJSON_CREATE_ERROR(_doc, _data, iii, _filePos, "Allocation error in Array"); _pos=iii; return false; @@ -160,7 +160,7 @@ bool ejson::internal::Object::iParse(const etk::String& _data, size_t& _pos, ejs // find boolean: EJSON_PARSE_ELEMENT("find Boolean"); ememory::SharedPtr tmpElement = ejson::internal::Boolean::create(); - if (tmpElement == nullptr) { + if (tmpElement == null) { EJSON_CREATE_ERROR(_doc, _data, iii, _filePos, "Allocation error in Boolean"); _pos=iii; return false; @@ -172,7 +172,7 @@ bool ejson::internal::Object::iParse(const etk::String& _data, size_t& _pos, ejs // find null: EJSON_PARSE_ELEMENT("find Null"); ememory::SharedPtr tmpElement = ejson::internal::Null::create(); - if (tmpElement == nullptr) { + if (tmpElement == null) { EJSON_CREATE_ERROR(_doc, _data, iii, _filePos, "Allocation error in Boolean"); _pos=iii; return false; @@ -184,7 +184,7 @@ bool ejson::internal::Object::iParse(const etk::String& _data, size_t& _pos, ejs // find number: EJSON_PARSE_ELEMENT("find Number"); ememory::SharedPtr tmpElement = ejson::internal::Number::create(); - if (tmpElement == nullptr) { + if (tmpElement == null) { EJSON_CREATE_ERROR(_doc, _data, iii, _filePos, "Allocation error in Boolean"); _pos=iii; return false; @@ -221,7 +221,7 @@ bool ejson::internal::Object::iGenerate(etk::String& _data, size_t _indent) cons } else { for (size_t iii=0; iii tmp = m_value.getValue(iii); - if (tmp == nullptr) { + if (tmp == null) { continue; } if ( tmp->getType() == ejson::valueType::object @@ -327,7 +327,7 @@ etk::String ejson::internal::Object::getKey(size_t _id) const { } bool ejson::internal::Object::add(const etk::String& _name, ememory::SharedPtr _value) { - if (_value == nullptr) { + if (_value == null) { return false; } if (_name.size() == 0) { @@ -350,8 +350,8 @@ void ejson::internal::Object::remove(size_t _id) { } bool ejson::internal::Object::transfertIn(ememory::SharedPtr _obj) { - if (_obj == nullptr) { - EJSON_ERROR("Request transfer on an nullptr pointer"); + if (_obj == null) { + EJSON_ERROR("Request transfer on an null pointer"); return false; } if ( _obj->getType() != ejson::valueType::object @@ -370,7 +370,7 @@ bool ejson::internal::Object::transfertIn(ememory::SharedPtr& _obj) const { - if (_obj == nullptr) { + if (_obj == null) { return false; } _obj->clear(); @@ -388,14 +388,14 @@ ememory::SharedPtr ejson::internal::Object::clone() cons ememory::SharedPtr ejson::internal::Object::cloneObj() const { ememory::SharedPtr output = ejson::internal::Object::create(); - if (output == nullptr) { + if (output == null) { EJSON_ERROR("Allocation error ..."); return ememory::SharedPtr(); } for (size_t iii=0; iii val = m_value.getValue(iii); etk::String key = m_value.getKey(iii); - if (val == nullptr) { + if (val == null) { continue; } output->add(key, val->clone()); diff --git a/ejson/internal/Object.hpp b/ejson/internal/Object.hpp index e51bd96..402fbca 100644 --- a/ejson/internal/Object.hpp +++ b/ejson/internal/Object.hpp @@ -47,13 +47,13 @@ namespace ejson { /** * @brief get the sub element with his name (no cast check) * @param[in] _name name of the object - * @return pointer on the element requested or nullptr if it not the corect type or does not existed + * @return pointer on the element requested or null if it not the corect type or does not existed */ ememory::SharedPtr get(const etk::String& _name); /** * @brief get the sub element with his name (no cast check) * @param[in] _name name of the object - * @return pointer on the element requested or nullptr if it not the corect type or does not existed + * @return pointer on the element requested or null if it not the corect type or does not existed */ const ememory::SharedPtr get(const etk::String& _name) const; public: @@ -70,13 +70,13 @@ namespace ejson { /** * @brief get the pointer on an element reference with his ID. * @param[in] _id Id of the element. - * @return nullptr if the element does not exist. + * @return null if the element does not exist. */ ememory::SharedPtr get(size_t _id); /** * @brief get the pointer on an element reference with his ID. * @param[in] _id Id of the element. - * @return nullptr if the element does not exist. + * @return null if the element does not exist. */ const ememory::SharedPtr get(size_t _id) const; /** diff --git a/ejson/internal/String.cpp b/ejson/internal/String.cpp index 60acad4..edbea54 100644 --- a/ejson/internal/String.cpp +++ b/ejson/internal/String.cpp @@ -92,8 +92,8 @@ void ejson::internal::String::iMachineGenerate(etk::String& _data) const { } bool ejson::internal::String::transfertIn(ememory::SharedPtr _obj) { - if (_obj == nullptr) { - EJSON_ERROR("Request transfer on an nullptr pointer"); + if (_obj == null) { + EJSON_ERROR("Request transfer on an null pointer"); return false; } if (_obj->getType() != ejson::valueType::string) { @@ -108,7 +108,7 @@ bool ejson::internal::String::transfertIn(ememory::SharedPtr ejson::internal::String::clone() const { ememory::SharedPtr output = ejson::internal::String::create(m_value); - if (output == nullptr) { + if (output == null) { EJSON_ERROR("Allocation error ..."); return ememory::SharedPtr(); } diff --git a/ejson/internal/Value.hpp b/ejson/internal/Value.hpp index 7080921..5b85b38 100644 --- a/ejson/internal/Value.hpp +++ b/ejson/internal/Value.hpp @@ -141,7 +141,7 @@ namespace ejson { virtual bool transfertIn(ememory::SharedPtr _obj); /** * @brief Copy the curent node and all the child in the curent one. - * @return nullptr in an error occured, the pointer on the element otherwise + * @return null in an error occured, the pointer on the element otherwise */ virtual ememory::SharedPtr clone() const; protected: