66 virtual bool accepts(PyObject *pyob)
const {
67 return pyob !=
nullptr && PyMapping_Check(pyob) != 0;
81 if (PyMapping_SetItemString(
mPtr, pszKey, value.
mPtr) == -1) {
95 if (PyObject_SetItem(
mPtr, key.
mPtr, value.
mPtr) == -1) {
Heap-allocated NUL-terminated string.
Definition hxstr.h:41
char * mStr
Text buffer.
Definition hxstr.h:464
Root of the PyCXX exception hierarchy.
Definition exception.h:19
MapBase()
Produce a handle on None for a derived class that fills it in afterwards.
Definition mapbase.h:45
MapBase(PyObject *pyob)
Take a borrowed reference on behalf of a derived class.
Definition mapbase.h:53
virtual void setItem(const HxStr &key, const Object &value)
Store a value under a name.
Definition mapbase.h:79
virtual bool accepts(PyObject *pyob) const
Accept any reference the mapping protocol supports.
Definition mapbase.h:66
virtual void setItem(const Object &key, const Object &value)
Store a value under a key object.
Definition mapbase.h:94
Object(PyObject *pyob=Py_None)
Take a borrowed reference and add a count of its own.
Definition object.h:52
void validate()
Enforce this type's accepts() test on the stored reference.
Definition object.h:237
PyObject * mPtr
Wrapped reference, null only between release() and the next assignment.
Definition object.h:191
Configuration header of the PyCXX binding layer.
const char * g_szEmptyString
Text an empty HxStr points at, and the substitute for a null buffer.
C++ wrappers for the embedded Python interpreter's objects, types, and extension modules.
Definition attributeerror.h:7