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=168c525b25da6390962b75ccefc0301d9c0aa974;hp=19784fbcf34acf43071aea0e4b81fa200ff9c843;hb=b694e7e2ae624e206e1548b1a863c554eb9cd4d7;hpb=61cdd0ef6c35b82605b7313845e5dc84b707074f diff --git a/dali-toolkit/internal/text/character-set-conversion.h b/dali-toolkit/internal/text/character-set-conversion.h index 19784fb..168c525 100644 --- a/dali-toolkit/internal/text/character-set-conversion.h +++ b/dali-toolkit/internal/text/character-set-conversion.h @@ -1,8 +1,8 @@ -#ifndef __DALI_TOOLKIT_CHARACTER_SET_CONVERSION_H__ -#define __DALI_TOOLKIT_CHARACTER_SET_CONVERSION_H__ +#ifndef DALI_TOOLKIT_CHARACTER_SET_CONVERSION_H +#define DALI_TOOLKIT_CHARACTER_SET_CONVERSION_H /* - * Copyright (c) 2015 Samsung Electronics Co., Ltd. + * Copyright (c) 2019 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -22,15 +22,24 @@ #include #include -// INTERNAL INCLUDES -#include - 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 * @@ -56,6 +65,11 @@ uint32_t GetNumberOfUtf8Bytes( const uint32_t* const utf32, uint32_t numberOfCha * * The @p utf32 buffer needs to be big enough to store all the characters. * + * If the text contains a single 'CR' character or a pair 'CR'+'LF', they are replaced by a 'LF'. + * + * @note GetNumberOfUtf8Characters() does not convert 'CR' or 'CR'+'LF' to 'LF' so the return number + * of characters of that method may be higher than the number of characters returned by this one. + * * @param[in] utf8 The pointer to the UTF8 array. * @param[in] length The length of the UTF8 array. * @param[out] utf32 The pointer to the UTF32 array. @@ -86,8 +100,10 @@ uint32_t Utf32ToUtf8( const uint32_t* const utf32, uint32_t numberOfCharacters, */ void Utf32ToUtf8( const uint32_t* const utf32, uint32_t numberOfCharacters, std::string& utf8 ); +} // namespace Text + } // namespace Toolkit } // namespace Dali -#endif // __DALI_TOOLKIT_CHARACTER_SET_CONVERSION_H__ +#endif // DALI_TOOLKIT_CHARACTER_SET_CONVERSION_H