StorageScopeBase#
- class ansys.bdm.base.base_storage_scope.StorageScopeBase#
Bases:
ansys.bdm.api.istorage_scope.IStorageScopeA partial implementation of
IStorageScopethat provides implementations of some methods based on other more fundamental methods.StorageScopeBasecan be used as a base class for implementations ofIStorageScope.
Overview#
Import detail#
from ansys.bdm.base.base_storage_scope import StorageScopeBase
Method detail#
- StorageScopeBase.get_bytes(entity: ansys.bdm.api.entity_handle.EntityHandle) bytes#
Return the content of the referenced blob.
- Parameters:
- entity: EntityHandle
The handle to the data to realize
- Returns:
- bytes
the contents of the EntityHandle.
- Raises:
- CannotGenerateStreamForDirectoryError
If the entity requested is a collection
- StorageScopeBase.get_text(entity: ansys.bdm.api.entity_handle.EntityHandle, encoding: str | None = None) str#
Return the content of the referenced blob.
- Parameters:
- entity: EntityHandle
The handle to the data to realize
- encoding: Optional[str]
The name of an encoding. When this argument is not None the bytes of
entitywill be read using that encoding.
- Returns:
- str
the contents of the EntityHandle in text form with the encoding determined in order of preference: - the encoding argument if not None - the encoding field of the entity argument if set - the BOM of the referenced entity if it contains one; or - UTF-8
- Raises:
- CannotGenerateStreamForDirectoryError
If the entity requested is a collection