* @file FBaseInteger.h
* @brief This is the header file for the %Integer class.
*
- * This header file contains the declarations of the %Integer class.
+ * @see Number() class()
*
- * @see Tizen::Base::Number
+ * This header file contains the declarations of the %Integer class.
*/
#ifndef _FBASE_INTEGER_H_
#define _FBASE_INTEGER_H_
*
* @since 2.0
*
- * @param[in] value The integer value
+ * @param[in] value An integer value
*/
Integer(int value = 0);
*
* @since 2.0
*
- * @param[in] value An instance of %Integer to copy
+ * @param[in] value An instance of %Integer
*/
Integer(const Integer& value);
*
* @since 2.0
*
- * @param[in] rhs An instance of %Integer to copy
+ * @param[in] rhs An instance of %Integer
*/
Integer& operator =(const Integer& rhs);
*
* @since 2.0
*
- * @return The 32-bit @c signed integer value
+ * @return A 32-bit @c signed integer value
* @code
- * < 0 if the value of i1 is less than the value of i2
- * == 0 if the value of i1 is equal to the value of i2
- * > 0 if the value of i1 is greater than the value of i2
+ * < 0 if the value of @c i1 is less than the value of @c i2
+ * == 0 if the value of @c i1 is equal to the value of @c i2
+ * > 0 if the value of @c i1 is greater than the value of @c i2
* @endcode
* @param[in] i1 The first @c int value to compare
* @param[in] i2 The second @c int value to compare
static int Compare(int i1, int i2);
/**
- * Compares the value of the current instance with the value of the specified instance of %Integer.
+ * Compares the value of the current instance with the value of the specified instance of the %Integer class.
*
* @since 2.0
*
- * @return The 32-bit @c signed integer value
+ * @return A 32-bit @c signed integer value
*
* @code
* < 0 if the value of the current instance is less than the value of the specified instance
* == 0 if the value of the current instance is equal to the value of the specified instance
* > 0 if the value of the current instance is greater than the value of the specified instance
* @endcode
- * @param[in] value An instance of %Integer to compare
+ * @param[in] value An instance of the %Integer class to compare
*/
int CompareTo(const Integer& value) const;
* @since 2.0
*
* @return An error code
- * @param[in] s The string that represents the numeric value
- * @param[out] ret The result of the operation
+ * @param[in] s A string representing the 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.
- * @remarks This method accepts decimal, hexadecimal, and octal numbers given by the
+ * @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:
*
* @since 2.0
*
- * @return The integer value that indicates the hash value of the current instance of %Integer
- * @remarks
- * - Two equal instances must return the same hash value. @n
- * For better performance, the used hash function must generate a random distribution for all the inputs. @n
- * - The default implementation of this method returns the value of the current instance.
+ * @return An integer value indicating the hash value of the current instance of %Integer
+ * @remarks Two equal instances must return the same hash value. For better performance,
+ * the used hash function must generate a random distribution for all inputs. @n
+ * The default implementation of this method returns the value of the current instance.
*/
virtual int GetHashCode(void) const;
/**
- * Gets the hash value of the specified @c int value.
- *
- * @since 2.0
- *
- * @return The integer value that indicates the hash value of the specified @c int value
- * @param[in] val The @c int value used to get the hash value
- */
+ * Gets the hash value of the specified @c int value.
+ *
+ * @since 2.0
+ *
+ * @return An integer value indicating the hash value of the specified @c int value
+ * @param[in] val A @c int value to get the hash value
+ */
static int GetHashCode(int val);
/**
- * Parses the @c signed @c int equivalent of the specified string that represents a numeric value.
+ * Parses the @c signed @c int equivalent of the specified string representing a numeric value.
*
* @since 2.0
*
* @return An error code
- * @param[in] s The string that represents the numeric value
+ * @param[in] s A string representing a numeric value
* @param[out] ret The result of the operation
- * @exception E_SUCCESS The method is successful.
+ * @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 parsed value is not between VALUE_MIN and VALUE_MAX range.
+ *
* @remarks
- * - This method assumes that the string that represents the numeric value that uses the radix @c 10.
- * - This method guarantees that the original value of the out-parameter is not changed when the method returns an error.
+ * - This method assumes that the string representing the numeric value uses a radix 10.
+ * - This method guarantees that the original value of out-parameter is not changed when the method returns error.
*/
static result Parse(const String& s, int& ret);
/**
- * Parses the @c signed @c int equivalent of the specified string that represents a numeric value using the specified radix.
+ * Parses the @c signed @c int equivalent of the specified string representing a numeric value using the specified radix.
*
* @since 2.0
*
* @return An error code
- * @param[in] s The string that represents the numeric value
- * @param[in] radix The radix of the string that represents the numeric value @n
- * It must either be 2, 8, 10, or 16.
+ * @param[in] s A string representing a numeric value
+ * @param[in] radix The radix of the string representing the numeric value @n
+ * Radix value range is from 2 to 36.
* @param[out] ret The result of the operation
- * @exception E_SUCCESS The method is successful.
+ * @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 specified @c radix is invalid.
- * @remarks This method guarantees that the original value of the out-parameter is not changed when the method returns an error.
+ * @exception E_OUT_OF_RANGE The specified @c radix is invalid or
+ * The parsed 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.
*/
static result Parse(const String& s, int radix, int& ret);
/**
- * Gets the @c signed @c char equivalent of the current instance of %Integer.
+ * Gets the @c char equivalent of the current instance of the %Integer class.
*
* @since 2.0
+ * @brief <i> [Deprecated] </i>
+ *
+ * @deprecated This method has portability issue.
+ * Return value may not be @c signed @c char since char is treated as unsigned char in ARM architecture. @n
+ * Use ToInt8() method to get @c int8_t
+ *
+ * @return A @c char equivalent of the current instance
*
- * @return The @c signed @c char equivalent of the current instance
*/
virtual char ToChar(void) const;
/**
- * Gets the @c signed @c short equivalent of the current instance of %Integer.
+ * Gets the @c int8_t equivalent of the current instance of %Integer.
+ *
+ * @since 3.0
+ *
+ * @return The @c int8_t equivalent of the current instance
+ *
+ */
+ virtual int8_t ToInt8(void) const;
+
+ /**
+ * Gets the @c signed @c short equivalent of the current instance of the %Integer class.
*
* @since 2.0
*
- * @return The @c signed @c short equivalent of the current instance
+ * @return A @c signed @c short equivalent of the current instance
*/
virtual short ToShort(void) const;
/**
- * Gets the @c signed @c int equivalent of the current instance of %Integer.
+ * Gets the @c signed @c int equivalent of the current instance of the %Integer class.
*
* @since 2.0
*
- * @return The @c signed @c int equivalent of the current instance
+ * @return A @c signed @c int equivalent of the current instance
*/
virtual int ToInt(void) const;
/**
- * Gets the @c signed @c long equivalent of the current instance of %Integer.
+ * Gets the @c signed @c long equivalent of the current instance of the %Integer class.
*
* @since 2.0
*
- * @return The @c signed @c long equivalent of the current instance
+ * @return A @c signed @c long equivalent of the current instance
*/
virtual long ToLong(void) const;
/**
- * Gets the @c signed @c long @c long equivalent of the current instance of %Integer.
+ * Gets the @c signed @c long @c long equivalent of the current instance of the %Integer class.
*
* @since 2.0
*
- * @return The @c signed @c long @c long equivalent of the current instance
+ * @return A @c signed @c long @c long equivalent of the current instance
*/
virtual long long ToLongLong(void) const;
/**
- * Gets the @c signed @c float equivalent of the current instance of %Integer.
+ * Gets the @c signed @c float equivalent of the current instance of the %Integer class.
*
* @since 2.0
*
- * @return The @c signed @c float equivalent of the current instance
+ * @return A @c signed @c float equivalent of the current instance
*/
virtual float ToFloat(void) const;
/**
- * Gets the @c signed @c double equivalent of the current instance of %Integer.
+ * Gets the @c signed @c double equivalent of the current instance of the %Integer class.
*
* @since 2.0
*
- * @return The @c signed @c double equivalent of the current instance
+ * @return A @c signed @c double equivalent of the current instance
*/
virtual double ToDouble(void) const;
/**
- * Gets the string that represents the value of the current instance of %Integer.
+ * Gets the string representing the value of the current instance of the %Integer class.
*
* @since 2.0
*
- * @return The string that represents the value of the current instance
+ * @return A string representing the value of the current instance
*/
virtual String ToString(void) const;
/**
- * Gets the string that represents the specified @c signed @c int value.
+ * Gets the string representing the specified @c signed @c int value.
*
* @since 2.0
*
- * @return The string that contains the Unicode representation of the specified @c signed @c int value
- * @param[in] value The @c signed @c int value to convert
+ * @return A string containing a Unicode representation of the specified @c signed @c int value
+ * @param[in] value A @c signed @c int value to convert
*/
static String ToString(int value);
/**
- * The constant holding the maximum value of type @c int. @n
+ * A constant holding the maximum value of type @c int. @n
* A @c short integer can hold a value of upto 2^31-1.
*
* @since 2.0
*/
- static const int VALUE_MAX = (int) 0x7FFFFFFF;
+ static const int VALUE_MAX = static_cast< int >(0x7FFFFFFF);
/**
- * The constant holding the minimum value of type @c int. @n
+ * A constant holding the minimum value of type @c int. @n
* A @c short integer can hold a value of upto -2^31.
*
* @since 2.0
*/
- static const int VALUE_MIN = (int) 0x80000000;
+ static const int VALUE_MIN = static_cast< int >(0x80000000);
/**
- * The integer value of this instance.
+ * An integer value of this instance.
*
* @since 2.0
*/