projects
/
platform
/
core
/
uifw
/
dali-toolkit.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge "support strikethrough markup tag" into devel/master
[platform/core/uifw/dali-toolkit.git]
/
dali-toolkit
/
internal
/
text
/
character-set-conversion.h
diff --git
a/dali-toolkit/internal/text/character-set-conversion.h
b/dali-toolkit/internal/text/character-set-conversion.h
index
b60a344
..
3f8f40a
100644
(file)
--- 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) 20
15
Samsung Electronics Co., Ltd.
+ * Copyright (c) 20
21
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.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@
-24,12
+24,18
@@
namespace Dali
{
namespace Dali
{
-
namespace Toolkit
{
namespace Toolkit
{
-
namespace Text
{
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
/**
* @brief Retrieves the number of characters of the text array encoded in UTF8
@@
-39,7
+45,7
@@
namespace Text
*
* @return The number of characters.
*/
*
* @return The number of characters.
*/
-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.
/**
* @brief Retrieves the number of bytes needed to encode in UTF8 the given text array encoded in UTF32.
@@
-49,20
+55,25
@@
uint32_t GetNumberOfUtf8Characters( const uint8_t* const utf8, uint32_t length )
*
* @return The number of bytes.
*/
*
* @return The number of bytes.
*/
-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.
*
* The @p utf32 buffer needs to be big enough to store all the characters.
*
/**
* @brief Converts a text array encoded in UTF8 into a text array encoded in UTF32.
*
* 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.
*
* @return The number of characters.
*/
* @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.
*
* @return The number of characters.
*/
-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.
/**
* @brief Converts a text array encoded in UTF32 into a text array encoded in UTF8.
@@
-75,7
+86,7
@@
uint32_t Utf8ToUtf32( const uint8_t* const utf8, uint32_t length, uint32_t* utf3
*
* @return The number of bytes.
*/
*
* @return The number of bytes.
*/
-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.
/**
* @brief Converts a text array encoded in UTF32 into a text array encoded in UTF8.
@@
-84,7
+95,7
@@
uint32_t Utf32ToUtf8( const uint32_t* const utf32, uint32_t numberOfCharacters,
* @param[in] numberOfCharacters The number of characters of the UTF32 array.
* @param[out] utf8 The UTF8 characters will be stored here.
*/
* @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
);
+void Utf32ToUtf8(
const uint32_t* const utf32, uint32_t numberOfCharacters, std::string& utf8
);
} // namespace Text
} // namespace Text
@@
-92,4
+103,4
@@
void Utf32ToUtf8( const uint32_t* const utf32, uint32_t numberOfCharacters, std:
} // namespace Dali
} // namespace Dali
-#endif //
__DALI_TOOLKIT_CHARACTER_SET_CONVERSION_H__
+#endif //
DALI_TOOLKIT_CHARACTER_SET_CONVERSION_H