1 /* 2 * Copyright (c) 2024 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16 /** 17 * @addtogroup FileIO 18 * @{ 19 * 20 * @brief This module provides the basic file operations. 21 * @since 12 22 */ 23 24 /** 25 * @file oh_fileio.h 26 * @kit CoreFileKit 27 * 28 * @brief Provide fileio APIS. 29 * @library libohfileio.so 30 * @syscap SystemCapability.FileManagement.File.FileIO 31 * @since 12 32 */ 33 34 #ifndef FILE_MANAGEMENT_FILEIO_OH_FILEIO_H 35 #define FILE_MANAGEMENT_FILEIO_OH_FILEIO_H 36 37 #include "error_code.h" 38 39 #ifdef __cplusplus 40 extern "C" { 41 #endif 42 43 /** 44 * @brief Enumerates the file location. 45 * @since 12 46 */ 47 typedef enum FileIO_FileLocation { 48 /** 49 * @brief Indicates the file located on the local. 50 */ 51 LOCAL = 1, 52 /** 53 * @brief Indicates the file located on the cloud. 54 */ 55 CLOUD = 2, 56 /** 57 * @brief Indicates the file located on the local and cloud. 58 */ 59 LOCAL_AND_CLOUD = 3 60 } FileIO_FileLocation; 61 62 /** 63 * @brief Get the file location. 64 * 65 * @param uri Input a pointer to a uri. 66 * @param uriLength Input the length of the uri. 67 * @param location Output the result of file location. 68 * @return Return the status code of the execution. 69 * {@link PARAMETER_ERROR} 401 - Invalid input parameter, pointer is null. 70 * {@link E_NONET} 13900002 - No such file or directory. 71 * {@link E_NOMEM} 13900011 - Failed to apply for memory. 72 * @since 12 73 */ 74 FileManagement_ErrCode OH_FileIO_GetFileLocation(char *uri, int uriLength, 75 FileIO_FileLocation *location); 76 77 #ifdef __cplusplus 78 }; 79 #endif 80 81 #endif //FILE_MANAGEMENT_FILEIO_OH_FILEIO_H 82 /** @} */ 83