diff --git a/etk/stdTools.cpp b/etk/stdTools.cpp index 19be112..bd6a24c 100644 --- a/etk/stdTools.cpp +++ b/etk/stdTools.cpp @@ -173,7 +173,7 @@ static uint8_t sizeElement(const char* _data, int32_t _lenMax) { char32_t utf8::convertChar32(const char* _input) { char32_t value = 0; - if (NULL == _input) { + if (nullptr == _input) { return value; } int32_t len = strlen(_input); @@ -1121,6 +1121,125 @@ std::ostream& std::operator <<(std::ostream& _os, const std::vector& _obj) { + _os << "{"; + for (size_t iii=0; iii< _obj.size(); iii++) { + if (iii>0) { + _os << ";"; + } + _os << _obj[iii]; + } + _os << "}"; + return _os; +} + +std::ostream& std::operator <<(std::ostream& _os, const std::vector& _obj) { + _os << "{"; + for (size_t iii=0; iii< _obj.size(); iii++) { + if (iii>0) { + _os << ";"; + } + _os << _obj[iii]; + } + _os << "}"; + return _os; +} + +std::ostream& std::operator <<(std::ostream& _os, const std::vector& _obj) { + _os << "{"; + for (size_t iii=0; iii< _obj.size(); iii++) { + if (iii>0) { + _os << ";"; + } + _os << _obj[iii]; + } + _os << "}"; + return _os; +} + +std::ostream& std::operator <<(std::ostream& _os, const std::vector& _obj) { + _os << "{"; + for (size_t iii=0; iii< _obj.size(); iii++) { + if (iii>0) { + _os << ";"; + } + _os << _obj[iii]; + } + _os << "}"; + return _os; +} + +std::ostream& std::operator <<(std::ostream& _os, const std::vector& _obj) { + _os << "{"; + for (size_t iii=0; iii< _obj.size(); iii++) { + if (iii>0) { + _os << ";"; + } + _os << _obj[iii]; + } + _os << "}"; + return _os; +} + +std::ostream& std::operator <<(std::ostream& _os, const std::vector& _obj) { + _os << "{"; + for (size_t iii=0; iii< _obj.size(); iii++) { + if (iii>0) { + _os << ";"; + } + _os << _obj[iii]; + } + _os << "}"; + return _os; +} + +std::ostream& std::operator <<(std::ostream& _os, const std::vector& _obj) { + _os << "{"; + for (size_t iii=0; iii< _obj.size(); iii++) { + if (iii>0) { + _os << ";"; + } + _os << _obj[iii]; + } + _os << "}"; + return _os; +} + +std::ostream& std::operator <<(std::ostream& _os, const std::vector& _obj) { + _os << "{"; + for (size_t iii=0; iii< _obj.size(); iii++) { + if (iii>0) { + _os << ";"; + } + _os << _obj[iii]; + } + _os << "}"; + return _os; +} + +std::ostream& std::operator <<(std::ostream& _os, const std::vector& _obj) { + _os << "{"; + for (size_t iii=0; iii< _obj.size(); iii++) { + if (iii>0) { + _os << ";"; + } + _os << _obj[iii]; + } + _os << "}"; + return _os; +} + +std::ostream& std::operator <<(std::ostream& _os, const std::vector& _obj) { + _os << "{"; + for (size_t iii=0; iii< _obj.size(); iii++) { + if (iii>0) { + _os << ";"; + } + _os << _obj[iii]; + } + _os << "}"; + return _os; +} #if (defined(__TARGET_OS__Android)) std::string std::to_string(int _val) { diff --git a/etk/stdTools.h b/etk/stdTools.h index a44d54b..0535f5d 100644 --- a/etk/stdTools.h +++ b/etk/stdTools.h @@ -460,6 +460,15 @@ namespace etk { void sort(std::vector& _list); //! @previous void sort(std::vector& _list); + + template bool isIn(const T& _val, const std::vector& _list) { + for (auto &it : _list) { + if (it == _val) { + return true; + } + } + return false; + } }; namespace std { @@ -473,6 +482,16 @@ namespace std { std::ostream& operator <<(std::ostream& _os, const std::vector& _obj); std::ostream& operator <<(std::ostream& _os, const std::u32string& _obj); std::ostream& operator <<(std::ostream& _os, const std::vector& _obj); + std::ostream& operator <<(std::ostream& _os, const std::vector& _obj); + std::ostream& operator <<(std::ostream& _os, const std::vector& _obj); + std::ostream& operator <<(std::ostream& _os, const std::vector& _obj); + std::ostream& operator <<(std::ostream& _os, const std::vector& _obj); + std::ostream& operator <<(std::ostream& _os, const std::vector& _obj); + std::ostream& operator <<(std::ostream& _os, const std::vector& _obj); + std::ostream& operator <<(std::ostream& _os, const std::vector& _obj); + std::ostream& operator <<(std::ostream& _os, const std::vector& _obj); + std::ostream& operator <<(std::ostream& _os, const std::vector& _obj); + std::ostream& operator <<(std::ostream& _os, const std::vector& _obj); }; int32_t strlen(const char32_t * _data);