/* automatically generated by rust-bindgen 0.65.1 */

#![allow(non_snake_case)]
#![allow(non_upper_case_globals)]
#![allow(non_camel_case_types)]
#![allow(clippy::missing_safety_doc)]

#[link(name = "ohfileuri")]
unsafe extern "C" {}

#[doc = " operation completed successfully."]
pub const FileManagement_ErrCode_ERR_OK: FileManagement_ErrCode = 0;
#[doc = " permission verification failed."]
pub const FileManagement_ErrCode_ERR_PERMISSION_ERROR: FileManagement_ErrCode = 201;
#[doc = " invalid input parameter."]
pub const FileManagement_ErrCode_ERR_INVALID_PARAMETER: FileManagement_ErrCode = 401;
#[doc = " device not supported."]
pub const FileManagement_ErrCode_ERR_DEVICE_NOT_SUPPORTED: FileManagement_ErrCode = 801;
#[doc = " operation not permitted."]
pub const FileManagement_ErrCode_ERR_EPERM: FileManagement_ErrCode = 13900001;
#[doc = " no such file or directory."]
pub const FileManagement_ErrCode_ERR_ENOENT: FileManagement_ErrCode = 13900002;
#[doc = " out of memory."]
pub const FileManagement_ErrCode_ERR_ENOMEM: FileManagement_ErrCode = 13900011;
#[doc = " unknown error."]
pub const FileManagement_ErrCode_ERR_UNKNOWN: FileManagement_ErrCode = 13900042;
#[doc = " @brief error codes of file management\n @since 12"]
pub type FileManagement_ErrCode = u32;
extern "C" {
    #[doc = " @brief Get uri From path.\n\n @param path Input a pointer to the path string.\n @param length The length of the input path.\n @param result Output a pointer to a uri string. Please use free() to clear the resource.\n @return Returns the status code of the execution.\n         {@link ERR_PARAMS}  401 - Invalid input parameter.\n         {@link ERR_UNKNOWN} 13900042 - Unknow error. The length of the output uri string is 0.\n         {@link ERR_ENOMEM}  13900011 - Failed to apply for memory or failed to copy memory.\n         {@link ERR_OK} 0 - This operation was successfully executed.\n @syscap SystemCapability.FileManagement.AppFileService\n @since 12"]
    pub fn OH_FileUri_GetUriFromPath(
        path: *const ::std::os::raw::c_char,
        length: ::std::os::raw::c_uint,
        result: *mut *mut ::std::os::raw::c_char,
    ) -> FileManagement_ErrCode;
}
extern "C" {
    #[doc = " @brief Get path From uri.\n\n @param uri Input a pointer to the uri string.\n @param length The length of the input uri.\n @param result Output a pointer to a path string. Please use free() to clear the resource.\n @return Returns the status code of the execution.\n         {@link ERR_PARAMS} 401 - Invalid input parameter.\n         {@link ERR_UNKNOWN} 13900042 - Unknow error. The length of the output path string is 0.\n         {@link ERR_ENOMEM} 13900011 - Failed to apply for memory or failed to copy memory.\n         {@link ERR_OK} 0 - This operation was successfully executed.\n @syscap SystemCapability.FileManagement.AppFileService\n @since 12"]
    pub fn OH_FileUri_GetPathFromUri(
        uri: *const ::std::os::raw::c_char,
        length: ::std::os::raw::c_uint,
        result: *mut *mut ::std::os::raw::c_char,
    ) -> FileManagement_ErrCode;
}
extern "C" {
    #[doc = " @brief Gets the uri of the path or directory where the uri is located.\n\n @param uri Input a pointer to the uri string.\n @param length  The length of the input uri.\n @param result Output a pointer to a uri string. Please use free() to clear the resource.\n @return Returns the status code of the execution.\n         {@link ERR_PARAMS} 401 - Invalid input parameter.\n         {@link ERR_ENOMEM} 13900011 - Failed to apply for memory or failed to copy memory.\n         {@link ERR_ENOENT} 13900002 - No such file or directory.\n         {@link ERR_UNKNOWN} - Unknow error. The length of the output path string is 0.\n         {@link ERR_OK} 0 - This operation was successfully executed.\n @syscap SystemCapability.FileManagement.AppFileService\n @since 12"]
    pub fn OH_FileUri_GetFullDirectoryUri(
        uri: *const ::std::os::raw::c_char,
        length: ::std::os::raw::c_uint,
        result: *mut *mut ::std::os::raw::c_char,
    ) -> FileManagement_ErrCode;
}
extern "C" {
    #[doc = " @brief Check that the incoming uri is valid\n\n @param uri Input a pointer to the uri string.\n @param length The length of the input uri.\n @return Returns true: Valid incoming uri, false: Invalid incoming uri.\n @syscap SystemCapability.FileManagement.AppFileService\n @since 12"]
    pub fn OH_FileUri_IsValidUri(
        uri: *const ::std::os::raw::c_char,
        length: ::std::os::raw::c_uint,
    ) -> bool;
}
extern "C" {
    #[cfg(feature = "api-13")]
    #[doc = " @brief Gets the fileName From uri.\n This function obtains that the last segment of the URI string is the return value of the function,\n and the URI of the media type is not supported\n @param uri Input a pointer to the uri string.\n @param length  The length of the input uri.\n @param result Output a pointer to a FileName string. Please use free() to clear the resource.\n @return Returns the status code of the execution.\n         {@link ERR_PARAMS} 401 - Invalid input parameter.\n         {@link ERR_ENOMEM} 13900011 - Failed to apply for memory or failed to copy memory.\n         {@link ERR_OK} 0 - This operation was successfully executed.\n @syscap SystemCapability.FileManagement.AppFileService\n @since 13"]
    pub fn OH_FileUri_GetFileName(
        uri: *const ::std::os::raw::c_char,
        length: ::std::os::raw::c_uint,
        result: *mut *mut ::std::os::raw::c_char,
    ) -> FileManagement_ErrCode;
}
