[DEV] add capabilities at string
This commit is contained in:
parent
c90b9d1b39
commit
fac7b19bf8
@ -46,6 +46,26 @@ etk::UString::UString(void)
|
||||
}
|
||||
|
||||
|
||||
etk::UString::UString(const char* _data, unicode::charset_te _inputCharset)
|
||||
{
|
||||
// TODO : Change this ...
|
||||
etk::Vector<char> transformData;
|
||||
while (*_data != '\0') {
|
||||
transformData.PushBack(*_data);
|
||||
_data++;
|
||||
}
|
||||
m_data.Clear();
|
||||
if (unicode::EDN_CHARSET_UTF8==_inputCharset) {
|
||||
unicode::convertUtf8ToUnicode(transformData, m_data);
|
||||
} else {
|
||||
unicode::convertIsoToUnicode(_inputCharset, transformData, m_data);
|
||||
}
|
||||
if( 0 == m_data.Size()
|
||||
|| m_data[m_data.Size()-1]!='\0') {
|
||||
m_data.PushBack('\0');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// single element adding
|
||||
etk::UString::UString(const bool _inputData, etk::UString::printMode_te _mode, bool _preset)
|
||||
@ -587,6 +607,11 @@ void etk::UString::Add(int32_t _currentID, const uniChar_t _inputData)
|
||||
Add(_currentID, data);
|
||||
}
|
||||
|
||||
void etk::UString::Append(const etk::UniChar& _inputData)
|
||||
{
|
||||
m_data.PushBack(_inputData);
|
||||
}
|
||||
|
||||
|
||||
void etk::UString::Remove(int32_t _currentID, int32_t _len)
|
||||
{
|
||||
|
@ -13,6 +13,7 @@
|
||||
#include <etk/Stream.h>
|
||||
#include <etk/Vector.h>
|
||||
#include <etk/Char.h>
|
||||
#include <etk/unicode.h>
|
||||
|
||||
namespace etk
|
||||
{
|
||||
@ -39,6 +40,7 @@ namespace etk
|
||||
// single element adding
|
||||
UString(const bool _inputData, printMode_te _mode=printModeString, bool _preset=false);
|
||||
UString(const uniChar_t _inputData);
|
||||
UString(const char* _data, unicode::charset_te _inputCharset);
|
||||
UString(const float _inputData);
|
||||
UString(const double _inputData);
|
||||
UString(const int8_t& _inputData, printMode_te _mode=printModeDecimal, bool _preset=false) { Set((int64_t)_inputData, _mode, _preset); };
|
||||
@ -143,6 +145,7 @@ namespace etk
|
||||
void Add(int32_t _currentID, const uniChar_t _inputData);
|
||||
void Remove(int32_t _currentID, int32_t _len);
|
||||
void Clear(void);
|
||||
void Append(const etk::UniChar& _inputData);
|
||||
|
||||
etk::Vector<etk::UniChar> GetVector(void);
|
||||
uniChar_t* pointer(void) { return &m_data[0]; };
|
||||
|
@ -28,7 +28,7 @@ namespace unicode {
|
||||
EDN_CHARSET_ISO_8859_11,
|
||||
EDN_CHARSET_ISO_8859_13,
|
||||
EDN_CHARSET_ISO_8859_14,
|
||||
EDN_CHARSET_ISO_8859_15,
|
||||
EDN_CHARSET_ISO_8859_15
|
||||
} charset_te;
|
||||
|
||||
// transform ISO <==> Unicode
|
||||
|
Loading…
x
Reference in New Issue
Block a user