NPString

« Gecko Plugin API Reference « Scripting plugins

Summary

NPString is a struct that holds a pointer to a sequence of 8-bit units (NPUTF8) making up a UTF-8 string, and the number of 8-bit units in the UTF-8 string.

Note: Whenever an NPString owns its string data and the data may be released through a call to NPN_ReleaseVariantValue(), the string data must be allocated using NPN_MemAlloc().

Syntax

typedef struct _NPString {
    const NPUTF8 *UTF8Characters;
    uint32_t UTF8Length;
} NPString;

Fields

The data structure has the following fields:

UTF8Characters
An array of the UTF-8 characters comprising the string.
UTF8Length
The number of bytes in the UTF-8 string (not the number of characters).