static String ToString(long long value);
/**
+ * Decodes a string into a @c signed @c long @c long value.
+ *
+ * @since 3.0
+ *
+ * @return An error code
+ * @param[in] inputStr A string representing a numeric value
+ * @param[out] ret The result of the operation
+ * @exception E_SUCCESS The method is successful.
+ * @exception E_NUM_FORMAT The specified string does not contain a number that can be parsed.
+ * @exception E_OUT_OF_RANGE The decoded value is not between VALUE_MIN and VALUE_MAX range.
+ * @remarks
+ * - This method guarantees that the original value of out-parameter is not changed when the method returns error.
+ * - This method accepts decimal, hexadecimal, and octal numbers given by the
+ * following grammar:
+ * @code
+ * - DecodableString:
+ * Sign[opt] DecimalNumeral
+ * Sign[opt] 0x HexDigits
+ * Sign[opt] 0X HexDigits
+ * Sign[opt] # HexDigits
+ * Sign[opt] 0 OctalDigits
+ * - Sign:
+ * '-'
+ * @endcode
+ */
+ static result Decode(const String& inputStr, long long& ret);
+
+ /**
* Parses the specified string representing a numeric value and
* returns the value as a @c signed @c long @c long (as out parameter).
*
}
result
+LongLong::Decode(const String& inputStr, long long& ret)
+{
+ long long value;
+ result r = _NumberUtil::Decode(inputStr, value);
+ SysTryReturnResult(NID_BASE, r == E_SUCCESS, r, "Propagating.");
+ ret = value;
+ return r;
+}
+
+result
LongLong::Parse(const String& s, long long& ret)
{
return Parse(s, Character::RADIX_DECIMAL, ret);