Implementation of ImmutableString
[platform/framework/native/appfw.git] / inc / FBaseInt8.h
index 7360927..5984b97 100644 (file)
@@ -1,5 +1,4 @@
 //
-// 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
@@ -80,16 +81,21 @@ public:
         * 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
         */
@@ -99,6 +105,9 @@ public:
         * 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);
 
@@ -106,6 +115,8 @@ public:
         * 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
         */
@@ -115,6 +126,8 @@ public:
         * 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
@@ -131,6 +144,8 @@ public:
         * 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
@@ -146,6 +161,8 @@ public:
         * 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
@@ -155,9 +172,11 @@ public:
        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,
@@ -167,25 +186,30 @@ public:
        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
@@ -198,6 +222,13 @@ public:
         *      - 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);
 
@@ -205,12 +236,15 @@ public:
         * 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.
+        * @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.
@@ -222,32 +256,52 @@ public:
         * 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.
+        *                      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.
-        * @exception   E_OUT_OF_RANGE The specified @c radix is invalid.
+        * @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
         */
@@ -257,6 +311,8 @@ public:
         * 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
         */
@@ -266,24 +322,30 @@ public:
         * 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
         */
@@ -293,6 +355,8 @@ public:
         * 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
         */
@@ -302,6 +366,8 @@ public:
         * 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
         */
@@ -311,6 +377,8 @@ public:
         * 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
@@ -322,28 +390,37 @@ public:
         * 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