X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=blobdiff_plain;f=dali-toolkit%2Finternal%2Ftext%2Fcharacter-set-conversion.h;h=730016beed1b18361ec59b2d63e089c5803d40e6;hp=c8da542c8e9828e0cc637250a678b9567f7d12ca;hb=49fabc565606e00c95baacb41f009de2a532a4da;hpb=56d412791a44c2a79135d2293c13fddb135c9d54 diff --git a/dali-toolkit/internal/text/character-set-conversion.h b/dali-toolkit/internal/text/character-set-conversion.h index c8da542..730016b 100644 --- a/dali-toolkit/internal/text/character-set-conversion.h +++ b/dali-toolkit/internal/text/character-set-conversion.h @@ -20,9 +20,7 @@ // EXTERNAL INCLUDES #include - -// INTERNAL INCLUDES -#include +#include namespace Dali { @@ -30,6 +28,18 @@ namespace Dali namespace Toolkit { +namespace Text +{ + +/** + * @brief Retrieves the number of bytes of a utf8 character. + * + * @param[in] utf8LeadByte The lead byte of the utf8 character. + * + * @return The number of bytes of the character. + */ +uint8_t GetUtf8Length( uint8_t utf8LeadByte ); + /** * @brief Retrieves the number of characters of the text array encoded in UTF8 * @@ -38,7 +48,7 @@ namespace Toolkit * * @return The number of characters. */ -DALI_IMPORT_API uint32_t GetNumberOfUtf8Characters( const uint8_t* const utf8, uint32_t length ); +uint32_t GetNumberOfUtf8Characters( const uint8_t* const utf8, uint32_t length ); /** * @brief Retrieves the number of bytes needed to encode in UTF8 the given text array encoded in UTF32. @@ -48,7 +58,7 @@ DALI_IMPORT_API uint32_t GetNumberOfUtf8Characters( const uint8_t* const utf8, u * * @return The number of bytes. */ -DALI_IMPORT_API uint32_t GetNumberOfUtf8Bytes( const uint32_t* const utf32, uint32_t numberOfCharacters ); +uint32_t GetNumberOfUtf8Bytes( const uint32_t* const utf32, uint32_t numberOfCharacters ); /** * @brief Converts a text array encoded in UTF8 into a text array encoded in UTF32. @@ -61,7 +71,7 @@ DALI_IMPORT_API uint32_t GetNumberOfUtf8Bytes( const uint32_t* const utf32, uint * * @return The number of characters. */ -DALI_IMPORT_API uint32_t Utf8ToUtf32( const uint8_t* const utf8, uint32_t length, uint32_t* utf32 ); +uint32_t Utf8ToUtf32( const uint8_t* const utf8, uint32_t length, uint32_t* utf32 ); /** * @brief Converts a text array encoded in UTF32 into a text array encoded in UTF8. @@ -74,7 +84,18 @@ DALI_IMPORT_API uint32_t Utf8ToUtf32( const uint8_t* const utf8, uint32_t length * * @return The number of bytes. */ -DALI_IMPORT_API uint32_t Utf32ToUtf8( const uint32_t* const utf32, uint32_t numberOfCharacters, uint8_t* utf8 ); +uint32_t Utf32ToUtf8( const uint32_t* const utf32, uint32_t numberOfCharacters, uint8_t* utf8 ); + +/** + * @brief Converts a text array encoded in UTF32 into a text array encoded in UTF8. + * + * @param[in] utf32 The pointer to the UTF32 array. + * @param[in] numberOfCharacters The number of characters of the UTF32 array. + * @param[out] utf8 The UTF8 characters will be stored here. + */ +void Utf32ToUtf8( const uint32_t* const utf32, uint32_t numberOfCharacters, std::string& utf8 ); + +} // namespace Text } // namespace Toolkit