[DEV] update etk null

This commit is contained in:
Edouard DUPIN 2018-06-19 22:13:47 +02:00
parent ec1b6f5318
commit 7ae4ea7215
18 changed files with 167 additions and 167 deletions

View File

@ -10,12 +10,12 @@
exml::Attribute::Attribute(ememory::SharedPtr<exml::internal::Node> _internalNode) : exml::Attribute::Attribute(ememory::SharedPtr<exml::internal::Node> _internalNode) :
exml::Node(_internalNode) { exml::Node(_internalNode) {
if (m_data == nullptr) { if (m_data == null) {
return; return;
} }
if (m_data->isAttribute() == false) { if (m_data->isAttribute() == false) {
// try to set wrong type inside ... ==> remove it ... // 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::Attribute::Attribute(null) :
exml::Node(nullptr) { exml::Node(null) {
} }
*/ */
@ -40,33 +40,33 @@ exml::Attribute& exml::Attribute::operator= (const exml::Attribute& _obj) {
} }
void exml::Attribute::setName(const etk::String& _name){ void exml::Attribute::setName(const etk::String& _name){
if (m_data == nullptr) { if (m_data == null) {
EXML_DEBUG(" can not setName (nullptr) ..."); EXML_DEBUG(" can not setName (null) ...");
return; return;
} }
static_cast<exml::internal::Attribute*>(m_data.get())->setName(_name); static_cast<exml::internal::Attribute*>(m_data.get())->setName(_name);
} }
const etk::String& exml::Attribute::getName() const { const etk::String& exml::Attribute::getName() const {
if (m_data == nullptr) { if (m_data == null) {
static etk::String errorValue = ""; static etk::String errorValue = "";
EXML_DEBUG(" can not setName (nullptr) ..."); EXML_DEBUG(" can not setName (null) ...");
return errorValue; return errorValue;
} }
return static_cast<const exml::internal::Attribute*>(m_data.get())->getName(); return static_cast<const exml::internal::Attribute*>(m_data.get())->getName();
} }
void exml::Attribute::clear() { void exml::Attribute::clear() {
if (m_data == nullptr) { if (m_data == null) {
EXML_DEBUG(" can not setName (nullptr) ..."); EXML_DEBUG(" can not setName (null) ...");
return; return;
} }
static_cast<exml::internal::Attribute*>(m_data.get())->clear(); static_cast<exml::internal::Attribute*>(m_data.get())->clear();
} }
etk::Pair<etk::String, etk::String> exml::Attribute::getPair() const { etk::Pair<etk::String, etk::String> exml::Attribute::getPair() const {
if (m_data == nullptr) { if (m_data == null) {
EXML_DEBUG(" can not setName (nullptr) ..."); EXML_DEBUG(" can not setName (null) ...");
return etk::Pair<etk::String, etk::String>("",""); return etk::Pair<etk::String, etk::String>("","");
} }
return etk::Pair<etk::String, etk::String>(static_cast<const exml::internal::Attribute*>(m_data.get())->getName(), return etk::Pair<etk::String, etk::String>(static_cast<const exml::internal::Attribute*>(m_data.get())->getName(),

View File

@ -28,7 +28,7 @@ namespace exml {
* @brief Copy constructor * @brief Copy constructor
* @param[in] _obj Object to copy * @param[in] _obj Object to copy
*/ */
// TODO : Attribute(nullptr); // TODO : Attribute(null);
/** /**
* @brief Copy constructor * @brief Copy constructor
* @param[in] _obj Object to copy * @param[in] _obj Object to copy

View File

@ -27,7 +27,7 @@ exml::AttributeListData::AttributeListData(exml::AttributeList* _list) :
} }
size_t exml::AttributeListData::size() const { size_t exml::AttributeListData::size() const {
if (m_data->m_data == nullptr) { if (m_data->m_data == null) {
EXML_DEBUG(" can not sizeAttribute ..."); EXML_DEBUG(" can not sizeAttribute ...");
return 0; return 0;
} }
@ -36,40 +36,40 @@ size_t exml::AttributeListData::size() const {
} }
exml::Attribute exml::AttributeListData::operator[] (int32_t _id) { exml::Attribute exml::AttributeListData::operator[] (int32_t _id) {
if (m_data->m_data == nullptr) { if (m_data->m_data == null) {
EXML_DEBUG(" can not getAttr (nullptr) ..."); EXML_DEBUG(" can not getAttr (null) ...");
return exml::Attribute(ememory::SharedPtr<exml::internal::Attribute>(nullptr)); return exml::Attribute(ememory::SharedPtr<exml::internal::Attribute>(null));
} }
return exml::Attribute(static_cast<exml::internal::AttributeList*>(m_data->m_data.get())->getAttr(_id)); return exml::Attribute(static_cast<exml::internal::AttributeList*>(m_data->m_data.get())->getAttr(_id));
} }
const exml::Attribute exml::AttributeListData::operator[] (int32_t _id) const { const exml::Attribute exml::AttributeListData::operator[] (int32_t _id) const {
if (m_data->m_data == nullptr) { if (m_data->m_data == null) {
EXML_DEBUG(" can not getAttr (nullptr) ..."); EXML_DEBUG(" can not getAttr (null) ...");
return exml::Attribute(ememory::SharedPtr<exml::internal::Attribute>(nullptr)); return exml::Attribute(ememory::SharedPtr<exml::internal::Attribute>(null));
} }
return exml::Attribute(static_cast<exml::internal::AttributeList*>(m_data->m_data.get())->getAttr(_id)); return exml::Attribute(static_cast<exml::internal::AttributeList*>(m_data->m_data.get())->getAttr(_id));
} }
etk::Pair<etk::String, etk::String> exml::AttributeListData::getPair(int32_t _id) const { etk::Pair<etk::String, etk::String> exml::AttributeListData::getPair(int32_t _id) const {
if (m_data->m_data == nullptr) { if (m_data->m_data == null) {
EXML_DEBUG(" can not getAttrPair (nullptr) ..."); EXML_DEBUG(" can not getAttrPair (null) ...");
return etk::Pair<etk::String, etk::String>("",""); return etk::Pair<etk::String, etk::String>("","");
} }
return static_cast<exml::internal::AttributeList*>(m_data->m_data.get())->getAttrPair(_id); return static_cast<exml::internal::AttributeList*>(m_data->m_data.get())->getAttrPair(_id);
} }
void exml::AttributeListData::add(exml::Attribute _attr) { void exml::AttributeListData::add(exml::Attribute _attr) {
if (m_data->m_data == nullptr) { if (m_data->m_data == null) {
EXML_DEBUG(" can not appendAttribute (nullptr) ..."); EXML_DEBUG(" can not appendAttribute (null) ...");
return; return;
} }
static_cast<exml::internal::AttributeList*>(m_data->m_data.get())->appendAttribute(_attr.getInternalAttribute()); static_cast<exml::internal::AttributeList*>(m_data->m_data.get())->appendAttribute(_attr.getInternalAttribute());
} }
const etk::String& exml::AttributeListData::operator[](const etk::String& _name) const { const etk::String& exml::AttributeListData::operator[](const etk::String& _name) const {
if (m_data->m_data == nullptr) { if (m_data->m_data == null) {
EXML_DEBUG(" can not getAttribute (nullptr) ..."); EXML_DEBUG(" can not getAttribute (null) ...");
static etk::String errorValue(""); static etk::String errorValue("");
return 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 { bool exml::AttributeListData::exist(const etk::String& _name) const {
if (m_data->m_data == nullptr) { if (m_data->m_data == null) {
EXML_DEBUG(" can not getAttribute (nullptr) ..."); EXML_DEBUG(" can not getAttribute (null) ...");
return false; return false;
} }
return static_cast<exml::internal::AttributeList*>(m_data->m_data.get())->existAttribute(_name); return static_cast<exml::internal::AttributeList*>(m_data->m_data.get())->existAttribute(_name);
} }
bool exml::AttributeListData::remove(const etk::String& _name) { bool exml::AttributeListData::remove(const etk::String& _name) {
if (m_data->m_data == nullptr) { if (m_data->m_data == null) {
EXML_DEBUG(" can not removeAttribute (nullptr) ..."); EXML_DEBUG(" can not removeAttribute (null) ...");
return false; return false;
} }
return static_cast<exml::internal::AttributeList*>(m_data->m_data.get())->removeAttribute(_name); return static_cast<exml::internal::AttributeList*>(m_data->m_data.get())->removeAttribute(_name);
} }
void exml::AttributeListData::set(const etk::String& _name, const etk::String& _value) { void exml::AttributeListData::set(const etk::String& _name, const etk::String& _value) {
if (m_data->m_data == nullptr) { if (m_data->m_data == null) {
EXML_DEBUG(" can not setAttribute (nullptr) ..."); EXML_DEBUG(" can not setAttribute (null) ...");
return; return;
} }
static_cast<exml::internal::AttributeList*>(m_data->m_data.get())->setAttribute(_name, _value); static_cast<exml::internal::AttributeList*>(m_data->m_data.get())->setAttribute(_name, _value);

View File

@ -16,11 +16,11 @@ namespace exml {
*/ */
class AttributeListData { class AttributeListData {
private: 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: public:
/** /**
* @brief Constructor on the AttributeListData class * @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); AttributeListData(exml::AttributeList* _list);
public: public:

View File

@ -10,12 +10,12 @@
exml::Comment::Comment(ememory::SharedPtr<exml::internal::Node> _internalNode) : exml::Comment::Comment(ememory::SharedPtr<exml::internal::Node> _internalNode) :
exml::Node(_internalNode) { exml::Node(_internalNode) {
if (m_data == nullptr) { if (m_data == null) {
return; return;
} }
if (m_data->isComment() == false) { if (m_data->isComment() == false) {
// try to set wrong type inside ... ==> remove it ... // try to set wrong type inside ... ==> remove it ...
m_data = nullptr; m_data = null;
} }
} }

View File

@ -10,12 +10,12 @@
exml::Declaration::Declaration(ememory::SharedPtr<exml::internal::Node> _internalNode) : exml::Declaration::Declaration(ememory::SharedPtr<exml::internal::Node> _internalNode) :
exml::AttributeList(_internalNode) { exml::AttributeList(_internalNode) {
if (m_data == nullptr) { if (m_data == null) {
return; return;
} }
if (m_data->isDeclaration() == false) { if (m_data->isDeclaration() == false) {
// try to set wrong type inside ... ==> remove it ... // 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<exml::internal::Node> _internalNode) : exml::DeclarationXML::DeclarationXML(ememory::SharedPtr<exml::internal::Node> _internalNode) :
exml::Declaration(_internalNode) { exml::Declaration(_internalNode) {
if (m_data == nullptr) { if (m_data == null) {
return; return;
} }
// TODO: Do it better // TODO: Do it better
if (m_data->isDeclaration() == false) { if (m_data->isDeclaration() == false) {
// try to set wrong type inside ... ==> remove it ... // try to set wrong type inside ... ==> remove it ...
m_data = nullptr; m_data = null;
} }
} }

View File

@ -10,12 +10,12 @@
exml::Document::Document(ememory::SharedPtr<exml::internal::Node> _internalNode) : exml::Document::Document(ememory::SharedPtr<exml::internal::Node> _internalNode) :
exml::Element(_internalNode) { exml::Element(_internalNode) {
if (m_data == nullptr) { if (m_data == null) {
return; return;
} }
if (m_data->isDocument() == false) { if (m_data->isDocument() == false) {
// try to set wrong type inside ... ==> remove it ... // 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) { bool exml::Document::parse(const etk::String& _data) {
if (m_data == nullptr) { if (m_data == null) {
EXML_DEBUG("Can not parse (nullptr) ..."); EXML_DEBUG("Can not parse (null) ...");
return false; return false;
} }
return static_cast<exml::internal::Document*>(m_data.get())->parse(_data); return static_cast<exml::internal::Document*>(m_data.get())->parse(_data);
} }
bool exml::Document::generate(etk::String& _data) { bool exml::Document::generate(etk::String& _data) {
if (m_data == nullptr) { if (m_data == null) {
EXML_DEBUG("Can not generate (nullptr) ..."); EXML_DEBUG("Can not generate (null) ...");
return false; return false;
} }
return static_cast<exml::internal::Document*>(m_data.get())->generate(_data); return static_cast<exml::internal::Document*>(m_data.get())->generate(_data);
} }
bool exml::Document::load(const etk::String& _file) { bool exml::Document::load(const etk::String& _file) {
if (m_data == nullptr) { if (m_data == null) {
EXML_DEBUG("Can not load (nullptr) ..."); EXML_DEBUG("Can not load (null) ...");
return false; return false;
} }
return static_cast<exml::internal::Document*>(m_data.get())->load(_file); return static_cast<exml::internal::Document*>(m_data.get())->load(_file);
} }
bool exml::Document::store(const etk::String& _file) { bool exml::Document::store(const etk::String& _file) {
if (m_data == nullptr) { if (m_data == null) {
EXML_DEBUG("Can not store (nullptr) ..."); EXML_DEBUG("Can not store (null) ...");
return false; return false;
} }
return static_cast<exml::internal::Document*>(m_data.get())->store(_file); return static_cast<exml::internal::Document*>(m_data.get())->store(_file);
} }
void exml::Document::display() { void exml::Document::display() {
if (m_data == nullptr) { if (m_data == null) {
EXML_DEBUG("Can not display (nullptr) ..."); EXML_DEBUG("Can not display (null) ...");
return; return;
} }
static_cast<exml::internal::Document*>(m_data.get())->display(); static_cast<exml::internal::Document*>(m_data.get())->display();
} }
void exml::Document::setCaseSensitive(bool _val) { void exml::Document::setCaseSensitive(bool _val) {
if (m_data == nullptr) { if (m_data == null) {
EXML_DEBUG("Can not setCaseSensitive (nullptr) ..."); EXML_DEBUG("Can not setCaseSensitive (null) ...");
return; return;
} }
static_cast<exml::internal::Document*>(m_data.get())->setCaseSensitive(_val); static_cast<exml::internal::Document*>(m_data.get())->setCaseSensitive(_val);
} }
bool exml::Document::getCaseSensitive() const { bool exml::Document::getCaseSensitive() const {
if (m_data == nullptr) { if (m_data == null) {
EXML_DEBUG("Can not getCaseSensitive (nullptr) ..."); EXML_DEBUG("Can not getCaseSensitive (null) ...");
return false; return false;
} }
return static_cast<const exml::internal::Document*>(m_data.get())->getCaseSensitive(); return static_cast<const exml::internal::Document*>(m_data.get())->getCaseSensitive();
} }
void exml::Document::setDisplayError(bool _value){ void exml::Document::setDisplayError(bool _value){
if (m_data == nullptr) { if (m_data == null) {
EXML_DEBUG("Can not setDisplayError (nullptr) ..."); EXML_DEBUG("Can not setDisplayError (null) ...");
return; return;
} }
static_cast<exml::internal::Document*>(m_data.get())->setDisplayError(_value); static_cast<exml::internal::Document*>(m_data.get())->setDisplayError(_value);
} }
bool exml::Document::getDisplayError() { bool exml::Document::getDisplayError() {
if (m_data == nullptr) { if (m_data == null) {
EXML_DEBUG("Can not getDisplayError (nullptr) ..."); EXML_DEBUG("Can not getDisplayError (null) ...");
return false; return false;
} }
return static_cast<exml::internal::Document*>(m_data.get())->getDisplayError(); return static_cast<exml::internal::Document*>(m_data.get())->getDisplayError();
} }
void exml::Document::displayError() { void exml::Document::displayError() {
if (m_data == nullptr) { if (m_data == null) {
EXML_DEBUG("Can not displayError (nullptr) ..."); EXML_DEBUG("Can not displayError (null) ...");
return; return;
} }
static_cast<exml::internal::Document*>(m_data.get())->displayError(); static_cast<exml::internal::Document*>(m_data.get())->displayError();

View File

@ -12,13 +12,13 @@
exml::Element::Element(const ememory::SharedPtr<exml::internal::Node>& _internalNode) : exml::Element::Element(const ememory::SharedPtr<exml::internal::Node>& _internalNode) :
exml::AttributeList(_internalNode), exml::AttributeList(_internalNode),
nodes(this) { nodes(this) {
if (m_data == nullptr) { if (m_data == null) {
return; return;
} }
if ( m_data->isElement() == false if ( m_data->isElement() == false
&& m_data->isDocument() == false) { && m_data->isDocument() == false) {
// try to set wrong type inside ... ==> remove it ... // 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 { size_t exml::ElementData::size() const {
if (m_data->m_data == nullptr) { if (m_data->m_data == null) {
EXML_DEBUG(" can not get type ..."); EXML_DEBUG(" can not get type ...");
return 0; return 0;
} }
@ -69,7 +69,7 @@ size_t exml::ElementData::size() const {
} }
enum exml::nodeType exml::ElementData::getType(int32_t _id) 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 ..."); EXML_DEBUG(" can not get type ...");
return exml::nodeType::unknow; 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) { 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 ..."); EXML_DEBUG(" can not get type ...");
return exml::Node(); 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 { 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 ..."); EXML_DEBUG(" can not get type ...");
return exml::Node(); 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) { 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 ..."); EXML_DEBUG(" can not get type ...");
return exml::Element(); 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 { 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 ..."); EXML_DEBUG(" can not get type ...");
return exml::Element(); 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) { 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 ..."); EXML_DEBUG(" can not APPEND on null element ...");
return; return;
} }
@ -117,7 +117,7 @@ void exml::ElementData::add(const exml::Node& _node) {
} }
void exml::ElementData::remove(const etk::String& _nodeName) { 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 ..."); EXML_DEBUG(" can not APPEND on null element ...");
return; return;
} }
@ -125,7 +125,7 @@ void exml::ElementData::remove(const etk::String& _nodeName) {
} }
etk::String exml::Element::getText() const { etk::String exml::Element::getText() const {
if (m_data == nullptr) { if (m_data == null) {
EXML_DEBUG(" can not APPEND on null element ..."); EXML_DEBUG(" can not APPEND on null element ...");
return ""; return "";
} }
@ -133,7 +133,7 @@ etk::String exml::Element::getText() const {
} }
void exml::Element::clear() { void exml::Element::clear() {
if (m_data == nullptr) { if (m_data == null) {
EXML_DEBUG(" can not CLEAR on null element ..."); EXML_DEBUG(" can not CLEAR on null element ...");
return; return;
} }

View File

@ -19,11 +19,11 @@ namespace exml {
*/ */
class ElementData { class ElementData {
private: 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: public:
/** /**
* @brief constructor on the ElementData class * @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); ElementData(exml::Element* _list);
public: public:

View File

@ -31,26 +31,26 @@ exml::Node::Node(const ememory::SharedPtr<exml::internal::Node>& _internalNode)
} }
exml::Node::Node() : exml::Node::Node() :
m_data(nullptr) { m_data(null) {
} }
bool exml::Node::exist() const { bool exml::Node::exist() const {
if (m_data == nullptr) { if (m_data == null) {
return false; return false;
} }
return true; return true;
} }
exml::FilePos exml::Node::getPos() const { exml::FilePos exml::Node::getPos() const {
if (m_data == nullptr) { if (m_data == null) {
return exml::FilePos(0,0); return exml::FilePos(0,0);
} }
return m_data->getPos(); return m_data->getPos();
} }
void exml::Node::setValue(etk::String _value) { void exml::Node::setValue(etk::String _value) {
if (m_data == nullptr) { if (m_data == null) {
EXML_ERROR(" can not set value: '" << _value << "'"); EXML_ERROR(" can not set value: '" << _value << "'");
return; return;
} }
@ -58,7 +58,7 @@ void exml::Node::setValue(etk::String _value) {
} }
const etk::String& exml::Node::getValue() const { const etk::String& exml::Node::getValue() const {
if (m_data == nullptr) { if (m_data == null) {
static etk::String errorString = ""; static etk::String errorString = "";
EXML_DEBUG(" can not get value ..."); EXML_DEBUG(" can not get value ...");
return errorString; return errorString;
@ -67,7 +67,7 @@ const etk::String& exml::Node::getValue() const {
} }
enum exml::nodeType exml::Node::getType() const { enum exml::nodeType exml::Node::getType() const {
if (m_data == nullptr) { if (m_data == null) {
EXML_DEBUG("Can not get type ..."); EXML_DEBUG("Can not get type ...");
return exml::nodeType::unknow; return exml::nodeType::unknow;
} }
@ -123,49 +123,49 @@ const exml::Text exml::Node::toText() const {
} }
bool exml::Node::isDocument() const { bool exml::Node::isDocument() const {
if (m_data == nullptr) { if (m_data == null) {
return false; return false;
} }
return m_data->isDocument(); return m_data->isDocument();
} }
bool exml::Node::isAttribute() const { bool exml::Node::isAttribute() const {
if (m_data == nullptr) { if (m_data == null) {
return false; return false;
} }
return m_data->isAttribute(); return m_data->isAttribute();
} }
bool exml::Node::isComment() const { bool exml::Node::isComment() const {
if (m_data == nullptr) { if (m_data == null) {
return false; return false;
} }
return m_data->isComment(); return m_data->isComment();
} }
bool exml::Node::isDeclaration() const { bool exml::Node::isDeclaration() const {
if (m_data == nullptr) { if (m_data == null) {
return false; return false;
} }
return m_data->isDeclaration(); return m_data->isDeclaration();
} }
bool exml::Node::isElement() const { bool exml::Node::isElement() const {
if (m_data == nullptr) { if (m_data == null) {
return false; return false;
} }
return m_data->isElement() || m_data->isDocument(); return m_data->isElement() || m_data->isDocument();
} }
bool exml::Node::isText() const { bool exml::Node::isText() const {
if (m_data == nullptr) { if (m_data == null) {
return false; return false;
} }
return m_data->isText(); return m_data->isText();
} }
void exml::Node::clear() { void exml::Node::clear() {
if (m_data == nullptr) { if (m_data == null) {
return; return;
} }
return m_data->clear(); return m_data->clear();

View File

@ -77,62 +77,62 @@ namespace exml {
enum nodeType getType() const; enum nodeType getType() const;
/** /**
* @brief Cast the element in a Document if it is possible. * @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(); exml::Document toDocument();
/** /**
* @brief Cast the element in a Document if it is possible. * @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; const exml::Document toDocument() const;
/** /**
* @brief Cast the element in a Attribute if it is possible. * @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(); exml::Attribute toAttribute();
/** /**
* @brief Cast the element in a Attribute if it is possible. * @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; const exml::Attribute toAttribute() const;
/** /**
* @brief Cast the element in a Comment if it is possible. * @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(); exml::Comment toComment();
/** /**
* @brief Cast the element in a Comment if it is possible. * @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; const exml::Comment toComment() const;
/** /**
* @brief Cast the element in a Declaration if it is possible. * @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(); exml::Declaration toDeclaration();
/** /**
* @brief Cast the element in a Declaration if it is possible. * @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; const exml::Declaration toDeclaration() const;
/** /**
* @brief Cast the element in a Element if it is possible. * @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(); exml::Element toElement();
/** /**
* @brief Cast the element in a Element if it is possible. * @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; const exml::Element toElement() const;
/** /**
* @brief Cast the element in a Text if it is possible. * @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(); exml::Text toText();
/** /**
* @brief Cast the element in a Text if it is possible. * @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; const exml::Text toText() const;
/** /**

View File

@ -10,12 +10,12 @@
exml::Text::Text(ememory::SharedPtr<exml::internal::Node> _internalNode) : exml::Text::Text(ememory::SharedPtr<exml::internal::Node> _internalNode) :
exml::Node(_internalNode) { exml::Node(_internalNode) {
if (m_data == nullptr) { if (m_data == null) {
return; return;
} }
if (m_data->isText() == false) { if (m_data->isText() == false) {
// try to set wrong type inside ... ==> remove it ... // try to set wrong type inside ... ==> remove it ...
m_data = nullptr; m_data = null;
} }
} }

View File

@ -10,7 +10,7 @@
ememory::SharedPtr<exml::internal::Attribute> exml::internal::AttributeList::getAttr(int32_t _id) { ememory::SharedPtr<exml::internal::Attribute> exml::internal::AttributeList::getAttr(int32_t _id) {
if ( _id < 0 if ( _id < 0
|| size_t(_id) >= m_listAttribute.size()) { || size_t(_id) >= m_listAttribute.size()) {
return nullptr; return null;
} }
return m_listAttribute[_id]; return m_listAttribute[_id];
} }
@ -18,14 +18,14 @@ ememory::SharedPtr<exml::internal::Attribute> exml::internal::AttributeList::get
ememory::SharedPtr<const exml::internal::Attribute> exml::internal::AttributeList::getAttr(int32_t _id) const { ememory::SharedPtr<const exml::internal::Attribute> exml::internal::AttributeList::getAttr(int32_t _id) const {
if ( _id < 0 if ( _id < 0
|| size_t(_id) >= m_listAttribute.size()) { || size_t(_id) >= m_listAttribute.size()) {
return nullptr; return null;
} }
return m_listAttribute[_id]; return m_listAttribute[_id];
} }
etk::Pair<etk::String, etk::String> exml::internal::AttributeList::getAttrPair(int32_t _id) const { etk::Pair<etk::String, etk::String> exml::internal::AttributeList::getAttrPair(int32_t _id) const {
ememory::SharedPtr<const exml::internal::Attribute> att = getAttr(_id); ememory::SharedPtr<const exml::internal::Attribute> att = getAttr(_id);
if (att == nullptr) { if (att == null) {
return etk::makePair<etk::String, etk::String>("",""); return etk::makePair<etk::String, etk::String>("","");
} }
return etk::makePair(att->getName(),att->getValue()); return etk::makePair(att->getName(),att->getValue());
@ -33,7 +33,7 @@ etk::Pair<etk::String, etk::String> exml::internal::AttributeList::getAttrPair(i
void exml::internal::AttributeList::appendAttribute(const ememory::SharedPtr<exml::internal::Attribute>& _attr) { void exml::internal::AttributeList::appendAttribute(const ememory::SharedPtr<exml::internal::Attribute>& _attr) {
if (_attr == nullptr) { if (_attr == null) {
EXML_ERROR("Try to set an empty node"); EXML_ERROR("Try to set an empty node");
return; return;
} }
@ -52,7 +52,7 @@ const etk::String& exml::internal::AttributeList::getAttribute(const etk::String
return errorReturn; return errorReturn;
} }
for (size_t iii=0; iii<m_listAttribute.size(); iii++) { for (size_t iii=0; iii<m_listAttribute.size(); iii++) {
if( m_listAttribute[iii] != nullptr if( m_listAttribute[iii] != null
&& m_listAttribute[iii]->getName() == _name) { && m_listAttribute[iii]->getName() == _name) {
return m_listAttribute[iii]->getValue(); return m_listAttribute[iii]->getValue();
} }
@ -66,7 +66,7 @@ bool exml::internal::AttributeList::existAttribute(const etk::String& _name) con
return false; return false;
} }
for (size_t iii=0; iii<m_listAttribute.size(); ++iii) { for (size_t iii=0; iii<m_listAttribute.size(); ++iii) {
if( m_listAttribute[iii] != nullptr if( m_listAttribute[iii] != null
&& m_listAttribute[iii]->getName() == _name) { && m_listAttribute[iii]->getName() == _name) {
return true; return true;
} }
@ -80,7 +80,7 @@ bool exml::internal::AttributeList::removeAttribute(const etk::String& _name) {
} }
auto it = m_listAttribute.begin(); auto it = m_listAttribute.begin();
while (it != m_listAttribute.end()) { while (it != m_listAttribute.end()) {
if (*it == nullptr) { if (*it == null) {
it = m_listAttribute.erase(it); it = m_listAttribute.erase(it);
continue; 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) { void exml::internal::AttributeList::setAttribute(const etk::String& _name, const etk::String& _value) {
// check if attribute already det : // check if attribute already det :
for (size_t iii=0; iii<m_listAttribute.size(); ++iii) { for (size_t iii=0; iii<m_listAttribute.size(); ++iii) {
if( m_listAttribute[iii] != nullptr if( m_listAttribute[iii] != null
&& m_listAttribute[iii]->getName() == _name) { && m_listAttribute[iii]->getName() == _name) {
// update the value : // update the value :
m_listAttribute[iii]->setValue(_value); m_listAttribute[iii]->setValue(_value);
@ -104,7 +104,7 @@ void exml::internal::AttributeList::setAttribute(const etk::String& _name, const
} }
} }
ememory::SharedPtr<exml::internal::Attribute> attr = exml::internal::Attribute::create(_name, _value); ememory::SharedPtr<exml::internal::Attribute> attr = exml::internal::Attribute::create(_name, _value);
if (attr == nullptr) { if (attr == null) {
EXML_ERROR("memory allocation error..."); EXML_ERROR("memory allocation error...");
} }
m_listAttribute.pushBack(attr); 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 { bool exml::internal::AttributeList::iGenerate(etk::String& _data, int32_t _indent) const {
for (size_t iii=0; iii<m_listAttribute.size(); iii++) { for (size_t iii=0; iii<m_listAttribute.size(); iii++) {
if (m_listAttribute[iii] != nullptr) { if (m_listAttribute[iii] != null) {
m_listAttribute[iii]->iGenerate(_data, _indent); m_listAttribute[iii]->iGenerate(_data, _indent);
} }
} }

View File

@ -77,7 +77,7 @@ bool exml::internal::Declaration::iParse(const etk::String& _data, int32_t& _pos
if (checkAvaillable(_data[iii], true) == true) { if (checkAvaillable(_data[iii], true) == true) {
// we find an attibute == > create an element and parse it: // we find an attibute == > create an element and parse it:
ememory::SharedPtr<exml::internal::Attribute> attribute = exml::internal::Attribute::create(); ememory::SharedPtr<exml::internal::Attribute> attribute = exml::internal::Attribute::create();
if (attribute == nullptr) { if (attribute == null) {
CREATE_ERROR(_doc, _data, _pos, _filePos, " Allocation error ..."); CREATE_ERROR(_doc, _data, _pos, _filePos, " Allocation error ...");
return false; return false;
} }

View File

@ -24,7 +24,7 @@ exml::internal::Document::Document() :
bool exml::internal::Document::iGenerate(etk::String& _data, int32_t _indent) const { bool exml::internal::Document::iGenerate(etk::String& _data, int32_t _indent) const {
for (size_t iii=0; iii<m_listSub.size(); iii++) { for (size_t iii=0; iii<m_listSub.size(); iii++) {
if (m_listSub[iii] != nullptr) { if (m_listSub[iii] != null) {
m_listSub[iii]->iGenerate(_data, _indent); m_listSub[iii]->iGenerate(_data, _indent);
} }
} }

View File

@ -28,7 +28,7 @@ ememory::SharedPtr<exml::internal::Element> exml::internal::Element::create(cons
enum exml::nodeType exml::internal::Element::getType(int32_t _id) const { enum exml::nodeType exml::internal::Element::getType(int32_t _id) const {
ememory::SharedPtr<const exml::internal::Node> tmpp = getNode(_id); ememory::SharedPtr<const exml::internal::Node> tmpp = getNode(_id);
if (tmpp == nullptr) { if (tmpp == null) {
return exml::nodeType::unknow; return exml::nodeType::unknow;
} }
return tmpp->getType(); return tmpp->getType();
@ -37,7 +37,7 @@ enum exml::nodeType exml::internal::Element::getType(int32_t _id) const {
ememory::SharedPtr<exml::internal::Node> exml::internal::Element::getNode(int32_t _id) { ememory::SharedPtr<exml::internal::Node> exml::internal::Element::getNode(int32_t _id) {
if ( _id <0 if ( _id <0
|| (size_t)_id>=m_listSub.size()) { || (size_t)_id>=m_listSub.size()) {
return nullptr; return null;
} }
return m_listSub[_id]; return m_listSub[_id];
} }
@ -45,7 +45,7 @@ ememory::SharedPtr<exml::internal::Node> exml::internal::Element::getNode(int32_
const ememory::SharedPtr<exml::internal::Node> exml::internal::Element::getNode(int32_t _id) const { const ememory::SharedPtr<exml::internal::Node> exml::internal::Element::getNode(int32_t _id) const {
if ( _id <0 if ( _id <0
|| (size_t)_id>=m_listSub.size()) { || (size_t)_id>=m_listSub.size()) {
return nullptr; return null;
} }
return m_listSub[_id]; return m_listSub[_id];
} }
@ -53,56 +53,56 @@ const ememory::SharedPtr<exml::internal::Node> exml::internal::Element::getNode(
ememory::SharedPtr<exml::internal::Element> exml::internal::Element::getElement(int32_t _id) { ememory::SharedPtr<exml::internal::Element> exml::internal::Element::getElement(int32_t _id) {
ememory::SharedPtr<exml::internal::Node> tmpp = getNode(_id); ememory::SharedPtr<exml::internal::Node> tmpp = getNode(_id);
if (tmpp == nullptr) { if (tmpp == null) {
return nullptr; return null;
} }
return tmpp->toElement(); return tmpp->toElement();
} }
const ememory::SharedPtr<exml::internal::Element> exml::internal::Element::getElement(int32_t _id) const { const ememory::SharedPtr<exml::internal::Element> exml::internal::Element::getElement(int32_t _id) const {
const ememory::SharedPtr<exml::internal::Node> tmpp = getNode(_id); const ememory::SharedPtr<exml::internal::Node> tmpp = getNode(_id);
if (tmpp == nullptr) { if (tmpp == null) {
return nullptr; return null;
} }
return tmpp->toElement(); return tmpp->toElement();
} }
ememory::SharedPtr<exml::internal::Element> exml::internal::Element::getNamed(const etk::String& _name) { ememory::SharedPtr<exml::internal::Element> exml::internal::Element::getNamed(const etk::String& _name) {
if (_name.size() == 0) { if (_name.size() == 0) {
return nullptr; return null;
} }
for (size_t iii=0; iii<m_listSub.size(); iii++) { for (size_t iii=0; iii<m_listSub.size(); iii++) {
if( m_listSub[iii] != nullptr if( m_listSub[iii] != null
&& m_listSub[iii]->getType() == exml::nodeType::element && m_listSub[iii]->getType() == exml::nodeType::element
&& m_listSub[iii]->getValue() == _name) { && m_listSub[iii]->getValue() == _name) {
if (m_listSub[iii] == nullptr) { if (m_listSub[iii] == null) {
return nullptr; return null;
} }
return m_listSub[iii]->toElement(); return m_listSub[iii]->toElement();
} }
} }
return nullptr; return null;
} }
const ememory::SharedPtr<exml::internal::Element> exml::internal::Element::getNamed(const etk::String& _name) const { const ememory::SharedPtr<exml::internal::Element> exml::internal::Element::getNamed(const etk::String& _name) const {
if (_name.size() == 0) { if (_name.size() == 0) {
return nullptr; return null;
} }
for (size_t iii=0; iii<m_listSub.size(); iii++) { for (size_t iii=0; iii<m_listSub.size(); iii++) {
if( m_listSub[iii] != nullptr if( m_listSub[iii] != null
&& m_listSub[iii]->getType() == exml::nodeType::element && m_listSub[iii]->getType() == exml::nodeType::element
&& m_listSub[iii]->getValue() == _name) { && m_listSub[iii]->getValue() == _name) {
if (m_listSub[iii] == nullptr) { if (m_listSub[iii] == null) {
return nullptr; return null;
} }
return m_listSub[iii]->toElement(); return m_listSub[iii]->toElement();
} }
} }
return nullptr; return null;
} }
void exml::internal::Element::append(const ememory::SharedPtr<exml::internal::Node>& _node) { void exml::internal::Element::append(const ememory::SharedPtr<exml::internal::Node>& _node) {
if (_node == nullptr) { if (_node == null) {
EXML_ERROR("Try to set an empty node"); EXML_ERROR("Try to set an empty node");
return; return;
} }
@ -125,7 +125,7 @@ void exml::internal::Element::remove(const etk::String& _nodeName) {
} }
auto it = m_listSub.begin(); auto it = m_listSub.begin();
while (it != m_listSub.end()) { while (it != m_listSub.end()) {
if (*it == nullptr) { if (*it == null) {
it = m_listSub.erase(it); it = m_listSub.erase(it);
} else if ((*it)->getValue() == _nodeName) { } else if ((*it)->getValue() == _nodeName) {
it = m_listSub.erase(it); it = m_listSub.erase(it);
@ -145,7 +145,7 @@ etk::String exml::internal::Element::getText() const {
} }
} else { } else {
for (size_t iii=0; iii<m_listSub.size(); iii++) { for (size_t iii=0; iii<m_listSub.size(); iii++) {
if (m_listSub[iii] != nullptr) { if (m_listSub[iii] != null) {
m_listSub[iii]->iGenerate(res, 0); m_listSub[iii]->iGenerate(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()>0) {
if( m_listSub.size() == 1 if( m_listSub.size() == 1
&& m_listSub[0] != nullptr && m_listSub[0] != null
&& m_listSub[0]->getType() == exml::nodeType::text && m_listSub[0]->getType() == exml::nodeType::text
&& ememory::dynamicPointerCast<exml::internal::Text>(m_listSub[0])->countLines() == 1) { && ememory::dynamicPointerCast<exml::internal::Text>(m_listSub[0])->countLines() == 1) {
_data += ">"; _data += ">";
@ -171,7 +171,7 @@ bool exml::internal::Element::iGenerate(etk::String& _data, int32_t _indent) con
_data += ">\n"; _data += ">\n";
for (size_t iii=0; iii<m_listSub.size(); iii++) { for (size_t iii=0; iii<m_listSub.size(); iii++) {
if (m_listSub[iii] != nullptr) { if (m_listSub[iii] != null) {
m_listSub[iii]->iGenerate(_data, _indent+1); m_listSub[iii]->iGenerate(_data, _indent+1);
} }
} }
@ -236,7 +236,7 @@ bool exml::internal::Element::subParse(const etk::String& _data, int32_t& _pos,
} }
// Find declaration balise // Find declaration balise
ememory::SharedPtr<exml::internal::Declaration> declaration = exml::internal::Declaration::create(tmpname); ememory::SharedPtr<exml::internal::Declaration> declaration = exml::internal::Declaration::create(tmpname);
if (declaration == nullptr) { if (declaration == null) {
CREATE_ERROR(_doc, _data, _pos, _filePos, "Allocation Error..."); CREATE_ERROR(_doc, _data, _pos, _filePos, "Allocation Error...");
return false; return false;
} }
@ -269,7 +269,7 @@ bool exml::internal::Element::subParse(const etk::String& _data, int32_t& _pos,
++tmpPos; ++tmpPos;
// find comment: // find comment:
ememory::SharedPtr<exml::internal::Comment> comment = exml::internal::Comment::create(); ememory::SharedPtr<exml::internal::Comment> comment = exml::internal::Comment::create();
if (comment == nullptr) { if (comment == null) {
CREATE_ERROR(_doc, _data, _pos, _filePos, "Allocation error ..."); CREATE_ERROR(_doc, _data, _pos, _filePos, "Allocation error ...");
return false; return false;
} }
@ -298,7 +298,7 @@ bool exml::internal::Element::subParse(const etk::String& _data, int32_t& _pos,
tmpPos+=6; tmpPos+=6;
// find text: // find text:
ememory::SharedPtr<exml::internal::TextCDATA> text = exml::internal::TextCDATA::create(); ememory::SharedPtr<exml::internal::TextCDATA> text = exml::internal::TextCDATA::create();
if (text == nullptr) { if (text == null) {
CREATE_ERROR(_doc, _data, _pos, _filePos, "Allocation error ..."); CREATE_ERROR(_doc, _data, _pos, _filePos, "Allocation error ...");
return false; return false;
} }
@ -387,7 +387,7 @@ bool exml::internal::Element::subParse(const etk::String& _data, int32_t& _pos,
//EXML_INFO("find node named : '" << tmpname << "'"); //EXML_INFO("find node named : '" << tmpname << "'");
// find text: // find text:
ememory::SharedPtr<exml::internal::Element> element = exml::internal::Element::create(tmpname); ememory::SharedPtr<exml::internal::Element> element = exml::internal::Element::create(tmpname);
if (element == nullptr) { if (element == null) {
CREATE_ERROR(_doc, _data, _pos, _filePos, "Allocation error ..."); CREATE_ERROR(_doc, _data, _pos, _filePos, "Allocation error ...");
return false; return false;
} }
@ -418,7 +418,7 @@ bool exml::internal::Element::subParse(const etk::String& _data, int32_t& _pos,
} else { } else {
// find data == > parse it... // find data == > parse it...
ememory::SharedPtr<exml::internal::Text> text = exml::internal::Text::create(); ememory::SharedPtr<exml::internal::Text> text = exml::internal::Text::create();
if (text == nullptr) { if (text == null) {
CREATE_ERROR(_doc, _data, _pos, _filePos, "Allocation error ..."); CREATE_ERROR(_doc, _data, _pos, _filePos, "Allocation error ...");
return false; return false;
} }
@ -476,7 +476,7 @@ bool exml::internal::Element::iParse(const etk::String& _data,
if (checkAvaillable(_data[iii], true) == true) { if (checkAvaillable(_data[iii], true) == true) {
// we find an attibute == > create an element and parse it: // we find an attibute == > create an element and parse it:
ememory::SharedPtr<exml::internal::Attribute> attribute = exml::internal::Attribute::create(); ememory::SharedPtr<exml::internal::Attribute> attribute = exml::internal::Attribute::create();
if (attribute == nullptr) { if (attribute == null) {
CREATE_ERROR(_doc, _data, _pos, _filePos, "Allocation error ..."); CREATE_ERROR(_doc, _data, _pos, _filePos, "Allocation error ...");
return false; return false;
} }

View File

@ -134,51 +134,51 @@ enum exml::nodeType exml::internal::Node::getType() const {
} }
ememory::SharedPtr<exml::internal::Document> exml::internal::Node::toDocument() { ememory::SharedPtr<exml::internal::Document> exml::internal::Node::toDocument() {
return nullptr; return null;
} }
const ememory::SharedPtr<exml::internal::Document> exml::internal::Node::toDocument() const { const ememory::SharedPtr<exml::internal::Document> exml::internal::Node::toDocument() const {
return nullptr; return null;
} }
ememory::SharedPtr<exml::internal::Attribute> exml::internal::Node::toAttribute() { ememory::SharedPtr<exml::internal::Attribute> exml::internal::Node::toAttribute() {
return nullptr; return null;
} }
const ememory::SharedPtr<exml::internal::Attribute> exml::internal::Node::toAttribute() const { const ememory::SharedPtr<exml::internal::Attribute> exml::internal::Node::toAttribute() const {
return nullptr; return null;
} }
ememory::SharedPtr<exml::internal::Comment> exml::internal::Node::toComment() { ememory::SharedPtr<exml::internal::Comment> exml::internal::Node::toComment() {
return nullptr; return null;
} }
const ememory::SharedPtr<exml::internal::Comment> exml::internal::Node::toComment() const { const ememory::SharedPtr<exml::internal::Comment> exml::internal::Node::toComment() const {
return nullptr; return null;
} }
ememory::SharedPtr<exml::internal::Declaration> exml::internal::Node::toDeclaration() { ememory::SharedPtr<exml::internal::Declaration> exml::internal::Node::toDeclaration() {
return nullptr; return null;
} }
const ememory::SharedPtr<exml::internal::Declaration> exml::internal::Node::toDeclaration() const { const ememory::SharedPtr<exml::internal::Declaration> exml::internal::Node::toDeclaration() const {
return nullptr; return null;
} }
ememory::SharedPtr<exml::internal::Element> exml::internal::Node::toElement() { ememory::SharedPtr<exml::internal::Element> exml::internal::Node::toElement() {
return nullptr; return null;
} }
const ememory::SharedPtr<exml::internal::Element> exml::internal::Node::toElement() const { const ememory::SharedPtr<exml::internal::Element> exml::internal::Node::toElement() const {
return nullptr; return null;
} }
ememory::SharedPtr<exml::internal::Text> exml::internal::Node::toText() { ememory::SharedPtr<exml::internal::Text> exml::internal::Node::toText() {
return nullptr; return null;
} }
const ememory::SharedPtr<exml::internal::Text> exml::internal::Node::toText() const{ const ememory::SharedPtr<exml::internal::Text> exml::internal::Node::toText() const{
return nullptr; return null;
} }
bool exml::internal::Node::isDocument() const { bool exml::internal::Node::isDocument() const {

View File

@ -136,62 +136,62 @@ namespace exml {
public: public:
/** /**
* @brief Cast the element in a Document if it is possible. * @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<exml::internal::Document> toDocument(); virtual ememory::SharedPtr<exml::internal::Document> toDocument();
/** /**
* @brief Cast the element in a Document if it is possible. * @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<exml::internal::Document> toDocument() const; virtual const ememory::SharedPtr<exml::internal::Document> toDocument() const;
/** /**
* @brief Cast the element in a Attribute if it is possible. * @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<exml::internal::Attribute> toAttribute(); virtual ememory::SharedPtr<exml::internal::Attribute> toAttribute();
/** /**
* @brief Cast the element in a Attribute if it is possible. * @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<exml::internal::Attribute> toAttribute() const; virtual const ememory::SharedPtr<exml::internal::Attribute> toAttribute() const;
/** /**
* @brief Cast the element in a Comment if it is possible. * @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<exml::internal::Comment> toComment(); virtual ememory::SharedPtr<exml::internal::Comment> toComment();
/** /**
* @brief Cast the element in a Comment if it is possible. * @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<exml::internal::Comment> toComment() const; virtual const ememory::SharedPtr<exml::internal::Comment> toComment() const;
/** /**
* @brief Cast the element in a Declaration if it is possible. * @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<exml::internal::Declaration> toDeclaration(); virtual ememory::SharedPtr<exml::internal::Declaration> toDeclaration();
/** /**
* @brief Cast the element in a Declaration if it is possible. * @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<exml::internal::Declaration> toDeclaration() const; virtual const ememory::SharedPtr<exml::internal::Declaration> toDeclaration() const;
/** /**
* @brief Cast the element in a Element if it is possible. * @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<exml::internal::Element> toElement(); virtual ememory::SharedPtr<exml::internal::Element> toElement();
/** /**
* @brief Cast the element in a Element if it is possible. * @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<exml::internal::Element> toElement() const; virtual const ememory::SharedPtr<exml::internal::Element> toElement() const;
/** /**
* @brief Cast the element in a Text if it is possible. * @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<exml::internal::Text> toText(); virtual ememory::SharedPtr<exml::internal::Text> toText();
/** /**
* @brief Cast the element in a Text if it is possible. * @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<exml::internal::Text> toText() const; virtual const ememory::SharedPtr<exml::internal::Text> toText() const;