本文整理汇总了Python中djinni.pycffi_marshal.CPyString.fromPy方法的典型用法代码示例。如果您正苦于以下问题:Python CPyString.fromPy方法的具体用法?Python CPyString.fromPy怎么用?Python CPyString.fromPy使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类djinni.pycffi_marshal.CPyString
的用法示例。
在下文中一共展示了CPyString.fromPy方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: get_set_strings
# 需要导入模块: from djinni.pycffi_marshal import CPyString [as 别名]
# 或者: from djinni.pycffi_marshal.CPyString import fromPy [as 别名]
def get_set_strings(self, ps1, ps2):
with CPyString.fromPy(ps1) as pys_ps1,\
CPyString.fromPy(ps2) as pys_ps2:
_ret_c = lib.cw__foo_interface_get_set_strings(self._cpp_impl, pys_ps1.release_djinni_string(), pys_ps2.release_djinni_string())
CPyException.toPyCheckAndRaise(_ret_c)
_ret = CPyString.toPy(_ret_c)
assert _ret is not None
return _ret
示例2: update_static_messg_to
# 需要导入模块: from djinni.pycffi_marshal import CPyString [as 别名]
# 或者: from djinni.pycffi_marshal.CPyString import fromPy [as 别名]
def update_static_messg_to(static_string):
with CPyString.fromPy(static_string) as pys_static_string:
_ret_c = lib.cw__foo_static_update_static_messg_to(pys_static_string.release_djinni_string())
CPyException.toPyCheckAndRaise(_ret_c)
_ret = CPyString.toPy(_ret_c)
assert _ret is not None
return _ret
示例3: on_string_change
# 需要导入模块: from djinni.pycffi_marshal import CPyString [as 别名]
# 或者: from djinni.pycffi_marshal.CPyString import fromPy [as 别名]
def on_string_change(self, private_string):
with CPyString.fromPy(private_string) as pys_private_string:
_ret_c = lib.cw__foo_listener_bf_on_string_change(self._cpp_impl, pys_private_string.release_djinni_string())
CPyException.toPyCheckAndRaise(_ret_c)
_ret = CPyString.toPy(_ret_c)
assert _ret is not None
return _ret
示例4: cause_changes_int_returned
# 需要导入模块: from djinni.pycffi_marshal import CPyString [as 别名]
# 或者: from djinni.pycffi_marshal.CPyString import fromPy [as 别名]
def cause_changes_int_returned(self, i, f, s, binar, b, d):
with CPyString.fromPy(s) as pys_s,\
CPyBinary.fromPy(binar) as pybin_binar:
_ret_c = lib.cw__foo_receiver_cause_changes_int_returned(self._cpp_impl, CPyPrimitive.fromPy(i), CPyPrimitive.fromPy(f), pys_s.release_djinni_string(), pybin_binar.release_djinni_binary(), CPyPrimitive.fromPy(b), CPyDate.fromPy(d))
CPyException.toPyCheckAndRaise(_ret_c)
_ret = CPyPrimitive.toPy(_ret_c)
assert _ret is not None
return _ret
示例5: __python_next
# 需要导入模块: from djinni.pycffi_marshal import CPyString [as 别名]
# 或者: from djinni.pycffi_marshal.CPyString import fromPy [as 别名]
def __python_next(cself):
try:
with CPyString.fromPy(next(CPyObjectProxy.toPyIter(cself))) as py_obj:
_ret = py_obj.release_djinni_string()
assert _ret != ffi.NULL
return _ret
except Exception as _djinni_py_e:
CPyException.setExceptionFromPy(_djinni_py_e)
return ffi.NULL
示例6: get_foo_constants_f2
# 需要导入模块: from djinni.pycffi_marshal import CPyString [as 别名]
# 或者: from djinni.pycffi_marshal.CPyString import fromPy [as 别名]
def get_foo_constants_f2(cself):
try:
with CPyString.fromPy(CPyRecord.toPy(None, cself).some_string) as py_obj:
_ret = py_obj.release_djinni_string()
assert _ret != ffi.NULL
return _ret
except Exception as _djinni_py_e:
CPyException.setExceptionFromPy(_djinni_py_e)
return ffi.NULL
示例7: on_changes_string_returned
# 需要导入模块: from djinni.pycffi_marshal import CPyString [as 别名]
# 或者: from djinni.pycffi_marshal.CPyString import fromPy [as 别名]
def on_changes_string_returned(cself, i, f, s, binar, b, d):
try:
with CPyString.fromPy(FooListenerHelper.selfToPy(cself).on_changes_string_returned(CPyPrimitive.toPy(i), CPyPrimitive.toPy(f), CPyString.toPy(s), CPyBinary.toPy(binar), CPyPrimitive.toPy(b), CPyDate.toPy(d))) as py_obj:
_ret = py_obj.release_djinni_string()
assert _ret != ffi.NULL
return _ret
except Exception as _djinni_py_e:
CPyException.setExceptionFromPy(_djinni_py_e)
return ffi.NULL
示例8: on_string_change
# 需要导入模块: from djinni.pycffi_marshal import CPyString [as 别名]
# 或者: from djinni.pycffi_marshal.CPyString import fromPy [as 别名]
def on_string_change(cself, private_string):
try:
with CPyString.fromPy(FooListenerHelper.selfToPy(cself).on_string_change(CPyString.toPy(private_string))) as py_obj:
_ret = py_obj.release_djinni_string()
assert _ret != ffi.NULL
return _ret
except Exception as _djinni_py_e:
CPyException.setExceptionFromPy(_djinni_py_e)
return ffi.NULL
示例9: get_record_with_derivings_f2
# 需要导入模块: from djinni.pycffi_marshal import CPyString [as 别名]
# 或者: from djinni.pycffi_marshal.CPyString import fromPy [as 别名]
def get_record_with_derivings_f2(cself):
try:
with CPyString.fromPy(CPyRecord.toPy(None, cself).key2) as py_obj:
_ret = py_obj.release_djinni_string()
assert _ret != ffi.NULL
return _ret
except Exception as _djinni_py_e:
CPyException.setExceptionFromPy(_djinni_py_e)
return ffi.NULL
示例10: __get_elem
# 需要导入模块: from djinni.pycffi_marshal import CPyString [as 别名]
# 或者: from djinni.pycffi_marshal.CPyString import fromPy [as 别名]
def __get_elem(cself, index):
try:
with CPyString.fromPy(CPyObject.toPy(None, cself)[index]) as py_obj:
_ret = py_obj.release_djinni_string()
assert _ret != ffi.NULL
return _ret
except Exception as _djinni_py_e:
CPyException.setExceptionFromPy(_djinni_py_e)
return ffi.NULL
示例11: get_string
# 需要导入模块: from djinni.pycffi_marshal import CPyString [as 别名]
# 或者: from djinni.pycffi_marshal.CPyString import fromPy [as 别名]
def get_string(cself):
try:
with CPyString.fromPy(FooListenerBfHelper.selfToPy(cself).get_string()) as py_obj:
_ret = py_obj.release_djinni_string()
assert _ret != ffi.NULL
return _ret
except Exception as _djinni_py_e:
CPyException.setExceptionFromPy(_djinni_py_e)
return ffi.NULL
示例12: __get_value
# 需要导入模块: from djinni.pycffi_marshal import CPyString [as 别名]
# 或者: from djinni.pycffi_marshal.CPyString import fromPy [as 别名]
def __get_value(cself, key):
pyKey = CPyString.toPyWithoutTakingOwnership(key)
assert pyKey is not None
try:
with CPyString.fromPy(CPyObjectProxy.toPyObj(None, cself)[pyKey]) as py_obj:
_ret = py_obj.release_djinni_string()
assert _ret != ffi.NULL
return _ret
except Exception as _djinni_py_e:
CPyException.setExceptionFromPy(_djinni_py_e)
return ffi.NULL
示例13: set_string
# 需要导入模块: from djinni.pycffi_marshal import CPyString [as 别名]
# 或者: from djinni.pycffi_marshal.CPyString import fromPy [as 别名]
def set_string(self, private_string):
with CPyString.fromPy(private_string) as pys_private_string:
lib.cw__foo_primitives_set_string(self._cpp_impl, pys_private_string.release_djinni_string())
CPyException.toPyCheckAndRaise(ffi.NULL)
示例14: check_token_type
# 需要导入模块: from djinni.pycffi_marshal import CPyString [as 别名]
# 或者: from djinni.pycffi_marshal.CPyString import fromPy [as 别名]
def check_token_type(t, type):
with CPyString.fromPy(type) as pys_type:
lib.cw__test_helpers_check_token_type(UserTokenHelper.fromPy(t), pys_type.release_djinni_string())
CPyException.toPyCheckAndRaise(ffi.NULL)
示例15: cause_py_exception
# 需要导入模块: from djinni.pycffi_marshal import CPyString [as 别名]
# 或者: from djinni.pycffi_marshal.CPyString import fromPy [as 别名]
def cause_py_exception(self, exception_arg):
with CPyString.fromPy(exception_arg) as pys_exception_arg:
lib.cw__foo_receiver_cause_py_exception(self._cpp_impl, pys_exception_arg.release_djinni_string())
CPyException.toPyCheckAndRaise(ffi.NULL)