![]() |
Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
|
\inmodule QtOhosAppKit More...
Classes | |
| class | PathPolicy |
| \inmodule QtOhosAppKit More... | |
| class | PathPolicyErrorInfo |
| \variable QtOhosAppKit::FileShare::PathPolicy::path More... | |
| class | PathPolicyCheckResult |
| \variable QtOhosAppKit::FileShare::PathPolicyErrorInfo::path More... | |
| class | ActionResult |
| \inmodule QtOhosAppKit More... | |
| class | CheckResult |
| \inmodule QtOhosAppKit More... | |
Enumerations | |
| enum class | OperationMode { Read = 1 << 0 , Write = 1 << 1 } |
| enum class | PathPolicyError { Unknown , PersistenceForbidden , InvalidMode , InvalidPath , PermissionNotPersisted } |
Functions | |
| std::shared_ptr< ActionResult > | persistPermission (const QList< PathPolicy > &policies) |
| Persists file or folder permissions from policies. | |
| std::shared_ptr< ActionResult > | revokePermission (const QList< PathPolicy > &policies) |
| Revokes file or folder permissions from policies. | |
| std::shared_ptr< ActionResult > | activatePermission (const QList< PathPolicy > &policies) |
| Activates file or folder permissions from policies. | |
| std::shared_ptr< ActionResult > | deactivatePermission (const QList< PathPolicy > &policies) |
| Deactivates file or folder permissions from policies. | |
| std::shared_ptr< CheckResult > | checkPersistent (const QList< PathPolicy > &policies) |
| Checks if file or folder permissions from policies have persistent permissions. | |
\inmodule QtOhosAppKit
The FileShare to expose file permission API.
This API uses file system paths, which differ from the URIs used internally by HarmonyOS. For example, the path /data/storage/el1/bundle/entry/resources/resfile/test.txt will be converted to the URI file://com.your.example/data/storage/el1/bundle/entry/resources/resfile/test.txt , where com.your.example is app bundle name.
To learn more about file paths and URIs in HarmonyOS, see \l{https://developer.huawei.com/consumer/en/doc/harmonyos-guides-V5/app-sandbox-directory-V5} {sandbox documentation}.
For more details and limitations, refer to the \l{https://developer.huawei.com/consumer/en/doc/harmonyos-guides-V14/native-fileshare-guidelines-V14} {API documentation}.
|
strong |
| Enumerator | |
|---|---|
| Read | |
| Write | |
Definition at line 32 of file qohosfileshare_p.h.
|
strong |
| Enumerator | |
|---|---|
| Unknown | |
| PersistenceForbidden | |
| InvalidMode | |
| InvalidPath | |
| PermissionNotPersisted | |
Definition at line 41 of file qohosfileshare_p.h.
| std::shared_ptr< ActionResult > QtOhosAppKit::FileShare::activatePermission | ( | const QList< PathPolicy > & | policies | ) |
Activates file or folder permissions from policies.
The success of the action can be determined from ActionResult.
This function calls \l {https://developer.huawei.com/consumer/en/doc/harmonyos-references-V5/file_share-V5#oh_fileshare_activatepermission} {OH_FileShare_ActivatePermission}. Each time an application is started, its persistent permissions have not been loaded to the memory. Use this function to make a persistent permission active after the application is started. If the activation fails because the permission has not been persisted, use persistPermission() first.
To deactivate an active permission, use deactivatePermission().
Definition at line 563 of file qohosfileshare.cpp.
| std::shared_ptr< CheckResult > QtOhosAppKit::FileShare::checkPersistent | ( | const QList< PathPolicy > & | policies | ) |
Checks if file or folder permissions from policies have persistent permissions.
The result check for each file or folder can be determined from CheckResult. CheckResult::PathPolicyCheckResult::result will be set to true for each file or folder only for succesufull check and persistent permission found, false otherwise.
This function calls \l {https://developer.huawei.com/consumer/en/doc/harmonyos-references-V5/file_share-V5#oh_fileshare_checkpersistentpermission} {OH_FileShare_CheckPersistentPermission}.
To persist permission, use persistPermission().
Definition at line 616 of file qohosfileshare.cpp.
| std::shared_ptr< ActionResult > QtOhosAppKit::FileShare::deactivatePermission | ( | const QList< PathPolicy > & | policies | ) |
Deactivates file or folder permissions from policies.
The success of the action can be determined from ActionResult.
This function calls \l {https://developer.huawei.com/consumer/en/doc/harmonyos-references-V5/file_share-V5#oh_fileshare_deactivatepermission} {OH_FileShare_DeactivatePermission}.
To activate permission, use activatePermission().
Definition at line 589 of file qohosfileshare.cpp.
| std::shared_ptr< ActionResult > QtOhosAppKit::FileShare::persistPermission | ( | const QList< PathPolicy > & | policies | ) |
Persists file or folder permissions from policies.
The success of the action can be determined from ActionResult.
This function calls \l {https://developer.huawei.com/consumer/en/doc/harmonyos-references-V5/file_share-V5#oh_fileshare_persistpermission} {OH_FileShare_PersistPermission}. persistPermission() stores persistence data in the system database. After persistPermission() call, permissions are not yet active. Use activatePermission() to activate permissions. persistPermission() must be called at least once before activatePermission().
To revoke a persistent permission, use revokePermission().
Definition at line 509 of file qohosfileshare.cpp.
| std::shared_ptr< ActionResult > QtOhosAppKit::FileShare::revokePermission | ( | const QList< PathPolicy > & | policies | ) |
Revokes file or folder permissions from policies.
The success of the action can be determined from ActionResult.
This function calls \l {https://developer.huawei.com/consumer/en/doc/harmonyos-references-V5/file_share-V5#oh_fileshare_revokepermission} {OH_FileShare_RevokePermission}.
To persist permission, use persistPermission().
Definition at line 535 of file qohosfileshare.cpp.