//
-// Open Service Platform
// Copyright (c) 2012 Samsung Electronics Co., Ltd.
//
// Licensed under the Apache License, Version 2.0 (the License);
#include <FBaseNumber.h>
-
namespace Tizen { namespace Base
{
/**
* @class Int8
+ * @brief <i> [Deprecated] </i>
+ * @deprecated This class is deprecated because char is treated as unsigned char in ARM architecture. Use Integer8 class.
+ *
* @brief This class is the wrapper class for the @c signed @c char built-in type.
*
* @since 2.0
* Initializes this instance of %Int8 with the specified value.
*
* @since 2.0
+ * @brief <i> [Deprecated] </i>
+ * @deprecated This class is deprecated because char is treated as unsigned char in ARM architecture. Use Integer8 class.
+ *
*
* @param[in] value A @c char value
*/
Int8(char value = 0);
-
/**
* Copying of objects using this copy constructor is allowed.
*
* @since 2.0
+ * @brief <i> [Deprecated] </i>
+ * @deprecated This class is deprecated because char is treated as unsigned char in ARM architecture. Use Integer8 class.
+ *
*
* @param[in] value An instance of %Int8
*/
* This destructor overrides Tizen::Base::Object::~Object().
*
* @since 2.0
+ * @brief <i> [Deprecated] </i>
+ * @deprecated This class is deprecated because char is treated as unsigned char in ARM architecture. Use Integer8 class.
+ *
*/
virtual ~Int8(void);
* Copying of objects using this copy assignment operator is allowed.
*
* @since 2.0
+ * @brief <i> [Deprecated] </i>
+ * @deprecated This class is deprecated because char is treated as unsigned char in ARM architecture. Use Integer8 class.
*
* @param[in] rhs An instance of %Int8
*/
* Compares two @c char values.
*
* @since 2.0
+ * @brief <i> [Deprecated] </i>
+ * @deprecated This class is deprecated because char is treated as unsigned char in ARM architecture. Use Integer8 class.
*
* @return A 32-bit @c signed integer value
* @code
* Compares the value of the current instance with the value of the specified instance of the %Int8 class.
*
* @since 2.0
+ * @brief <i> [Deprecated] </i>
+ * @deprecated This class is deprecated because char is treated as unsigned char in ARM architecture. Use Integer8 class.
*
* @return A 32-bit @c signed integer value
* @code
* Checks whether the value of the specified instance of %Int8 is equal to the value of the current instance.
*
* @since 2.0
+ * @brief <i> [Deprecated] </i>
+ * @deprecated This class is deprecated because char is treated as unsigned char in ARM architecture. Use Integer8 class.
*
* @return @c true if the value of the specified instance is equal to the value of the current instance, @n
* else @c false
virtual bool Equals(const Object& obj) const;
/**
- * Gets the hash value of the current instance of %Int8.
+ * Gets the hash value of the current instance of %Int8.
*
- * @since 2.0
+ * @since 2.0
+ * @brief <i> [Deprecated] </i>
+ * @deprecated This class is deprecated because char is treated as unsigned char in ARM architecture. Use Integer8 class.
*
* @return An integer value indicating the hash value of the current instance of %Int8
* @remarks Two equal instances must return the same hash value. For better performance,
virtual int GetHashCode(void) const;
/**
- * Gets the hash value of the specified @c char value.
- *
- * @since 2.0
- *
- * @return An integer value indicating the hash value of the specified @c char value
- * @param[in] val A @c char value to get the hash value
- */
+ * Gets the hash value of the specified @c char value.
+ *
+ * @since 2.0
+ * @brief <i> [Deprecated] </i>
+ * @deprecated This class is deprecated because char is treated as unsigned char in ARM architecture. Use Integer8 class.
+ *
+ * @return An integer value indicating the hash value of the specified @c char value
+ * @param[in] val A @c char value to get the hash value
+ */
static int GetHashCode(char val);
/**
* Decodes a string into a @c signed @c char.
*
* @since 2.0
+ * @brief <i> [Deprecated] </i>
+ * @deprecated This class is deprecated because char is treated as unsigned char in ARM architecture. Use Integer8 class.
*
* @return An error code
* @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_NUM_FORMAT The specified string does not contain a number that can be parsed.
+ * @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
* following grammar:
* @code
* - Sign:
* '-'
* @endcode
+ * @remarks This method has portability issue. @n
+ * When the specified string is nagative number in the ARM architecture, type casting is needed like following code.
+ * @code
+ * char ret;
+ * Int8::Decode(L"-0X20", ret);
+ * SomeOutputFunction(static_cast< signed char >(ret));
+ * @endcode
*/
static result Decode(const String& s, char& ret);
* Parses the @c signed @c char equivalent of the specified string representing a numeric value.
*
* @since 2.0
+ * @brief <i> [Deprecated] </i>
+ * @deprecated This class is deprecated because char is treated as unsigned char in ARM architecture. Use Integer8 class.
*
* @return An error code
* @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_NUM_FORMAT The specified string does not contain a byte that can be parsed.
- * @remarks This method assumes that the string representing the numeric value
- * uses a radix 10.
+ * @exception E_SUCCESS The method is successful.
+ * @exception E_NUM_FORMAT The specified string does not contain a byte that can be parsed.
+ *
+ * @remarks
+ * - 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, char& ret);
/**
* Parses the specified string representing a numeric value and
- * returns the value as @c signed @c char (as out parameter).
- *
+ * returns the value as @c signed @c char (as out parameter).
+ *
* @since 2.0
+ * @brief <i> [Deprecated] </i>
+ * @deprecated This class is deprecated because char is treated as unsigned char in ARM architecture. Use Integer8 class.
*
* @return The @c signed @c char equivalent of the specified string representing the numeric value using the specified index
* @param[in] s A string representing a numeric value
* @param[in] radix The radix of the string representing a numeric value @n
- * It must either be 2, 8, 10, or 16.
- * @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 specified @c radix is invalid.
+ * 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_NUM_FORMAT The specified string does not contain a number that can be parsed.
+ *
+ * @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, char& ret);
/**
- * Gets the @c signed @c char equivalent of the current instance of %Int8.
+ * Gets the @c char equivalent of the current instance of %Int8.
*
* @since 2.0
+ * @brief <i> [Deprecated] </i>
+ *
+ * @deprecated This class is deprecated because char is treated as unsigned char in ARM architecture. Use Integer8 class.
+ * 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 The @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 int8_t equivalent of the current instance of %Int8.
+ *
+ * @since 3.0
+ *
+ * @return The @c int8_t equivalent of the current instance
+ * @remarks This method always returns 0. Use Integer8::ToInt8() to get the @int8_t
+ */
+ virtual int8_t ToInt8(void) const;
+
+ /**
* Gets the @c signed @c short equivalent of the current instance of %Int8.
*
* @since 2.0
+ * @brief <i> [Deprecated] </i>
+ * @deprecated This class is deprecated because char is treated as unsigned char in ARM architecture. Use Integer8 class.
*
* @return The @c signed @c short equivalent of the current instance
*/
* Gets the @c signed @c int equivalent of the current instance of %Int8.
*
* @since 2.0
+ * @brief <i> [Deprecated] </i>
+ * @deprecated This class is deprecated because char is treated as unsigned char in ARM architecture. Use Integer8 class.
*
* @return The @c signed @c int equivalent of the current instance
*/
* Gets the @c signed @c long equivalent of the current instance of %Int8.
*
* @since 2.0
+ * @brief <i> [Deprecated] </i>
+ * @deprecated This class is deprecated because char is treated as unsigned char in ARM architecture. Use Integer8 class.
*
* @return The @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 %Int8.
- *
- * @since 2.0
- *
- * @return The @c signed @c long @c long equivalent of the current instance
- */
+ * Gets the @c signed @c long @c long equivalent of the current instance of %Int8.
+ *
+ * @since 2.0
+ * @brief <i> [Deprecated] </i>
+ * @deprecated This class is deprecated because char is treated as unsigned char in ARM architecture. Use Integer8 class.
+ *
+ * @return The @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 %Int8.
*
* @since 2.0
+ * @brief <i> [Deprecated] </i>
+ * @deprecated This class is deprecated because char is treated as unsigned char in ARM architecture. Use Integer8 class.
*
* @return The @c signed @c float equivalent of the current instance
*/
* Gets the @c signed @c double equivalent of the current instance of %Int8.
*
* @since 2.0
+ * @brief <i> [Deprecated] </i>
+ * @deprecated This class is deprecated because char is treated as unsigned char in ARM architecture. Use Integer8 class.
*
* @return The @c signed @c double equivalent of the current instance
*/
* Gets the string representing the value of the current instance of %Int8.
*
* @since 2.0
+ * @brief <i> [Deprecated] </i>
+ * @deprecated This class is deprecated because char is treated as unsigned char in ARM architecture. Use Integer8 class.
*
* @return A string representing the value of the current instance
*/
* Gets the string representing the specified @c signed @c char value using radix @c 10.
*
* @since 2.0
+ * @brief <i> [Deprecated] </i>
+ * @deprecated This class is deprecated because char is treated as unsigned char in ARM architecture. Use Integer8 class.
*
* @return A string containing a Unicode representation of the specified @c char value using radix 10
* @param[in] value A @c char value
* A @c short character can hold a value of upto 2^7-1.
*
* @since 2.0
+ * @brief <i> [Deprecated] </i>
+ * @deprecated This class is deprecated because char is treated as unsigned char in ARM architecture. Use Integer8 class.
+ *
*/
- static const char VALUE_MAX = (signed char) 0x7F;
+ static const char VALUE_MAX = static_cast< signed char >(0x7F);
/**
* A constant holding the minimum value of type @c char. @n
* A @c short character can hold a value of upto -2^7.
*
* @since 2.0
+ * @brief <i> [Deprecated] </i>
+ * @deprecated This class is deprecated because char is treated as unsigned char in ARM architecture. Use Integer8 class.
+ *
*/
- static const char VALUE_MIN = (signed char) 0x80;
+ static const char VALUE_MIN = static_cast< signed char >(0x80);
/**
* A @c signed @c char value of this instance.
*
* @since 2.0
+ * @brief <i> [Deprecated] </i>
+ * @deprecated This class is deprecated because char is treated as unsigned char in ARM architecture. Use Integer8 class.
+ *
*/
signed char value;
private:
friend class _Int8Impl;
- class _Int8Impl * __pInt8Impl;
+ class _Int8Impl* __pInt8Impl;
}; // Int8