{
/**
* @class StringUtil
- * @brief This class provides various utility methods for %String.
+ * @brief This class provides utility methods for %String operations.
*
* @since 2.0
*
- * The %StringUtil class provides various utility methods for String.
+ * The %StringUtil class provides utility methods for String operations.
*
* For more information on the class features, see <a href="../org.tizen.native.appprogramming/html/guide/base/utility_namespace.htm">Utility</a>.
*
* Converts an McharBuffer to a null-terminated string. @n
* The position of the buffer is not changed.
*
- * @brief <i> [Deprecated] </i>
- * @deprecated This method is deprecated as @c mchar type is changed to @c wchar_t type.
- * Instead of using this method, use the WcharBufferToString(const WcharBuffer& mb, String& str) method.
- * @since 2.0
+ * @brief <i> [Deprecated] </i>
+ * @deprecated This method is deprecated as @c mchar type is changed to @c wchar_t type.
+ * Instead of using this method, use the WcharBufferToString(const WcharBuffer& mb, String& str) method.
+ * @since 2.0
*
* @return An error code
- * @param[in] mb An instance of McharBuffer
- * @param[out] str The current position
+ * @param[in] mb An instance of McharBuffer
+ * @param[out] str The null-terminated string
* @exception E_SUCCESS The method is successful.
- * @exception E_INVALID_ARG A specified input parameter is invalid, or
- * @c null does not exist between the position and limit of buffer.
+ * @exception E_INVALID_ARG Either of the following conditions has occurred:
+ * - A specified input parameter is invalid.
+ * - @c null does not exist between the position and limit of buffer.
* @endif
*/
static result MbToString(const McharBuffer& mb, String& str);
* Converts an WcharBuffer to a null-terminated string. @n
* The position of the buffer is not changed.
*
- * @since 2.0
+ * @since 2.0
*
* @return An error code
* @param[in] wb An instance of WcharBuffer
- * @param[out] str The current position
+ * @param[out] str The null-terminated string
* @exception E_SUCCESS The method is successful.
- * @exception E_INVALID_ARG A specified input parameter is invalid, or
- * @c null does not exist between the position and limit of buffer.
+ * @exception E_INVALID_ARG Either of the following conditions has occurred:
+ * - A specified input parameter is invalid.
+ * - @c null does not exist between the position and limit of buffer.
*/
static result WcharBufferToString(const WcharBuffer& wb, String& str);
* Gets a new McharBuffer from the specified string. @n
* The buffer's limit is the length of the string plus one and the starting position is @c 0.
*
- * @brief <i> [Deprecated] </i>
- * @deprecated This method is deprecated as @c mchar type is changed to @c wchar_t type.
- * Instead of using this method, use the StringToWcharBufferN(const String& str) method.
- * @since 2.0
+ * @brief <i> [Deprecated] </i>
+ * @deprecated This method is deprecated as @c mchar type is changed to @c wchar_t type.
+ * Instead of using this method, use the StringToWcharBufferN(const String& str) method.
+ * @since 2.0
*
* @return A pointer to the McharBuffer instance from the specified string, @n
* else @c null if an exception occurs
* Gets a new WcharBuffer from the specified string. @n
* The buffer's limit is the length of the string plus one and the starting position is @c 0.
*
- * @since 2.0
+ * @since 2.0
*
* @return A pointer to the WcharBuffer instance from the specified string, @n
* else @c null if an exception occurs
* Gets a new McharBuffer from a substring of the specified string. @n
* The buffer's limit is the length of the string plus one and the starting position is @c 0.
*
- * @brief <i> [Deprecated] </i>
- * @deprecated This method is deprecated as @c mchar type is changed to @c wchar_t type.
- * Instead of using this method, use the StringToWcharBufferN(const String& str, int index, int length) method.
- * @since 2.0
+ * @brief <i> [Deprecated] </i>
+ * @deprecated This method is deprecated as @c mchar type is changed to @c wchar_t type.
+ * Instead of using this method, use the StringToWcharBufferN(const String& str, int index, int length) method.
+ * @since 2.0
*
* @return A pointer to the McharBuffer instance from the substring of the specified string, @n
* else @c null if an exception occurs
/**
* @if OSPDEPREC
- * Gets the string length in the McharBuffer. @n
+ * Gets the string length in the specified McharBuffer. @n
* The string length is the length from the current position of the %McharBuffer to the @c null character.
* The position of the buffer is not changed.
*
- * @brief <i> [Deprecated] </i>
- * @deprecated This method is deprecated as @c mchar type is changed to @c wchar_t type.
- * Instead of using this method, use the GetStringLengthInWcharBuffer(const WcharBuffer& wb) method.
+ * @brief <i> [Deprecated] </i>
+ * @deprecated This method is deprecated as @c mchar type is changed to @c wchar_t type.
+ * Instead of using this method, use the GetStringLengthInWcharBuffer(const WcharBuffer& wb) method.
*
* @since 2.0
*
static int GetStringLengthInMb(const McharBuffer& mb);
/**
- * Gets the string length in the WcharBuffer. @n
+ * Gets the string length in the specified WcharBuffer. @n
* The string length is the length from the current position of the %WcharBuffer to the @c null character.
* The position of the buffer is not changed.
*
*
* @return A pointer to the ByteBuffer instance encoded from the specified string, @n
* else @c null if an exception occurs
- * @param[in] unicodeString A string to encode
+ * @param[in] unicodeString The string to encode
* @exception E_SUCCESS The method is successful.
* @exception E_INVALID_ARG The specified input parameter is invalid.
* @remarks The specific error code can be accessed using the GetLastResult() method.
- * @see Tizen::Base::ByteBuffer
- * @see Tizen::Base::String
*/
static ByteBuffer* StringToUtf8N(const String& unicodeString);
* @since 2.0
*
* @return An error code
- * @param[in] pUtf8String A pointer to a String instance containing UTF-8 codes
+ * @param[in] pUtf8String A pointer to the String instance containing UTF-8 codes
* @param[out] unicodeString A string containing Unicode characters
* @exception E_SUCCESS The method is successful.
* @exception E_INVALID_ARG The specified @c pUtf8String is a @c null reference.
*
* @return A pointer to the ByteBuffer instance decoded from the specified string, @n
* else @c null if an exception occurs
- * @param[in] base64String A string to decode
+ * @param[in] base64String The string to decode
* @exception E_SUCCESS The method is successful.
* @exception E_INVALID_ARG The specified input parameter is invalid. @n
* The specified @c base64String is not a valid Base64 string.
*
* String encodedStr;
* ByteBuffer buffer;
- * buffer.Construct(size + 1);
+ * buffer.Construct(size);
*
- * buffer.SetArray((byte*)pChar, 0, size);
- * buffer.SetByte('\0');
+ * buffer.SetArray(reinterpret_cast< const byte* >(pChar), 0, size);
* buffer.Flip();
*
* StringUtil::EncodeToBase64String(buffer, encodedStr);
*
* // Decodes a String consisting of base 64 digits to a ByteBuffer
- * ByteBuffer* pDecodedBuffer = StringUtil::DecodeBase64StringN(encodedStr);
+ * std::unique_ptr< ByteBuffer > pDecodedBuffer(StringUtil::DecodeBase64StringN(encodedStr));
*
* @endcode
*/
* @since 2.0
*
* @return An error code
- * @param[in] buffer An instance of ByteBuffer to encode
- * @param[out] encodedString An instance of String consisting of base 64 characters
+ * @param[in] buffer An instance of ByteBuffer to encode
+ * @param[out] encodedString An instance of String consisting of base 64 characters
* @exception E_SUCCESS The method is successful.
- * @exception E_INVALID_ARG A specified input parameter is invalid, or
- * the @c buffer is empty.
+ * @exception E_INVALID_ARG Either of the following conditions has occurred:
+ * - A specified input parameter is invalid.
+ * - The @c buffer is empty.
*
* The following example demonstrates how to use the %EncodeToBase64String() method.
*
*
* String encodedStr;
* ByteBuffer buffer;
- * buffer.Construct(size + 1);
+ * buffer.Construct(size);
*
- * buffer.SetArray((byte*)pChar, 0, size);
- * buffer.SetByte('\0');
+ * buffer.SetArray(reinterpret_cast< const byte* >(pChar), 0, size);
* buffer.Flip();
*
* // Encodes a ByteBuffer into a String consisting of base 64 characters