Skip to content

Commit

Permalink
Add comment for createJSONObject
Browse files Browse the repository at this point in the history
  • Loading branch information
dumganhar committed Jul 31, 2024
1 parent 03e4270 commit fcc8993
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions native/cocos/bindings/jswrapper/v8/Object.h
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,13 @@ class Object final : public RefCounter {
* @note The return value (non-null) has to be released manually.
*/
static Object *createJSONObject(const ccstd::string &jsonStr);

/**
* @brief Creates a JavaScript Object from a JSON formatted string.
* @param[in] jsonStr The utf-16 string containing the JSON string to be parsed.
* @return A JavaScript Object containing the parsed value, or nullptr if the input is invalid.
* @note The return value (non-null) has to be released manually. In order to avoid memory copy, use std::u16string reference directly without const, after this method is invoked, jsonStr will be empty since it was moved.
*/
static Object *createJSONObject(std::u16string &jsonStr);

/**
Expand Down

0 comments on commit fcc8993

Please sign in to comment.