Add API documentation for jerry_create_string_from_utf8 and jerry_create_string_sz_from_utf8 functions. (#1444)

JerryScript-DCO-1.0-Signed-off-by: Robert Sipka rsipka.uszeged@partner.samsung.com
This commit is contained in:
Robert Sipka
2016-11-24 00:12:09 +01:00
committed by yichoi
parent cf7b7a1090
commit 97303eb8e4
2 changed files with 92 additions and 0 deletions
+74
View File
@@ -1981,6 +1981,80 @@ jerry_create_string_sz (const jerry_char_t *str_p,
- [jerry_create_string](#jerry_create_string)
## jerry_create_string_from_utf8
**Summary**
Create string from a valid UTF8 string.
*Note*: The difference from [jerry_create_string](#jerry_create_string) is that it accepts utf-8 string instead of cesu-8 string.
**Prototype**
```c
jerry_value_t
jerry_create_string_from_utf8 (const jerry_char_t *str_p);
```
- `str_p` - pointer to string
- return value - value of the created string
**Example**
```c
{
const jerry_char_t char_array[] = "a string";
jerry_value_t string_value = jerry_create_string_from_utf8 (char_array);
... // usage of string_value
jerry_release_value (string_value);
}
```
**See also**
- [jerry_create_string_sz_from_utf8](#jerry_create_string_sz_from_utf8)
## jerry_create_string_sz_from_utf8
**Summary**
Create string from a valid UTF8 string.
*Note*: The difference from [jerry_create_string_sz](#jerry_create_string_sz) is that it accepts utf-8 string instead of cesu-8 string.
**Prototype**
```c
jerry_value_t
jerry_create_string_sz (const jerry_char_t *str_p,
jerry_size_t str_size)
```
- `str_p` - pointer to string
- `str_size` - size of the string
- return value - value of the created string
**Example**
```c
{
const jerry_char_t char_array[] = "a string";
jerry_value_t string_value = jerry_create_string_sz_from_utf8 (char_array,
strlen ((const char *) char_array));
... // usage of string_value
jerry_release_value (string_value);
}
```
**See also**
- [jerry_create_string_from_utf8](#jerry_create_string_from_utf8)
## jerry_create_undefined