[DEV] apdate some string parsing
This commit is contained in:
parent
c60fe0326d
commit
090d2023a0
@ -52,7 +52,6 @@ etk::CCout& etk::operator <<(etk::CCout& _os, const etk::Vector<etk::UString>& _
|
|||||||
return _os;
|
return _os;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
etk::UString::UString(void)
|
etk::UString::UString(void)
|
||||||
{
|
{
|
||||||
//TK_INFO("new etk::UString()");
|
//TK_INFO("new etk::UString()");
|
||||||
@ -168,6 +167,25 @@ etk::UString::UString(const double _inputData)
|
|||||||
Set(tmpVal);
|
Set(tmpVal);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO : Does not work at all ...
|
||||||
|
/*
|
||||||
|
etk::UString etk::UString::WrapHidenChar(void) const
|
||||||
|
{
|
||||||
|
etk::UString out;
|
||||||
|
for (int32_t iii=0; iii<Size(); iii++) {
|
||||||
|
if (m_data[iii]=='\r') {
|
||||||
|
out += "\r";
|
||||||
|
} else if (m_data[iii]=='\t') {
|
||||||
|
out += "\t";
|
||||||
|
} else {
|
||||||
|
out += m_data[iii];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return out;
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
void etk::UString::SetNumber(bool _negative, const uint64_t& _inputData, etk::UString::printMode_te _mode, bool _preset, int32_t _leadingZero)
|
void etk::UString::SetNumber(bool _negative, const uint64_t& _inputData, etk::UString::printMode_te _mode, bool _preset, int32_t _leadingZero)
|
||||||
{
|
{
|
||||||
m_data.Clear();
|
m_data.Clear();
|
||||||
|
@ -165,6 +165,11 @@ namespace etk
|
|||||||
void Upper(void);
|
void Upper(void);
|
||||||
etk::UString ToUpper(void) const;
|
etk::UString ToUpper(void) const;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief transform tab in \t and '\r' in \r
|
||||||
|
* @return the new string
|
||||||
|
*/
|
||||||
|
//etk::UString WrapHidenChar(void) const;
|
||||||
|
|
||||||
// Sting operation :
|
// Sting operation :
|
||||||
etk::UString Extract(int32_t _posStart=0, int32_t _posEnd=0x7FFFFFFF) const;
|
etk::UString Extract(int32_t _posStart=0, int32_t _posEnd=0x7FFFFFFF) const;
|
||||||
|
@ -75,6 +75,17 @@ etk::UniChar etk::UniChar::ChangeOrder(void) const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool etk::UniChar::IsWhiteChar(void) const
|
||||||
|
{
|
||||||
|
if( m_value == ' '
|
||||||
|
|| m_value == '\t'
|
||||||
|
|| m_value == '\n'
|
||||||
|
|| m_value == '\r') {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
bool etk::UniChar::IsInteger(void) const
|
bool etk::UniChar::IsInteger(void) const
|
||||||
{
|
{
|
||||||
if( m_value>=(uint32_t)'0'
|
if( m_value>=(uint32_t)'0'
|
||||||
|
@ -143,7 +143,15 @@ namespace etk
|
|||||||
* () operator
|
* () operator
|
||||||
*****************************************************/
|
*****************************************************/
|
||||||
//operator uint32_t() const { return m_value; };
|
//operator uint32_t() const { return m_value; };
|
||||||
|
/**
|
||||||
|
* @brief check if the curent element is white or not : '\t' '\n' '\r' ' '
|
||||||
|
* @return tue if it is white char
|
||||||
|
*/
|
||||||
|
bool IsWhiteChar(void) const;
|
||||||
|
/**
|
||||||
|
* @brief check if the curent element is number or not
|
||||||
|
* @return tue if it is a number char
|
||||||
|
*/
|
||||||
bool IsInteger(void) const;
|
bool IsInteger(void) const;
|
||||||
int32_t ToInt32(void) const;
|
int32_t ToInt32(void) const;
|
||||||
|
|
||||||
|
10
etk/types.h
10
etk/types.h
@ -39,16 +39,6 @@
|
|||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
typedef enum {
|
|
||||||
ERR_NONE = 0, //!< No error, luckily everything went fine
|
|
||||||
ERR_FAIL, //!< Miscellaneous failure
|
|
||||||
ERR_INVAL, //!< Invalid entry parameter
|
|
||||||
ERR_MEM, //!< Dynamic memory allocation failure
|
|
||||||
ERR_TIMEOUT, //!< Request time out
|
|
||||||
ERR_BUSY, //!< Element curently Busy
|
|
||||||
}erreurCode_te;
|
|
||||||
|
|
||||||
|
|
||||||
#define etk_min(elemA,elemB) (((elemA)<(elemB)) ? (elemA) : (elemB))
|
#define etk_min(elemA,elemB) (((elemA)<(elemB)) ? (elemA) : (elemB))
|
||||||
#define etk_max(elemA,elemB) (((elemA)<(elemB)) ? (elemB) : (elemA))
|
#define etk_max(elemA,elemB) (((elemA)<(elemB)) ? (elemB) : (elemA))
|
||||||
#define etk_avg(minimim,elem,maximum) (((minimim)>(elem)) ? (minimim) : ((maximum)<(elem)) ? (maximum) : (elem))
|
#define etk_avg(minimim,elem,maximum) (((minimim)>(elem)) ? (minimim) : ((maximum)<(elem)) ? (maximum) : (elem))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user