Support Unicode supplementary planes (#3928)
JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
This commit is contained in:
@@ -2605,6 +2605,19 @@ ecma_stringbuilder_append_raw (ecma_stringbuilder_t *builder_p, /**< string buil
|
||||
memcpy (dest_p, data_p, data_size);
|
||||
} /* ecma_stringbuilder_append_raw */
|
||||
|
||||
/**
|
||||
* Append a codepoint to a string builder
|
||||
*/
|
||||
void
|
||||
ecma_stringbuilder_append_codepoint (ecma_stringbuilder_t *builder_p, /**< string builder */
|
||||
lit_code_point_t cp) /**< code point */
|
||||
{
|
||||
const lit_utf8_size_t size = (lit_utf8_size_t) lit_code_point_get_cesu8_length (cp);
|
||||
lit_utf8_byte_t *dest_p = ecma_stringbuilder_grow (builder_p, size);
|
||||
|
||||
lit_code_point_to_cesu8_bytes (dest_p, cp);
|
||||
} /* ecma_stringbuilder_append_codepoint */
|
||||
|
||||
/**
|
||||
* Append an ecma_char_t to a string builder
|
||||
*/
|
||||
@@ -2612,10 +2625,7 @@ void
|
||||
ecma_stringbuilder_append_char (ecma_stringbuilder_t *builder_p, /**< string builder */
|
||||
const ecma_char_t c) /**< ecma char */
|
||||
{
|
||||
const lit_utf8_size_t size = (lit_utf8_size_t) lit_code_point_get_cesu8_length (c);
|
||||
lit_utf8_byte_t *dest_p = ecma_stringbuilder_grow (builder_p, size);
|
||||
|
||||
lit_code_point_to_cesu8_bytes (dest_p, c);
|
||||
ecma_stringbuilder_append_codepoint (builder_p, c);
|
||||
} /* ecma_stringbuilder_append_char */
|
||||
|
||||
/**
|
||||
|
||||
@@ -393,6 +393,7 @@ void ecma_stringbuilder_append_magic (ecma_stringbuilder_t *builder_p, const lit
|
||||
void ecma_stringbuilder_append_raw (ecma_stringbuilder_t *builder_p,
|
||||
const lit_utf8_byte_t *data_p,
|
||||
const lit_utf8_size_t data_size);
|
||||
void ecma_stringbuilder_append_codepoint (ecma_stringbuilder_t *builder_p, lit_code_point_t cp);
|
||||
void ecma_stringbuilder_append_char (ecma_stringbuilder_t *builder_p, const ecma_char_t c);
|
||||
void ecma_stringbuilder_append_byte (ecma_stringbuilder_t *builder_p, const lit_utf8_byte_t);
|
||||
ecma_string_t *ecma_stringbuilder_finalize (ecma_stringbuilder_t *builder_p);
|
||||
|
||||
Reference in New Issue
Block a user