PythonMonkey   v1.0.0 (dev)
Loading...
Searching...
No Matches
StrType Struct Reference

This struct represents the 'string' type in Python, which is represented as a 'char*' in C++. More...

#include <StrType.hh>

Static Public Member Functions

static PyObject * getPyObject (JSContext *cx, JS::HandleValue str)
 Construct a new unicode PyObject from a JSString. Automatically handles encoding conversion for latin1 & UCS2: codepoint | Python | Spidermonkey | identical representation? 000000-0000FF | latin1 | latin1 | Yes 000100-00D7FF | UCS2 | UTF16 | Yes 00D800-00DFFF | UCS2 (unpaired) | UTF16 (unpaired) | Yes 00E000-00FFFF | UCS2 | UTF16 | Yes 010000-10FFFF | UCS4 | UTF16 | No, conversion and new backing store required, user must explicitly call asUCS4() -> static in code.
 
static const char * getValue (JSContext *cx, JS::HandleValue str)
 
static PyObject * proxifyString (JSContext *cx, JS::HandleValue str)
 

Detailed Description

This struct represents the 'string' type in Python, which is represented as a 'char*' in C++.

Member Function Documentation

◆ getPyObject()

PyObject * StrType::getPyObject ( JSContext *  cx,
JS::HandleValue  str 
)
static

Construct a new unicode PyObject from a JSString. Automatically handles encoding conversion for latin1 & UCS2: codepoint | Python | Spidermonkey | identical representation? 000000-0000FF | latin1 | latin1 | Yes 000100-00D7FF | UCS2 | UTF16 | Yes 00D800-00DFFF | UCS2 (unpaired) | UTF16 (unpaired) | Yes 00E000-00FFFF | UCS2 | UTF16 | Yes 010000-10FFFF | UCS4 | UTF16 | No, conversion and new backing store required, user must explicitly call asUCS4() -> static in code.

Parameters
cx- javascript context pointer
str- JSString pointer
Returns
PyObject* pointer to the resulting PyObject

◆ getValue()

const char * StrType::getValue ( JSContext *  cx,
JS::HandleValue  str 
)
static

◆ proxifyString()

PyObject * StrType::proxifyString ( JSContext *  cx,
JS::HandleValue  str 
)
static

The documentation for this struct was generated from the following files: