diff --git a/ejson/Array.cpp b/ejson/Array.cpp index 5f5c5dd..efc0875 100644 --- a/ejson/Array.cpp +++ b/ejson/Array.cpp @@ -42,7 +42,7 @@ size_t ejson::Array::size() const { EJSON_ERROR("Can not size (nullptr) ..."); return 0; } - return static_cast(m_data.get())->size(); + return static_cast(m_data.get())->size(); } ejson::Value ejson::Array::operator[] (size_t _id) { @@ -58,7 +58,7 @@ const ejson::Value ejson::Array::operator[] (size_t _id) const { EJSON_ERROR("Can not get (nullptr) ..."); return ejson::Value(nullptr);; } - return ejson::Value(static_cast(m_data.get())->get(_id)); + return ejson::Value(static_cast(m_data.get())->get(_id)); } bool ejson::Array::add(const ejson::Value& _element) { diff --git a/ejson/Boolean.cpp b/ejson/Boolean.cpp index 799fac3..06149b4 100644 --- a/ejson/Boolean.cpp +++ b/ejson/Boolean.cpp @@ -48,6 +48,6 @@ bool ejson::Boolean::get(bool _errorValue) const { EJSON_ERROR("Can not get (nullptr) ..."); return _errorValue; } - return static_cast(m_data.get())->get(); + return static_cast(m_data.get())->get(); } diff --git a/ejson/Number.cpp b/ejson/Number.cpp index 4551557..ab16627 100644 --- a/ejson/Number.cpp +++ b/ejson/Number.cpp @@ -63,7 +63,7 @@ double ejson::Number::get(double _errorValue) const { EJSON_ERROR("Can not get (nullptr) ..."); return _errorValue; } - return static_cast(m_data.get())->get(); + return static_cast(m_data.get())->get(); } uint64_t ejson::Number::getU64(uint64_t _errorValue) const { @@ -71,7 +71,7 @@ uint64_t ejson::Number::getU64(uint64_t _errorValue) const { EJSON_ERROR("Can not get (nullptr) ..."); return _errorValue; } - return static_cast(m_data.get())->getU64(); + return static_cast(m_data.get())->getU64(); } int64_t ejson::Number::getI64(int64_t _errorValue) const { @@ -79,7 +79,7 @@ int64_t ejson::Number::getI64(int64_t _errorValue) const { EJSON_ERROR("Can not get (nullptr) ..."); return _errorValue; } - return static_cast(m_data.get())->getI64(); + return static_cast(m_data.get())->getI64(); } ejson::internal::Number::type ejson::Number::getType() const { @@ -87,7 +87,7 @@ ejson::internal::Number::type ejson::Number::getType() const { EJSON_ERROR("Can not get (nullptr) ..."); return ejson::internal::Number::type::tDouble; } - return static_cast(m_data.get())->getType(); + return static_cast(m_data.get())->getType(); } diff --git a/ejson/Object.cpp b/ejson/Object.cpp index e7f464a..f0d77ef 100644 --- a/ejson/Object.cpp +++ b/ejson/Object.cpp @@ -62,7 +62,7 @@ const ejson::Value ejson::Object::operator[] (const std::string& _name) const { EJSON_ERROR("Can not operator[] (nullptr) ..."); return ejson::Value(nullptr); } - return ejson::Value(static_cast(m_data.get())->get(_name)); + return ejson::Value(static_cast(m_data.get())->get(_name)); } std::vector ejson::Object::getKeys() const { @@ -70,7 +70,7 @@ std::vector ejson::Object::getKeys() const { EJSON_ERROR("Can not getKeys (nullptr) ..."); return std::vector(); } - return static_cast(m_data.get())->getKeys(); + return static_cast(m_data.get())->getKeys(); } size_t ejson::Object::size() const { @@ -94,7 +94,7 @@ const ejson::Value ejson::Object::operator[] (size_t _id) const { EJSON_ERROR("Can not operator[] (nullptr) ..."); return ejson::Value(nullptr); } - return ejson::Value(static_cast(m_data.get())->get(_id)); + return ejson::Value(static_cast(m_data.get())->get(_id)); } std::string ejson::Object::getKey(size_t _id) const { @@ -102,7 +102,7 @@ std::string ejson::Object::getKey(size_t _id) const { EJSON_ERROR("Can not getKey (nullptr) ..."); return ""; } - return static_cast(m_data.get())->getKey(_id); + return static_cast(m_data.get())->getKey(_id); } bool ejson::Object::add(const std::string& _name, const ejson::Value& _value) { diff --git a/ejson/String.cpp b/ejson/String.cpp index 18362d1..bf02a70 100644 --- a/ejson/String.cpp +++ b/ejson/String.cpp @@ -46,5 +46,5 @@ std::string ejson::String::get(const std::string& _errorValue) const { EJSON_ERROR("Can not get (nullptr) ..."); return _errorValue; } - return static_cast(m_data.get())->get(); + return static_cast(m_data.get())->get(); } diff --git a/ejson/Value.cpp b/ejson/Value.cpp index d40497e..8098fff 100644 --- a/ejson/Value.cpp +++ b/ejson/Value.cpp @@ -48,7 +48,7 @@ std::string ejson::Value::generateHumanString() const { EJSON_ERROR("Can not remove (nullptr) ..."); return out; } - static_cast(m_data.get())->iGenerate(out, 0); + static_cast(m_data.get())->iGenerate(out, 0); return out; } @@ -58,7 +58,7 @@ std::string ejson::Value::generateMachineString() const { EJSON_ERROR("Can not remove (nullptr) ..."); return out; } - static_cast(m_data.get())->iMachineGenerate(out); + static_cast(m_data.get())->iMachineGenerate(out); return out; } diff --git a/ejson/internal/Array.cpp b/ejson/internal/Array.cpp index f13c528..2bc7512 100644 --- a/ejson/internal/Array.cpp +++ b/ejson/internal/Array.cpp @@ -156,7 +156,7 @@ bool ejson::internal::Array::iGenerate(std::string& _data, size_t _indent) const oneLine=false; } else { for (size_t iii=0; iii tmp = m_value[iii]; + const ememory::SharedPtr tmp = m_value[iii]; if (tmp == nullptr) { continue; } @@ -170,7 +170,7 @@ bool ejson::internal::Array::iGenerate(std::string& _data, size_t _indent) const break; } if (tmp->getType() == ejson::valueType::string) { - ememory::SharedPtr tmp2 = std::static_pointer_cast(tmp); + const ememory::SharedPtr tmp2 = ememory::staticPointerCast(tmp); if(tmp2->get().size()>40) { oneLine=false; break; @@ -230,7 +230,7 @@ ememory::SharedPtr ejson::internal::Array::get(size_t _i return m_value[_id]; } -const ememory::SharedPtr ejson::internal::Array::get(size_t _id) const { +const ememory::SharedPtr ejson::internal::Array::get(size_t _id) const { return m_value[_id]; } @@ -260,7 +260,7 @@ bool ejson::internal::Array::transfertIn(ememory::SharedPtr other = std::static_pointer_cast(_obj); + ememory::SharedPtr other = ememory::staticPointerCast(_obj); // remove destination elements other->clear(); // Copy to the destination diff --git a/ejson/internal/Array.h b/ejson/internal/Array.h index f302714..c1808c3 100644 --- a/ejson/internal/Array.h +++ b/ejson/internal/Array.h @@ -46,7 +46,7 @@ namespace ejson { * @param[in] _id Id of the element. * @return nullptr if the element does not exist. */ - const ememory::SharedPtr get(size_t _id) const; + const ememory::SharedPtr get(size_t _id) const; /** * @brief add an element on the array. * @param[in] _element element to add. diff --git a/ejson/internal/Boolean.cpp b/ejson/internal/Boolean.cpp index aadf26d..0f4510e 100644 --- a/ejson/internal/Boolean.cpp +++ b/ejson/internal/Boolean.cpp @@ -81,7 +81,7 @@ bool ejson::internal::Boolean::transfertIn(ememory::SharedPtr other = std::static_pointer_cast(_obj); + ememory::SharedPtr other = ememory::staticPointerCast(_obj); // remove destination elements other->m_value = m_value; m_value = false; diff --git a/ejson/internal/Number.cpp b/ejson/internal/Number.cpp index 76e6657..2bb5908 100644 --- a/ejson/internal/Number.cpp +++ b/ejson/internal/Number.cpp @@ -124,7 +124,7 @@ bool ejson::internal::Number::transfertIn(ememory::SharedPtr other = std::static_pointer_cast(_obj); + ememory::SharedPtr other = ememory::staticPointerCast(_obj); // remove destination elements other->m_typeNumber = m_typeNumber; m_typeNumber = ejson::internal::Number::type::tUint; diff --git a/ejson/internal/Object.cpp b/ejson/internal/Object.cpp index c37a584..b2a5b02 100644 --- a/ejson/internal/Object.cpp +++ b/ejson/internal/Object.cpp @@ -220,7 +220,7 @@ bool ejson::internal::Object::iGenerate(std::string& _data, size_t _indent) cons oneLine = false; } else { for (int32_t iii=0; iii tmp = m_value[iii]; + const ememory::SharedPtr tmp = m_value[iii]; if (tmp == nullptr) { continue; } @@ -234,7 +234,7 @@ bool ejson::internal::Object::iGenerate(std::string& _data, size_t _indent) cons break; } if (tmp->getType() == ejson::valueType::string) { - ememory::SharedPtr tmp2 = std::static_pointer_cast(tmp); + const ememory::SharedPtr tmp2 = ememory::staticPointerCast(tmp); if( tmp2->get().size()>25 || m_value.getKey(iii).size()>25) { oneLine=false; @@ -304,7 +304,7 @@ ememory::SharedPtr ejson::internal::Object::get(size_t _ return m_value[_id]; } -const ememory::SharedPtr ejson::internal::Object::get(size_t _id) const{ +const ememory::SharedPtr ejson::internal::Object::get(size_t _id) const{ return m_value[_id]; } @@ -315,9 +315,9 @@ ememory::SharedPtr ejson::internal::Object::get(const st return m_value[_name]; } -const ememory::SharedPtr ejson::internal::Object::get(const std::string& _name) const { +const ememory::SharedPtr ejson::internal::Object::get(const std::string& _name) const { if (m_value.exist(_name) == false) { - return ememory::SharedPtr(); + return ememory::SharedPtr(); } return m_value[_name]; } @@ -359,7 +359,7 @@ bool ejson::internal::Object::transfertIn(ememory::SharedPtr other = std::static_pointer_cast(_obj); + ememory::SharedPtr other = ememory::staticPointerCast(_obj); // remove destination elements other->clear(); // Copy to the destination @@ -369,7 +369,7 @@ bool ejson::internal::Object::transfertIn(ememory::SharedPtr& _obj) const { +bool ejson::internal::Object::cloneIn(ememory::SharedPtr& _obj) const { if (_obj == nullptr) { return false; } diff --git a/ejson/internal/Object.h b/ejson/internal/Object.h index 33c63e9..6e1bf7b 100644 --- a/ejson/internal/Object.h +++ b/ejson/internal/Object.h @@ -56,7 +56,7 @@ namespace ejson { * @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 */ - const ememory::SharedPtr get(const std::string& _name) const; + const ememory::SharedPtr get(const std::string& _name) const; public: /** * @brief Get all the element name (keys). @@ -79,7 +79,7 @@ namespace ejson { * @param[in] _id Id of the element. * @return nullptr if the element does not exist. */ - const ememory::SharedPtr get(size_t _id) const; + const ememory::SharedPtr get(size_t _id) const; /** * @brief Get the element name (key). * @param[in] _id Id of the element. @@ -109,7 +109,7 @@ namespace ejson { * @param[in] _obj Other object ot overwride * @return true The clone has been corectly done, false otherwise */ - bool cloneIn(const ememory::SharedPtr& _obj) const; + bool cloneIn(ememory::SharedPtr& _obj) const; /** * @brief Clone the current object * @return A new object that has been clone diff --git a/ejson/internal/String.cpp b/ejson/internal/String.cpp index a6baf75..b8d75ba 100644 --- a/ejson/internal/String.cpp +++ b/ejson/internal/String.cpp @@ -100,7 +100,7 @@ bool ejson::internal::String::transfertIn(ememory::SharedPtr other = std::static_pointer_cast(_obj); + ememory::SharedPtr other = ememory::staticPointerCast(_obj); other->m_value = m_value; m_value = ""; return true; diff --git a/ejson/internal/Value.h b/ejson/internal/Value.h index c0685e6..c836b97 100644 --- a/ejson/internal/Value.h +++ b/ejson/internal/Value.h @@ -56,6 +56,7 @@ namespace ejson { m_type(ejson::valueType::unknow) { m_type = ejson::valueType::value; }; + public: /** * @brief Virtualize destructor */