本文整理汇总了Python中djinni.pycffi_marshal.CPyString类的典型用法代码示例。如果您正苦于以下问题:Python CPyString类的具体用法?Python CPyString怎么用?Python CPyString使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了CPyString类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: update_static_messg_to
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
示例2: on_string_change
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
示例3: __get_value
def __get_value(cself, key):
pyKey = CPyString.toPyWithoutTakingOwnership(key)
try:
with CPyString.fromPyOpt(CPyObjectProxy.toPyObj(None, cself)[pyKey]) as py_obj:
return py_obj.release_djinni_string()
except Exception as _djinni_py_e:
CPyException.setExceptionFromPy(_djinni_py_e)
return ffi.NULL
示例4: cause_changes_string_optional_returned
def cause_changes_string_optional_returned(self, i, f, s, binar, b, d):
with CPyBoxedI32.fromPyOpt(i) as pyopt_i,\
CPyString.fromPyOpt(s) as pyopt_s,\
CPyBinary.fromPy(binar) as pybin_binar:
_ret_c = lib.cw__foo_receiver_cause_changes_string_optional_returned(self._cpp_impl, pyopt_i.release_djinni_boxed(), CPyPrimitive.fromPy(f), pyopt_s.release_djinni_string(), pybin_binar.release_djinni_binary(), CPyPrimitive.fromPy(b), CPyDate.fromPy(d))
CPyException.toPyCheckAndRaise(_ret_c)
_ret = CPyString.toPyOpt(_ret_c)
return _ret
示例5: get_set_strings
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
示例6: cause_changes_string_returned
def cause_changes_string_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_string_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 = CPyString.toPy(_ret_c)
assert _ret is not None
return _ret
示例7: on_string_change
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
示例8: __get_value
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
示例9: get_client_returned_record_f3
def get_client_returned_record_f3(cself):
try:
with CPyString.fromPyOpt(CPyRecord.toPy(None, cself).misc) as py_obj:
return py_obj.release_djinni_string()
except Exception as _djinni_py_e:
CPyException.setExceptionFromPy(_djinni_py_e)
return ffi.NULL
示例10: __python_next
def __python_next(cself):
try:
with CPyString.fromPyOpt(next(CPyObjectProxy.toPyIter(cself))) as py_obj:
return py_obj.release_djinni_string()
except Exception as _djinni_py_e:
CPyException.setExceptionFromPy(_djinni_py_e)
return ffi.NULL
示例11: python_create_foo_client_returned_record
def python_create_foo_client_returned_record(record_id, content, some_record):
py_rec = FooClientReturnedRecord(
CPyPrimitive.toPy(record_id),
CPyString.toPy(content),
CPyRecord.toPy(FooSomeOtherRecord.c_data_set, some_record),
)
return CPyRecord.fromPy(FooClientReturnedRecord.c_data_set, py_rec) # to do: can be optional?
示例12: on_changes_string_optional_returned
def on_changes_string_optional_returned(cself, i, f, s, binar, b, d):
try:
with CPyString.fromPyOpt(FooListenerHelper.selfToPy(cself).on_changes_string_optional_returned(CPyBoxedI32.toPyOpt(i), CPyPrimitive.toPy(f), CPyString.toPyOpt(s), CPyBinary.toPy(binar), CPyPrimitive.toPy(b), CPyDate.toPy(d))) as py_obj:
return py_obj.release_djinni_string()
except Exception as _djinni_py_e:
CPyException.setExceptionFromPy(_djinni_py_e)
return ffi.NULL
示例13: get_string
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
示例14: __get_value
def __get_value(cself, key):
pyKey = CPyString.toPyWithoutTakingOwnership(key)
assert pyKey is not None
try:
_ret = CPyPrimitive.fromPy(CPyObjectProxy.toPyObj(None, cself)[pyKey])
return _ret
except Exception as _djinni_py_e:
CPyException.setExceptionFromPy(_djinni_py_e)
return ffi.NULL
示例15: get_foo_constants_f2
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