PythonMonkey   v1.0.0 (dev)
Loading...
Searching...
No Matches
StrType.hh
Go to the documentation of this file.
1
11#ifndef PythonMonkey_StrType_
12#define PythonMonkey_StrType_
13
14#include <jsapi.h>
15
16#include <Python.h>
17
21struct StrType {
22public:
37 static PyObject *getPyObject(JSContext *cx, JS::HandleValue str);
38
39 static const char *getValue(JSContext *cx, JS::HandleValue str);
40
41 static PyObject *proxifyString(JSContext *cx, JS::HandleValue str);
42};
43
44#endif
This struct represents the 'string' type in Python, which is represented as a 'char*' in C++.
Definition StrType.hh:21
static const char * getValue(JSContext *cx, JS::HandleValue str)
Definition StrType.cc:196
static PyObject * proxifyString(JSContext *cx, JS::HandleValue str)
Definition StrType.cc:98
static PyObject * getPyObject(JSContext *cx, JS::HandleValue str)
Construct a new unicode PyObject from a JSString. Automatically handles encoding conversion for latin...
Definition StrType.cc:177