diff --git a/etk/UString.cpp b/etk/UString.cpp index f43d3d4..0d38e69 100644 --- a/etk/UString.cpp +++ b/etk/UString.cpp @@ -483,1011 +483,52 @@ std::vector string_split(const std::string& _input, char _val) { return list; } -#if 0 - - -int32_t strlen(const char32_t * _data) { - if (NULL == _data) { - return 0; - } - int32_t iii=0; - while (*_data != 0) { - _data++; - iii++; - if (iii > 0x7FFFFFF0) { - return iii; - } - } - return iii; -} - -#undef __class__ -#define __class__ "std::string" - -etk::CCout& etk::operator <<(etk::CCout& _os, const std::string& _obj) { - std::vector output_UTF8; - unicode::convertUnicodeToUtf8(_obj.m_data, output_UTF8); - output_UTF8.push_back('\0'); - _os << &output_UTF8[0]; - return _os; -} - -etk::CCout& etk::operator <<(etk::CCout& _os, const std::vector& _obj) { - _os << "{"; - for (int32_t iii=0; iii< _obj.size(); iii++) { - if (iii>0) { - _os << " ~ "; - } - _os << _obj[iii]; - } - _os << "}"; - return _os; -} - -std::string::UString(void) -{ - //TK_INFO("new std::string()"); - m_data.push_back(char32_t::Null); -} - - -std::string::UString(const char* _data, enum unicode::charset _inputCharset) { - // TODO : Change this ... - std::vector transformData; - while (*_data != '\0') { - transformData.push_back(*_data); - _data++; - } - m_data.clear(); - if (unicode::charsetUTF8 == _inputCharset) { - unicode::convertUtf8ToUnicode(transformData, m_data); - } else { - unicode::convertIsoToUnicode(_inputCharset, transformData, m_data); - } - if( 0 == m_data.size() - || m_data[m_data.size()-1]!=char32_t::Null) { - m_data.push_back(char32_t::Null); - } -} - - -// single element adding -std::string::UString(const bool _inputData, enum std::string::printMode _mode, bool _preset) { - m_data.clear(); - if (_preset==true) { - switch(_mode) { - case std::string::printModeBinary : - m_data.push_back('0'); - m_data.push_back('b'); - break; - case std::string::printModeOctal : - m_data.push_back('0'); - m_data.push_back('o'); - break; - case std::string::printModeDecimal : - break; - case std::string::printModeHexadecimal : - m_data.push_back('0'); - m_data.push_back('x'); - break; - default: - case std::string::printModeString : - break; - } - } - switch(_mode) { - case std::string::printModeBinary : - case std::string::printModeOctal : - case std::string::printModeDecimal : - case std::string::printModeHexadecimal : - if (true == _inputData) { - m_data.push_back('1'); - } else { - m_data.push_back('0'); - } - break; - default: - case std::string::printModeString : - if (true == _inputData) { - m_data.push_back('t'); - m_data.push_back('r'); - m_data.push_back('u'); - m_data.push_back('e'); - } else { - m_data.push_back('f'); - m_data.push_back('a'); - m_data.push_back('l'); - m_data.push_back('s'); - m_data.push_back('e'); - } - break; - } - m_data.push_back(char32_t::Null); -} - -std::string::UString(const std::string& _obj) -{ - //etk_INFO("Constructeur de recopie"); - m_data = _obj.m_data; -} - -std::string::UString(char32_t _inputData) -{ - m_data.push_back(_inputData); - m_data.push_back(char32_t::Null); -} - -std::string::UString(const float _inputData) -{ - // TODO : Rework this ... - char tmpVal[256]; - // generate the UString : - sprintf(tmpVal, "%f", _inputData); - // set the internal data : - set(tmpVal); -} - -std::string::UString(const double _inputData) -{ - // TODO : Rework this ... - char tmpVal[256]; - // generate the UString : - sprintf(tmpVal, "%lf", _inputData); - int32_t len=strlen(tmpVal); - if (NULL!=strchr(tmpVal, '.')) { - //have a '.' - // remove the .000000000 at the end of the string - for (int32_t iii=len-1; iii>=0 ; --iii) { - if (tmpVal[iii] == '0') { - tmpVal[iii] = '\0'; - } else { - if (tmpVal[iii] == '.') { - tmpVal[iii] = '\0'; - } - break; - } - } - } - // set the internal data : - set(tmpVal); -} - -// TODO : Does not work at all ... -/* -std::string std::string::WrapHidenChar(void) const -{ - std::string out; - for (int32_t iii=0; iii0) { - uint64_t quotient = tmpVal / base; - uint64_t rest = tmpVal - quotient*base; - if (rest<=9) { - tmpString.add(0,(char)(rest+'0')); - } else { - tmpString.add(0,(char)(rest-10+'A')); - } - tmpVal = quotient; - } - if (tmpString.size() == 0) { - tmpString = "0"; - } - for (int32_t iii=tmpString.size(); iii<_leadingZero; iii++){ - tmpString.add(0,'0'); - } - *this += tmpString; - - //TK_ERROR (" " << ploppp); - } - if (m_data.size()==0) { - m_data.push_back(char32_t::Null); - } else if (m_data[m_data.size()-1]!=char32_t::Null) { - m_data.push_back(char32_t::Null); - } - //TK_ERROR(" convert : " << _inputData << " in : " << *this << " len=" << m_data.Size()); -} - -void std::string::set(const int64_t& _inputData, enum std::string::printMode _mode, bool _preset, int32_t _leadingZero) -{ - if (_preset==true && _mode != std::string::printModeString) { - setNumber(false, (uint64_t)_inputData, _mode, _preset, _leadingZero); - return; - } - if (_inputData < 0) { - uint64_t tmpData = (uint64_t)((int64_t)_inputData * (int64_t)(-1)); - setNumber(true, (uint64_t)tmpData, _mode, _preset, _leadingZero); - } else { - setNumber(false, (uint64_t)_inputData, _mode, _preset, _leadingZero); - } -} - -void std::string::set(const uint64_t& _inputData, enum std::string::printMode _mode, bool _preset, int32_t _leadingZero) -{ - setNumber(false, (uint64_t)_inputData, _mode, _preset, _leadingZero); -} - -// multiple element add -std::string::UString(const char32_t* _inputData, int32_t _len) -{ - set(_inputData, _len); -} - -std::string::UString(const char* _inputData, int32_t _len) -{ - set(_inputData, _len); -} - -std::string::UString(const std::vector& _inputData) -{ - set(_inputData); -} - -std::string::UString(const std::vector& _inputData) -{ - set(_inputData); -} - -std::string::UString(const std::vector& _inputData) -{ - set(_inputData); -} - - -void std::string::set(const std::vector& _inputData) -{ - if (_inputData.size()==0) { - clear(); - return; - } - std::vector output_Unicode; - unicode::convertUtf8ToUnicode(_inputData, output_Unicode); - set(output_Unicode); -} - -void std::string::set(const std::vector& _inputData) -{ - if (_inputData.size()==0) { - clear(); - return; - } - std::vector output_Unicode; - unicode::convertUtf8ToUnicode(_inputData, output_Unicode); - set(output_Unicode); -} - - -void std::string::set(const std::vector& _inputData) -{ - m_data = _inputData; - if (m_data.size()>0) { - if (m_data[m_data.size()-1] != char32_t::Null) { - m_data.push_back(char32_t::Null); - } - } else { - m_data.push_back(char32_t::Null); - } - //TK_DEBUG("m_dataLen="< (const std::string& _obj) const -{ - if( this != &_obj ) { - for (int32_t iii=0; iii < m_data.size() && iii < _obj.m_data.size(); iii++) { - //TK_DEBUG(" compare : '" << (char)m_data[iii] << "'>'" << (char)_obj.m_data[iii] << "' ==> " << changeOrder(m_data[iii]) << ">" << changeOrder(_obj.m_data[iii]) << ""); - char32_t elemA = m_data[iii].changeOrder(); - char32_t elemB = _obj.m_data[iii].changeOrder(); - if (elemA != elemB) { - if (elemA > elemB) { - return true; - } - return false; - } - } - if (m_data.size() > _obj.m_data.size()) { - return true; - } - } - return false; -} - -bool std::string::operator>= (const std::string& _obj) const -{ - if( this != &_obj ) { - for (int32_t iii=0; iii < m_data.size() && iii < _obj.m_data.size(); iii++) { - char32_t elemA = m_data[iii].changeOrder(); - char32_t elemB = _obj.m_data[iii].changeOrder(); - if (elemA != elemB) { - if (elemA > elemB) { - return true; - } - return false; - } - } - if (m_data.size() >= _obj.m_data.size()) { - return true; - } - } - return false; -} - -bool std::string::operator< (const std::string& _obj) const -{ - if( this != &_obj ) { - for (int32_t iii=0; iii < m_data.size() && iii < _obj.m_data.size(); iii++) { - char32_t elemA = m_data[iii].changeOrder(); - char32_t elemB = _obj.m_data[iii].changeOrder(); - if (elemA != elemB) { - if (elemA < elemB) { - return true; - } - return false; - } - } - if (m_data.size() < _obj.m_data.size()) { - return true; - } - } - return false; -} - -bool std::string::operator<= (const std::string& _obj) const -{ - if( this != &_obj ) { - for (int32_t iii=0; iii < m_data.size() && iii < _obj.m_data.size(); iii++) { - char32_t elemA = m_data[iii].changeOrder(); - char32_t elemB = _obj.m_data[iii].changeOrder(); - if (elemA != elemB) { - if (elemA < elemB) { - return true; - } - return false; - } - } - if (m_data.size() <= _obj.m_data.size()) { - return true; - } - } - return false; -} - - -bool std::string::operator== (const std::string& _obj) const -{ - if( this != &_obj ) { - if (_obj.m_data.size() != m_data.size()) { - return false; - } - for (int32_t iii= 0; iii= m_data.size() ) { - return true; - } else { - return false; - } -} - - -int32_t std::string::size(void) const -{ - if (m_data.size() == 0) { - return 0; - } else { - return m_data.size() - 1; - } -} - - -void std::string::add(int32_t _currentID, const char* _inputData) -{ - std::string tmpString(_inputData); - add(_currentID, tmpString.pointer() ); -} - - -void std::string::add(int32_t _currentID, const char32_t* _inputData) -{ - // get the input lenght - int32_t len = strlen(_inputData); - if (0 == len) { - TK_WARNING("no data to add on the current UString"); - return; - } else if (_currentID < 0) { - TK_WARNING("Curent ID(" << _currentID << ") < 0 ==> Add at the start"); - _currentID = 0; - } else if (_currentID > size() ) { - TK_ERROR("Curent ID(" << _currentID << ") > maxSize ... (" << size() << ") ==> add at the end ..."); - m_data.push_back(_inputData, len); - return; - } - m_data.insert(_currentID, _inputData, len); -} - - -void std::string::add(int32_t _currentID, const char32_t _inputData) -{ - char32_t data[2]; - data[0] = _inputData; - data[1] = char32_t::Null; - add(_currentID, data); -} - -void std::string::append(char32_t _inputData) -{ - m_data.popBack(); - m_data.push_back(_inputData); - m_data.push_back(char32_t::Null); -} - - -void std::string::remove(int32_t _currentID, int32_t _len) -{ - if (0 >= _len) { - TK_ERROR("no data to remove on the current UString"); - return; - } - // TODO : check the size of the data - m_data.eraseLen(_currentID, _len); -} - - -void std::string::clear(void) -{ - m_data.clear(); - m_data.push_back(char32_t::Null); -} - -int32_t std::string::findForward(const char32_t _element, int32_t _startPos) const -{ - if (_startPos < 0) { - _startPos = 0; - } else if (_startPos >= size() ) { - return -1; - } - for (int32_t iii=_startPos; iii< size(); iii++) { - if (m_data[iii] == _element) { - return iii; - } - } - return -1; -} - -int32_t std::string::findBack(const char32_t _element, int32_t _startPos) const -{ - if (_startPos < 0) { - return -1; - } else if (_startPos >= size() ) { - _startPos = size(); - } - for (int32_t iii=_startPos; iii>=0; iii--) { - if (m_data[iii] == _element) { - return iii; - } - } - return -1; -} - - -std::string std::string::extract(int32_t _posStart, int32_t _posEnd) const -{ - std::string out; - if (_posStart < 0) { - _posStart = 0; - } else if (_posStart >= size() ) { - return out; - } - if (_posEnd < 0) { - return out; - } else if (_posEnd >= size() ) { - _posEnd = size(); - } - out.m_data = m_data.extract(_posStart, _posEnd); - out.m_data.push_back(char32_t::Null); - return out; -} - -std::string std::string::extractLine(int32_t _pos) const -{ - // search back : '\n' - int32_t startPos = findBack('\n', _pos); - if (startPos == _pos) { - startPos = 0; - } else { - startPos++; - } - // search forward : '\n' - int32_t stopPos = _pos; - if (m_data[_pos] != '\n') { - stopPos = findForward('\n', _pos); - if (stopPos == _pos) { - stopPos = size(); - } - } - std::string out; - if (startPos < 0) { - startPos = 0; - } else if (startPos >= size() ) { - return out; - } - if (stopPos < 0) { - return out; - } else if (stopPos >= size() ) { - stopPos = size(); - } - out.m_data = m_data.extract(startPos, stopPos); - out.m_data.push_back(char32_t::Null); - return out; -} - -std::vector std::string::getVector(void) -{ - std::vector out = m_data; - out.popBack(); - return out; -} - - -bool std::string::startWith(const std::string& _data, bool _caseSensitive) const -{ - if (_data.size() == 0) { - return false; - } - if (_data.size() > size()) { - return false; - } - if (true == _caseSensitive) { - for (int32_t iii=0; iii<_data.size(); iii++) { - if (_data[iii] != m_data[iii]) { - return false; - } - } - } else { - for (int32_t iii=0; iii<_data.size(); iii++) { - if (false==m_data[iii].compareNoCase(_data[iii])) { - return false; - } - } - } - return true; -} - - -bool std::string::endWith(const std::string& _data, bool _caseSensitive) const -{ - if (_data.size() == 0) { - return false; - } - if (_data.size() > size()) { - return false; - } - if (true == _caseSensitive) { - for( int32_t iii=size()-1, jjj=_data.size()-1; - iii>=0 && jjj>=0; - iii--, jjj--) { - if (_data[jjj] != m_data[iii]) { - return false; - } - } - } else { - for( int32_t iii=size()-1, jjj=_data.size()-1; - iii>=0 && jjj>=0; - iii--, jjj--) { - if (false==m_data[iii].compareNoCase(_data[jjj])) { - return false; - } - } - } - return true; -} - - -etk::Char std::string::c_str(void) const -{ - etk::Char tmpVar; - std::vector tmpData; - // UTF8 generation : - tmpData.clear(); - unicode::convertUnicodeToUtf8(m_data, tmpData); - tmpVar.setValue(tmpData); - return tmpVar; -} - -std::vector std::string::split(char32_t _val) -{ - std::vector list; - int32_t lastStartPos=0; - for(int32_t iii=0; iii namespace etk { - /* - std::u32string to_string(int _val); - std::u32string to_string(long _val); - std::u32string to_string(long long _val); - std::u32string to_string(unsigned _val); - std::u32string to_string(unsigned long _val); - std::u32string to_string(unsigned long long _val); - std::u32string to_string(float _val); - std::u32string to_string(double _val); - std::u32string to_string(long double _val); - */ - //typedef std::u32string UString; - #if 0 - class UString { - public: - enum printMode { - printModeBinary, - printModeOctal, - printModeDecimal, - printModeHexadecimal, - printModeString, - }; - private : - std::vector m_data; //!< internal data is stored in the Unicode properties ... - public: - // Constructeurs - UString(void); - // destructor : - ~UString(void) { }; - // recopy operator : - UString(const std::string& _obj); - - // single element adding - UString(const bool _inputData, enum printMode _mode=printModeString, bool _preset=false); - UString(char32_t _inputData); - UString(const char* _data, enum unicode::charset _inputCharset); - UString(const float _inputData); - UString(const double _inputData); - UString(const int8_t& _inputData, enum printMode _mode=printModeDecimal, bool _preset=false, int32_t _leadingZero=0) { - set((int64_t)_inputData, _mode, _preset, _leadingZero); - }; - UString(const int16_t& _inputData, enum printMode _mode=printModeDecimal, bool _preset=false, int32_t _leadingZero=0) { - set((int64_t)_inputData, _mode, _preset, _leadingZero); - }; - UString(const int32_t& _inputData, enum printMode _mode=printModeDecimal, bool _preset=false, int32_t _leadingZero=0) { - set((int64_t)_inputData, _mode, _preset, _leadingZero); - }; - UString(const int64_t& _inputData, enum printMode _mode=printModeDecimal, bool _preset=false, int32_t _leadingZero=0) { - set(_inputData, _mode, _preset, _leadingZero); - }; - UString(const uint8_t& _inputData, enum printMode _mode=printModeDecimal, bool _preset=false, int32_t _leadingZero=0) { - set((uint64_t)_inputData, _mode, _preset, _leadingZero); - }; - UString(const uint16_t& _inputData, enum printMode _mode=printModeDecimal, bool _preset=false, int32_t _leadingZero=0) { - set((uint64_t)_inputData, _mode, _preset, _leadingZero); - }; - UString(const uint32_t& _inputData, enum printMode _mode=printModeDecimal, bool _preset=false, int32_t _leadingZero=0) { - set((uint64_t)_inputData, _mode, _preset, _leadingZero); - }; - UString(const uint64_t& _inputData, enum printMode _mode=printModeDecimal, bool _preset=false, int32_t _leadingZero=0) { - set(_inputData, _mode, _preset, _leadingZero); - }; - // multiple element add - UString(const char32_t* _inputData, int32_t _len = -1); - UString(const char* _inputData, int32_t _len = -1); - UString(const std::vector& _inputData); - UString(const std::vector& _inputData); - UString(const std::vector& _inputData); - // generic setter - void set(const char32_t* _inputData, int32_t _len=-1); - void set(const char* _inputData, int32_t _len=-1); - void set(const std::vector& _inputData); - void set(const std::vector& _inputData); - void set(const std::vector& _inputData); - private: - void setNumber(bool _negative, const uint64_t& _inputData, enum printMode _mode, bool _preset, int32_t _leadingZero); - public: - void set(const int64_t& _inputData, enum printMode _mode=printModeDecimal, bool _preset=false, int32_t _leadingZero=0); - void set(const uint64_t& _inputData, enum printMode _mode=printModeDecimal, bool _preset=false, int32_t _leadingZero=0); - - /***************************************************** - * = assigment - *****************************************************/ - const std::string& operator= (const std::string& _obj ); - /***************************************************** - * == operator - *****************************************************/ - bool operator== (const std::string& _obj) const; - bool compareNoCase(const std::string& _obj) const; - /***************************************************** - * != operator - *****************************************************/ - bool operator!= (const std::string& _obj) const; - /***************************************************** - * > < >= <= operator - *****************************************************/ - bool operator> (const std::string& _obj) const; - bool operator>= (const std::string& _obj) const; - bool operator< (const std::string& _obj) const; - bool operator<= (const std::string& _obj) const; - /***************************************************** - * += operator - *****************************************************/ - const std::string& operator+= (const std::string& _obj); - //const std::string& operator+= (char32_t _obj); - /***************************************************** - * + operator - *****************************************************/ - std::string operator+ (const std::string &_obj) const; - /***************************************************** - * << operator - *****************************************************/ - /* - const std::string& operator <<= (const char input); - const std::string& operator <<= (const int input); - const std::string& operator <<= (const unsigned int input); - */ - /***************************************************** - * >> operator - *****************************************************/ - - /***************************************************** - * Cout << operator - *****************************************************/ - friend etk::CCout& operator <<( etk::CCout& _os,const std::string& _obj); - /***************************************************** - * [] operator - *****************************************************/ - char32_t operator[] (esize_t _pos) const { - return m_data[_pos]; - } - char32_t operator[] (esize_t _pos) { - return m_data[_pos]; - } - - /***************************************************** - * toolbox - *****************************************************/ - // Start With ... - bool startWith(const std::string& _data, bool _caseSensitive=true) const ; - // End With ... - bool endWith(const std::string& _data, bool _caseSensitive=true) const ; - // Find element - int32_t findForward(const char32_t _data, int32_t _startPos=0) const; - int32_t findBack(const char32_t _data, int32_t _startPos=0x7FFFFFFF) const; - - bool isEmpty(void) const; - int32_t size(void) const; - - /***************************************************** - * Generic modification function - *****************************************************/ - void add(int32_t _currentID, const char* _inputData); - void add(int32_t _currentID, const char32_t* _inputData); - void add(int32_t _currentID, const char32_t _inputData); - void remove(int32_t _currentID, int32_t _len = 1); - void clear(void); - void append(char32_t _inputData); - - /** - * @brief Split a string in multiple separate by a specific char - * @param[in] _val Separate value of the string - * @return The list of all sthe string splited. - */ - std::vector split(char32_t _val); - /** - * @brief Replace a char with an other - * @param[in] _out element to replace. - * @param[in] _in Element to set. - */ - void replace(char32_t _out, char32_t _in); - - std::vector getVector(void); - char32_t* pointer(void) { return &m_data[0]; }; - - etk::Char c_str(void) const; - - void lower(void); - std::string toLower(void) const; - void upper(void); - std::string toUpper(void) const; - - /** - * @brief transform tab in \t and '\r' in \r - * @return the new string - */ - //std::string WrapHidenChar(void) const; - - // Sting operation : - std::string extract(int32_t _posStart=0, int32_t _posEnd=0x7FFFFFFF) const; - std::string extractLine(int32_t _pos=0) const; - /** - * @brief Transform the current string in an int64_t - * @return the requested int - */ - int64_t toInt64(void) const; - /** - * @brief Transform the current string in an int32_t (if the number is higher, then it is limited at the int32_t max) - * @return the requested int - */ - int32_t toInt32(void) const; - /** - * @brief Transform the current string in an int16_t (if the number is higher, then it is limited at the int16_t max) - * @return the requested int - */ - int16_t toInt16(void) const; - /** - * @brief Transform the current string in an int8_t (if the number is higher, then it is limited at the int8_t max) - * @return the requested int - */ - int8_t toInt8(void) const; - /** - * @brief Transform the current string in an uint64_t - * @return the requested int - */ - uint64_t toUInt64(void) const; - /** - * @brief Transform the current string in an uint32_t (if the number is higher, then it is limited at the uint32_t max) - * @return the requested int - */ - uint32_t toUInt32(void) const; - /** - * @brief Transform the current string in an uint16_t (if the number is higher, then it is limited at the uint16_t max) - * @return the requested int - */ - uint16_t toUInt16(void) const; - /** - * @brief Transform the current string in an uint8_t (if the number is higher, then it is limited at the uint8_t max) - * @return the requested int - */ - uint8_t toUInt8(void) const; - /** - * @brief Transform the current string in a double - * @return the requested double - */ - double toDouble(void) const; - /** - * @brief Transform the current string in a float - * @return the requested float - */ - float toFloat(void) const; - /** - * @brief Transform the current string in a boolean - * @return the requested bool - */ - bool toBool(void) const; - }; - #endif etk::CCout& operator <<(etk::CCout& _os, const std::string& _obj); etk::CCout& operator <<(etk::CCout& _os, const std::vector& _obj); @@ -288,6 +40,9 @@ template std::u32string to_u32string(T t, std::ios_base & (*f)(std::ios } namespace std { std::string to_string(bool _val); + #ifdef __TARGET_OS__Android + + #endif } std::u32string to_u32string(bool _val); std::u32string to_u32string(int _val); @@ -300,6 +55,18 @@ std::u32string to_u32string(float _val); std::u32string to_u32string(double _val); std::u32string to_u32string(long double _val); +namespace std { + #ifdef __TARGET_OS__Android + double stod(const std::string& _str, size_t* _idx = 0); + float stof(const std::string& _str, size_t* _idx = 0); + int stoi(const std::string& _str, size_t* _idx = 0, int _base = 10); + long stol(const std::string& _str, size_t* _idx = 0, int _base = 10); + long double stold(const std::string& _str, size_t* _idx = 0); + long long stoll(const std::string& _str, size_t* _idx = 0, int _base = 10); + unsigned long stoul(const std::string& _str, size_t* _idx = 0, int _base = 10); + unsigned long long stoull(const std::string& _str, size_t* _idx = 0, int _base = 10); + #endif +} double stod(const std::u32string& _str, size_t* _idx = 0); float stof(const std::u32string& _str, size_t* _idx = 0); int stoi(const std::u32string& _str, size_t* _idx = 0, int _base = 10); diff --git a/etk/os/FSNode.cpp b/etk/os/FSNode.cpp index df28541..b406301 100644 --- a/etk/os/FSNode.cpp +++ b/etk/os/FSNode.cpp @@ -120,7 +120,7 @@ static std::string baseRunPath = "/"; #ifdef __TARGET_OS__Android static etk::Archive* s_APKArchive = NULL; - static void loadAPK(std::u32string& _apkPath) + static void loadAPK(std::string& _apkPath) { TK_DEBUG("Loading APK \"" << _apkPath << "\""); s_APKArchive = etk::Archive::load(_apkPath); @@ -761,7 +761,7 @@ void etk::FSNode::updateFileSystemProperty(void) { // = Check if it was a folder : = // ---------------------------------------- std::string folderName = "/"; - if (true == m_systemFileName.endWith(folderName)) { + if (true == end_with(m_systemFileName, folderName)) { folderName = m_systemFileName; } else { folderName = m_systemFileName + "/"; @@ -1243,15 +1243,15 @@ void etk::FSNode::folderGetRecursiveFiles(std::vector& _output, boo } for (int iii=0; iiisize(); iii++) { std::string filename = s_APKArchive->getName(iii); - if (filename.startWith(FolderName) == true) { + if (start_with(filename, FolderName) == true) { std::string tmpString; if(m_type == etk::FSN_TYPE_DATA) { tmpString = "DATA:"; } else { tmpString = "THEME:"; } - if (true == filename.startWith(assetsName)) { - filename.remove(0,assetsName.size()); + if (start_with(filename, assetsName) == true) { + filename.erase(0,assetsName.size()); } tmpString += filename; _output.push_back(tmpString);