Integer::Decode(const String& s, int& ret)
{
SysTryReturn(NID_BASE, s.GetLength() >= 1, E_NUM_FORMAT, E_NUM_FORMAT,
- "[%s] The length of s MUST be greater than 0.", GetErrorMessage(E_NUM_FORMAT));
+ "[%s] The length of input String MUST be greater than 0.", GetErrorMessage(E_NUM_FORMAT));
int radix = 0;
int startIndex = 0;
result
Integer::Parse(const String& s, int& ret)
{
- int len = s.GetLength();
- SysTryReturn(NID_BASE, (len > 0 && len < 12), E_NUM_FORMAT, E_NUM_FORMAT,
- "[%s] The length of s(%ls) MUST be greater than 0 and less than 12.",
- GetErrorMessage(E_NUM_FORMAT), s.GetPointer());
-
return Parse(s, Character::RADIX_DECIMAL, ret);
}
"[%s] The radix(%d) MUST be one of 2, 8, 10 and 16.", GetErrorMessage(E_OUT_OF_RANGE), radix);
int len = s.GetLength();
- SysTryReturn(NID_BASE, (len > 0), E_NUM_FORMAT, E_NUM_FORMAT, "[%s] The length of s MUST be greater than 0.",
+ SysTryReturn(NID_BASE, len > 0, E_NUM_FORMAT, E_NUM_FORMAT, "[%s] The length of input String MUST be greater than 0.",
GetErrorMessage(E_NUM_FORMAT));
errno = 0;
wchar_t* pEnd = null;
int tmpRet = wcstol(s.GetPointer(), &pEnd, radix);
- SysTryReturn(NID_BASE, (pEnd[0] == 0), E_NUM_FORMAT, E_NUM_FORMAT,
+ SysTryReturn(NID_BASE, pEnd[0] == 0, E_NUM_FORMAT, E_NUM_FORMAT,
"[%s] Integer parse failed. Scan stopped at (%ls).", GetErrorMessage(E_NUM_FORMAT), pEnd);
SysTryReturn(NID_BASE, !((tmpRet == LONG_MAX || tmpRet == LONG_MIN) && (errno != 0)), E_NUM_FORMAT, E_NUM_FORMAT,
"[%s] Parsed value cannot fit into an Integer.", GetErrorMessage(E_NUM_FORMAT));