[DEV] cahnge level from error to debug when interface try to get on a nullptr
This commit is contained in:
parent
f982c8da94
commit
929f714f33
@ -41,7 +41,7 @@ exml::Attribute& exml::Attribute::operator= (const exml::Attribute& _obj) {
|
||||
|
||||
void exml::Attribute::setName(const std::string& _name){
|
||||
if (m_data == nullptr) {
|
||||
EXML_ERROR(" can not setName (nullptr) ...");
|
||||
EXML_DEBUG(" can not setName (nullptr) ...");
|
||||
return;
|
||||
}
|
||||
static_cast<exml::internal::Attribute*>(m_data.get())->setName(_name);
|
||||
@ -50,7 +50,7 @@ void exml::Attribute::setName(const std::string& _name){
|
||||
const std::string& exml::Attribute::getName() const {
|
||||
if (m_data == nullptr) {
|
||||
static std::string errorValue = "";
|
||||
EXML_ERROR(" can not setName (nullptr) ...");
|
||||
EXML_DEBUG(" can not setName (nullptr) ...");
|
||||
return errorValue;
|
||||
}
|
||||
return static_cast<const exml::internal::Attribute*>(m_data.get())->getName();
|
||||
@ -58,7 +58,7 @@ const std::string& exml::Attribute::getName() const {
|
||||
|
||||
void exml::Attribute::clear() {
|
||||
if (m_data == nullptr) {
|
||||
EXML_ERROR(" can not setName (nullptr) ...");
|
||||
EXML_DEBUG(" can not setName (nullptr) ...");
|
||||
return;
|
||||
}
|
||||
static_cast<exml::internal::Attribute*>(m_data.get())->clear();
|
||||
@ -66,7 +66,7 @@ void exml::Attribute::clear() {
|
||||
|
||||
std::pair<std::string, std::string> exml::Attribute::getPair() const {
|
||||
if (m_data == nullptr) {
|
||||
EXML_ERROR(" can not setName (nullptr) ...");
|
||||
EXML_DEBUG(" can not setName (nullptr) ...");
|
||||
return std::pair<std::string, std::string>("","");
|
||||
}
|
||||
return std::pair<std::string, std::string>(static_cast<const exml::internal::Attribute*>(m_data.get())->getName(),
|
||||
|
@ -28,7 +28,7 @@ exml::AttributeListData::AttributeListData(exml::AttributeList* _list) :
|
||||
|
||||
size_t exml::AttributeListData::size() const {
|
||||
if (m_data->m_data == nullptr) {
|
||||
EXML_ERROR(" can not sizeAttribute ...");
|
||||
EXML_DEBUG(" can not sizeAttribute ...");
|
||||
return 0;
|
||||
}
|
||||
return static_cast<exml::internal::AttributeList*>(m_data->m_data.get())->sizeAttribute();
|
||||
@ -37,7 +37,7 @@ size_t exml::AttributeListData::size() const {
|
||||
|
||||
exml::Attribute exml::AttributeListData::operator[] (int32_t _id) {
|
||||
if (m_data->m_data == nullptr) {
|
||||
EXML_ERROR(" can not getAttr (nullptr) ...");
|
||||
EXML_DEBUG(" can not getAttr (nullptr) ...");
|
||||
return exml::Attribute(ememory::SharedPtr<exml::internal::Attribute>(nullptr));
|
||||
}
|
||||
return exml::Attribute(static_cast<exml::internal::AttributeList*>(m_data->m_data.get())->getAttr(_id));
|
||||
@ -45,7 +45,7 @@ exml::Attribute exml::AttributeListData::operator[] (int32_t _id) {
|
||||
|
||||
const exml::Attribute exml::AttributeListData::operator[] (int32_t _id) const {
|
||||
if (m_data->m_data == nullptr) {
|
||||
EXML_ERROR(" can not getAttr (nullptr) ...");
|
||||
EXML_DEBUG(" can not getAttr (nullptr) ...");
|
||||
return exml::Attribute(ememory::SharedPtr<exml::internal::Attribute>(nullptr));
|
||||
}
|
||||
return exml::Attribute(static_cast<exml::internal::AttributeList*>(m_data->m_data.get())->getAttr(_id));
|
||||
@ -53,7 +53,7 @@ const exml::Attribute exml::AttributeListData::operator[] (int32_t _id) const {
|
||||
|
||||
std::pair<std::string, std::string> exml::AttributeListData::getPair(int32_t _id) const {
|
||||
if (m_data->m_data == nullptr) {
|
||||
EXML_ERROR(" can not getAttrPair (nullptr) ...");
|
||||
EXML_DEBUG(" can not getAttrPair (nullptr) ...");
|
||||
return std::pair<std::string, std::string>("","");
|
||||
}
|
||||
return static_cast<exml::internal::AttributeList*>(m_data->m_data.get())->getAttrPair(_id);
|
||||
@ -61,7 +61,7 @@ std::pair<std::string, std::string> exml::AttributeListData::getPair(int32_t _id
|
||||
|
||||
void exml::AttributeListData::add(exml::Attribute _attr) {
|
||||
if (m_data->m_data == nullptr) {
|
||||
EXML_ERROR(" can not appendAttribute (nullptr) ...");
|
||||
EXML_DEBUG(" can not appendAttribute (nullptr) ...");
|
||||
return;
|
||||
}
|
||||
static_cast<exml::internal::AttributeList*>(m_data->m_data.get())->appendAttribute(_attr.getInternalAttribute());
|
||||
@ -69,7 +69,7 @@ void exml::AttributeListData::add(exml::Attribute _attr) {
|
||||
|
||||
const std::string& exml::AttributeListData::operator[](const std::string& _name) const {
|
||||
if (m_data->m_data == nullptr) {
|
||||
EXML_ERROR(" can not getAttribute (nullptr) ...");
|
||||
EXML_DEBUG(" can not getAttribute (nullptr) ...");
|
||||
static std::string errorValue("");
|
||||
return errorValue;
|
||||
}
|
||||
@ -78,7 +78,7 @@ const std::string& exml::AttributeListData::operator[](const std::string& _name)
|
||||
|
||||
bool exml::AttributeListData::exist(const std::string& _name) const {
|
||||
if (m_data->m_data == nullptr) {
|
||||
EXML_ERROR(" can not getAttribute (nullptr) ...");
|
||||
EXML_DEBUG(" can not getAttribute (nullptr) ...");
|
||||
return false;
|
||||
}
|
||||
return static_cast<exml::internal::AttributeList*>(m_data->m_data.get())->existAttribute(_name);
|
||||
@ -86,7 +86,7 @@ bool exml::AttributeListData::exist(const std::string& _name) const {
|
||||
|
||||
bool exml::AttributeListData::remove(const std::string& _name) {
|
||||
if (m_data->m_data == nullptr) {
|
||||
EXML_ERROR(" can not removeAttribute (nullptr) ...");
|
||||
EXML_DEBUG(" can not removeAttribute (nullptr) ...");
|
||||
return false;
|
||||
}
|
||||
return static_cast<exml::internal::AttributeList*>(m_data->m_data.get())->removeAttribute(_name);
|
||||
@ -94,7 +94,7 @@ bool exml::AttributeListData::remove(const std::string& _name) {
|
||||
|
||||
void exml::AttributeListData::set(const std::string& _name, const std::string& _value) {
|
||||
if (m_data->m_data == nullptr) {
|
||||
EXML_ERROR(" can not setAttribute (nullptr) ...");
|
||||
EXML_DEBUG(" can not setAttribute (nullptr) ...");
|
||||
return;
|
||||
}
|
||||
static_cast<exml::internal::AttributeList*>(m_data->m_data.get())->setAttribute(_name, _value);
|
||||
|
@ -36,7 +36,7 @@ exml::Document& exml::Document::operator= (const exml::Document& _obj) {
|
||||
|
||||
bool exml::Document::parse(const std::string& _data) {
|
||||
if (m_data == nullptr) {
|
||||
EXML_ERROR("Can not parse (nullptr) ...");
|
||||
EXML_DEBUG("Can not parse (nullptr) ...");
|
||||
return false;
|
||||
}
|
||||
return static_cast<exml::internal::Document*>(m_data.get())->parse(_data);
|
||||
@ -44,7 +44,7 @@ bool exml::Document::parse(const std::string& _data) {
|
||||
|
||||
bool exml::Document::generate(std::string& _data) {
|
||||
if (m_data == nullptr) {
|
||||
EXML_ERROR("Can not generate (nullptr) ...");
|
||||
EXML_DEBUG("Can not generate (nullptr) ...");
|
||||
return false;
|
||||
}
|
||||
return static_cast<exml::internal::Document*>(m_data.get())->generate(_data);
|
||||
@ -52,7 +52,7 @@ bool exml::Document::generate(std::string& _data) {
|
||||
|
||||
bool exml::Document::load(const std::string& _file) {
|
||||
if (m_data == nullptr) {
|
||||
EXML_ERROR("Can not load (nullptr) ...");
|
||||
EXML_DEBUG("Can not load (nullptr) ...");
|
||||
return false;
|
||||
}
|
||||
return static_cast<exml::internal::Document*>(m_data.get())->load(_file);
|
||||
@ -60,7 +60,7 @@ bool exml::Document::load(const std::string& _file) {
|
||||
|
||||
bool exml::Document::store(const std::string& _file) {
|
||||
if (m_data == nullptr) {
|
||||
EXML_ERROR("Can not store (nullptr) ...");
|
||||
EXML_DEBUG("Can not store (nullptr) ...");
|
||||
return false;
|
||||
}
|
||||
return static_cast<exml::internal::Document*>(m_data.get())->store(_file);
|
||||
@ -68,7 +68,7 @@ bool exml::Document::store(const std::string& _file) {
|
||||
|
||||
void exml::Document::display() {
|
||||
if (m_data == nullptr) {
|
||||
EXML_ERROR("Can not display (nullptr) ...");
|
||||
EXML_DEBUG("Can not display (nullptr) ...");
|
||||
return;
|
||||
}
|
||||
static_cast<exml::internal::Document*>(m_data.get())->display();
|
||||
@ -76,7 +76,7 @@ void exml::Document::display() {
|
||||
|
||||
void exml::Document::setCaseSensitive(bool _val) {
|
||||
if (m_data == nullptr) {
|
||||
EXML_ERROR("Can not setCaseSensitive (nullptr) ...");
|
||||
EXML_DEBUG("Can not setCaseSensitive (nullptr) ...");
|
||||
return;
|
||||
}
|
||||
static_cast<exml::internal::Document*>(m_data.get())->setCaseSensitive(_val);
|
||||
@ -84,7 +84,7 @@ void exml::Document::setCaseSensitive(bool _val) {
|
||||
|
||||
bool exml::Document::getCaseSensitive() const {
|
||||
if (m_data == nullptr) {
|
||||
EXML_ERROR("Can not getCaseSensitive (nullptr) ...");
|
||||
EXML_DEBUG("Can not getCaseSensitive (nullptr) ...");
|
||||
return false;
|
||||
}
|
||||
return static_cast<const exml::internal::Document*>(m_data.get())->getCaseSensitive();
|
||||
@ -92,7 +92,7 @@ bool exml::Document::getCaseSensitive() const {
|
||||
|
||||
void exml::Document::setDisplayError(bool _value){
|
||||
if (m_data == nullptr) {
|
||||
EXML_ERROR("Can not setDisplayError (nullptr) ...");
|
||||
EXML_DEBUG("Can not setDisplayError (nullptr) ...");
|
||||
return;
|
||||
}
|
||||
static_cast<exml::internal::Document*>(m_data.get())->setDisplayError(_value);
|
||||
@ -100,7 +100,7 @@ void exml::Document::setDisplayError(bool _value){
|
||||
|
||||
bool exml::Document::getDisplayError() {
|
||||
if (m_data == nullptr) {
|
||||
EXML_ERROR("Can not getDisplayError (nullptr) ...");
|
||||
EXML_DEBUG("Can not getDisplayError (nullptr) ...");
|
||||
return false;
|
||||
}
|
||||
return static_cast<exml::internal::Document*>(m_data.get())->getDisplayError();
|
||||
@ -108,7 +108,7 @@ bool exml::Document::getDisplayError() {
|
||||
|
||||
void exml::Document::displayError() {
|
||||
if (m_data == nullptr) {
|
||||
EXML_ERROR("Can not displayError (nullptr) ...");
|
||||
EXML_DEBUG("Can not displayError (nullptr) ...");
|
||||
return;
|
||||
}
|
||||
static_cast<exml::internal::Document*>(m_data.get())->displayError();
|
||||
|
@ -62,7 +62,7 @@ exml::ElementData::ElementData(exml::Element* _elem) :
|
||||
|
||||
size_t exml::ElementData::size() const {
|
||||
if (m_data->m_data == nullptr) {
|
||||
EXML_ERROR(" can not get type ...");
|
||||
EXML_DEBUG(" can not get type ...");
|
||||
return 0;
|
||||
}
|
||||
return static_cast<const exml::internal::Element*>(m_data->m_data.get())->size();
|
||||
@ -70,7 +70,7 @@ size_t exml::ElementData::size() const {
|
||||
|
||||
enum exml::nodeType exml::ElementData::getType(int32_t _id) const {
|
||||
if (m_data->m_data == nullptr) {
|
||||
EXML_ERROR(" can not get type ...");
|
||||
EXML_DEBUG(" can not get type ...");
|
||||
return exml::nodeType::unknow;
|
||||
}
|
||||
return static_cast<const exml::internal::Element*>(m_data->m_data.get())->getType(_id);
|
||||
@ -78,7 +78,7 @@ enum exml::nodeType exml::ElementData::getType(int32_t _id) const {
|
||||
|
||||
exml::Node exml::ElementData::operator[](int32_t _id) {
|
||||
if (m_data->m_data == nullptr) {
|
||||
EXML_ERROR(" can not get type ...");
|
||||
EXML_DEBUG(" can not get type ...");
|
||||
return exml::Node();
|
||||
}
|
||||
return exml::Node(static_cast<exml::internal::Element*>(m_data->m_data.get())->getNode(_id));
|
||||
@ -86,7 +86,7 @@ exml::Node exml::ElementData::operator[](int32_t _id) {
|
||||
|
||||
const exml::Node exml::ElementData::operator[](int32_t _id) const {
|
||||
if (m_data->m_data == nullptr) {
|
||||
EXML_ERROR(" can not get type ...");
|
||||
EXML_DEBUG(" can not get type ...");
|
||||
return exml::Node();
|
||||
}
|
||||
return exml::Node(static_cast<const exml::internal::Element*>(m_data->m_data.get())->getNode(_id));
|
||||
@ -94,7 +94,7 @@ const exml::Node exml::ElementData::operator[](int32_t _id) const {
|
||||
|
||||
exml::Element exml::ElementData::operator[](const std::string& _name) {
|
||||
if (m_data->m_data == nullptr) {
|
||||
EXML_ERROR(" can not get type ...");
|
||||
EXML_DEBUG(" can not get type ...");
|
||||
return exml::Element();
|
||||
}
|
||||
return exml::Element(static_cast<exml::internal::Element*>(m_data->m_data.get())->getNamed(_name));
|
||||
@ -102,7 +102,7 @@ exml::Element exml::ElementData::operator[](const std::string& _name) {
|
||||
|
||||
const exml::Element exml::ElementData::operator[] (const std::string& _name) const {
|
||||
if (m_data->m_data == nullptr) {
|
||||
EXML_ERROR(" can not get type ...");
|
||||
EXML_DEBUG(" can not get type ...");
|
||||
return exml::Element();
|
||||
}
|
||||
return exml::Element(static_cast<const exml::internal::Element*>(m_data->m_data.get())->getNamed(_name));
|
||||
@ -110,7 +110,7 @@ const exml::Element exml::ElementData::operator[] (const std::string& _name) con
|
||||
|
||||
void exml::ElementData::add(const exml::Node& _node) {
|
||||
if (m_data->m_data == nullptr) {
|
||||
EXML_ERROR(" can not APPEND on null element ...");
|
||||
EXML_DEBUG(" can not APPEND on null element ...");
|
||||
return;
|
||||
}
|
||||
static_cast<exml::internal::Element*>(m_data->m_data.get())->append(_node.m_data);
|
||||
@ -118,7 +118,7 @@ void exml::ElementData::add(const exml::Node& _node) {
|
||||
|
||||
void exml::ElementData::remove(const std::string& _nodeName) {
|
||||
if (m_data->m_data == nullptr) {
|
||||
EXML_ERROR(" can not APPEND on null element ...");
|
||||
EXML_DEBUG(" can not APPEND on null element ...");
|
||||
return;
|
||||
}
|
||||
static_cast<exml::internal::Element*>(m_data->m_data.get())->remove(_nodeName);
|
||||
@ -126,7 +126,7 @@ void exml::ElementData::remove(const std::string& _nodeName) {
|
||||
|
||||
std::string exml::Element::getText() const {
|
||||
if (m_data == nullptr) {
|
||||
EXML_ERROR(" can not APPEND on null element ...");
|
||||
EXML_DEBUG(" can not APPEND on null element ...");
|
||||
return "";
|
||||
}
|
||||
return static_cast<const exml::internal::Element*>(m_data.get())->getText();
|
||||
@ -134,7 +134,7 @@ std::string exml::Element::getText() const {
|
||||
|
||||
void exml::Element::clear() {
|
||||
if (m_data == nullptr) {
|
||||
EXML_ERROR(" can not CLEAR on null element ...");
|
||||
EXML_DEBUG(" can not CLEAR on null element ...");
|
||||
return;
|
||||
}
|
||||
static_cast<exml::internal::Element*>(m_data.get())->clear();
|
||||
|
@ -60,7 +60,7 @@ void exml::Node::setValue(std::string _value) {
|
||||
const std::string& exml::Node::getValue() const {
|
||||
if (m_data == nullptr) {
|
||||
static std::string errorString = "";
|
||||
EXML_ERROR(" can not get value ...");
|
||||
EXML_DEBUG(" can not get value ...");
|
||||
return errorString;
|
||||
}
|
||||
return m_data->getValue();
|
||||
@ -68,7 +68,7 @@ const std::string& exml::Node::getValue() const {
|
||||
|
||||
enum exml::nodeType exml::Node::getType() const {
|
||||
if (m_data == nullptr) {
|
||||
EXML_ERROR("Can not get type ...");
|
||||
EXML_DEBUG("Can not get type ...");
|
||||
return exml::nodeType::unknow;
|
||||
}
|
||||
return m_data->getType();
|
||||
|
Loading…
x
Reference in New Issue
Block a user