NPString

  • Revision slug: NPString
  • Revision title: NPString
  • Revision id: 173967
  • Created:
  • Creator: Eric johansson
  • Is current revision? Yes
  • Comment /* Syntax */

Revision Content

{{ 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>
{{ Np-plugin-scripting() }}
</p>
<h3 id="Summary" 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 id="Syntax" name="Syntax">Syntax</h3>
<pre>typedef struct _NPString {
    const NPUTF8 *UTF8Characters;
    uint32_t UTF8Length;
} NPString;
</pre>
<h3 id="Fields" 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