NString
模块: oapy._oa._common
导入: from oapy._oa import _common
概览
NString 在 oapy 中可用,可通过 _common 模块访问。
本页汇总 NString 当前在 oapy 中可用的 Python 接口。
详细说明
This is a Narrow String class with a reference counted buffer。 When a second NString instance is instantiated from the first one, the pointer to the buffer is copied, and the reference count (for the buffer) is incremented。 It is decremented when the NString no longer holds that buffer (such as in the assignment operaor and the destructor)。 The NString that brings the reference count to zero then frees the memory。 This allows for an efficient way of passing strings without having to worry about lifetime and managing the memory for the buffer。
构造函数
_common.NString(in=NULL)
obj = _common.NString(in=NULL)
_common.NString(str)
obj = _common.NString(str)
方法总览
| 状态 | Python 调用 |
|---|---|
| ✅ | obj.operator=(str) |
| ✅ | obj.operator=(str) |
| ✅ | obj.length() |
方法说明
obj.operator=(str)
绑定状态: 已绑定
Python 调用: obj.operator=(str)
Python 示例
from oapy._oa import _common
# assume obj is a NString
obj.operator=(str)
obj.operator=(str)
绑定状态: 已绑定
Python 调用: obj.operator=(str)
Python 示例
from oapy._oa import _common
# assume obj is a NString
obj.operator=(str)
obj.length()
绑定状态: 已绑定
Python 调用: obj.length()
This function returns the length of the character string controlled by this NString。
Python 示例
from oapy._oa import _common
# assume obj is a NString
obj.length()