[DEV] set some const

This commit is contained in:
Edouard DUPIN 2016-07-20 21:10:06 +02:00
parent d2a9a09acb
commit f982c8da94
7 changed files with 15 additions and 10 deletions

View File

@ -9,7 +9,7 @@
#include <exml/internal/AttributeList.h>
exml::AttributeList::AttributeList(ememory::SharedPtr<exml::internal::Node> _internalNode) :
exml::AttributeList::AttributeList(const ememory::SharedPtr<exml::internal::Node>& _internalNode) :
exml::Node(_internalNode),
attributes(this) {

View File

@ -112,7 +112,7 @@ namespace exml {
* @brief basic element of a xml structure
* @param[in] _internalNode Value of the node
*/
AttributeList(ememory::SharedPtr<exml::internal::Node> _internalNode);
AttributeList(const ememory::SharedPtr<exml::internal::Node>& _internalNode);
/**
* @brief basic element of a xml structure
*/

View File

@ -9,7 +9,7 @@
#include <exml/internal/Element.h>
exml::Element::Element(ememory::SharedPtr<exml::internal::Node> _internalNode) :
exml::Element::Element(const ememory::SharedPtr<exml::internal::Node>& _internalNode) :
exml::AttributeList(_internalNode),
nodes(this) {
if (m_data == nullptr) {

View File

@ -106,7 +106,7 @@ namespace exml {
* @brief Constructor
* @param[in] _internalNode Internal Node to set data
*/
Element(ememory::SharedPtr<exml::internal::Node> _internalNode);
Element(const ememory::SharedPtr<exml::internal::Node>& _internalNode);
/**
* @brief Copy constructor
* @param[in] _obj Object to copy

View File

@ -503,3 +503,11 @@ void exml::internal::Element::clear() {
}
ememory::SharedPtr<exml::internal::Element> exml::internal::Element::toElement() {
return ememory::staticPointerCast<exml::internal::Element>(sharedFromThis());
}
const ememory::SharedPtr<exml::internal::Element> exml::internal::Element::toElement() const {
return ememory::staticPointerCast<exml::internal::Element>(sharedFromThis());
}

View File

@ -126,12 +126,8 @@ namespace exml {
}
bool iParse(const std::string& _data, int32_t& _pos, bool _caseSensitive, exml::FilePos& _filePos, exml::internal::Document& _doc) override;
bool iGenerate(std::string& _data, int32_t _indent) const override;
ememory::SharedPtr<exml::internal::Element> toElement() override {
return ememory::staticPointerCast<exml::internal::Element>(sharedFromThis());
}
const ememory::SharedPtr<exml::internal::Element> toElement() const override {
return ememory::staticPointerCast<exml::internal::Element>(sharedFromThis());
}
ememory::SharedPtr<exml::internal::Element> toElement() override;
const ememory::SharedPtr<exml::internal::Element> toElement() const override;
void clear() override;
};
}

View File

@ -5,6 +5,7 @@
*/
#include <gtest/gtest.h>
#include <test-debug/debug.h>
#include <exml/exml.h>
#include <exml/Element.h>
#include <exml/Comment.h>