oaDirIter
模块: oapy._oa._base
导入: from oapy._oa import _base
概览
oaDirIter 在 oapy 中可用,可通过 _base 模块访问。
本页汇总 oaDirIter 当前在 oapy 中可用的 Python 接口。
详细说明
The oaDirIter utility class implements a general iterator for iterating the names of items in a directory。 The oaDirIter may be customized by specifying the type of objects returned to be restricted to files (oacFilesDirIterMode), restricted to directories (oacDirsDirIterMode), or unrestricted (oacAllDirIterMode)。 Additionally, the user may optionally specify a wildcard string for name filtering。 Note that the oaDirIter only returns names of file system objects, and has no direct connection with the oaFSComponent class objects。
构造函数
_base.oaDirIter(dirPathIn, modeIn=oacAllDirIterMode)
obj = _base.oaDirIter(dirPathIn, modeIn=oacAllDirIterMode)
_base.oaDirIter(dirPathIn, wildcardNameIn, modeIn=oacAllDirIterMode)
obj = _base.oaDirIter(dirPathIn, wildcardNameIn, modeIn=oacAllDirIterMode)
方法总览
| 状态 | Python 调用 |
|---|---|
| ✅ | obj.getNext(name) |
| ✅ | obj.reset() |
方法说明
obj.getNext(name)
绑定状态: 已绑定
Python 调用: obj.getNext(name)
This function returns the name of the next entry in the directory associated with this iterator。 NULL is returned if all entries have been iterated。 This function does not return the special directory entries "." and ".."。 Note that the oaDirIter only returns names of file system objects, and has no direct connection with the oaFSComponent class objects。
参数
name: The name of the next entry。
Python 示例
from oapy._oa import _base
# assume obj is a oaDirIter
obj.getNext(name)
obj.reset()
绑定状态: 已绑定
Python 调用: obj.reset()
This function resets the iterator, causing it to starting iterating from the beginning of the directory list again。
异常
oacUnableToOpenDir。
Python 示例
from oapy._oa import _base
# assume obj is a oaDirIter
obj.reset()