Extending Flash |
|
|
|
| C-Level Extensibility > The C-level API > unsigned short *JS_ValueToString() | |||
unsigned short *JS_ValueToString(JSContext *cx, jsval v, unsigned int *pLength)
Method; extracts a function argument from a jsval structure, converts it to a string, if possible, and passes the converted value back to the caller.
|
NOTE |
Do not modify the returned buffer pointer or you might corrupt the data structures of the JavaScript interpreter. To change the string, you must copy the characters into another buffer and create a new JavaScript string. |
JSContext *cx, jsval v, unsigned int *pLength
cx argument is the opaque JSContext pointer that passes to the JavaScript function.v argument is the jsval structure from which the string is to be extracted.pLength argument is a pointer to an unsigned integer. This function sets *plength equal to the length of the string in bytes.A pointer that points to a null-terminated string if successful or to a null value on failure. The calling routine must not free this string when it finishes.
|
|
|
|