NPString

  • Revision slug: NPString
  • Revision title: NPString
  • Revision id: 173965
  • Created:
  • Creator: Sheppy
  • Is current revision? No
  • Comment /* Fields */

Revision Content

{{wiki.template('Np-plugin-scripting')}}

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).

Revision Source

<p>
{{wiki.template('Np-plugin-scripting')}}
</p>
<h3 name="Summary">Summary</h3>
<p>NPString is a struct that holds a pointer to a sequence of 8-bit units (<code><a href="en/NPUTF8">NPUTF8</a></code>) making up a UTF-8 string, and the number of 8-bit units in the UTF-8 string.
</p>
<div class="note"><b>Note:</b> Whenever an <code>NPString</code> owns its string data and the data may be released through a call to <code><a href="en/NPN_ReleaseVariantValue">NPN_ReleaseVariantValue()</a></code>, the string data must be allocated using <code><a href="en/NPN_MemAlloc">NPN_MemAlloc()</a></code>.</div>
<h3 name="Syntax">Syntax</h3>
<pre>typedef struct _NPString {
    const NPUTF8 *utf8characters;
    uint32_t utf8length;
} NPString;
</pre> 
<h3 name="Fields">Fields</h3>
<p>The data structure has the following fields:
</p>
<dl><dt><code>utf8characters</code>
</dt><dd>An array of the UTF-8 characters comprising the string.
</dd><dt><code>utf8length</code>
</dt><dd>The number of bytes in the UTF-8 string (<b>not</b> the number of characters).
</dd></dl>
Revert to this revision