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 * @brief This module provides the basic file operations. 20 * @since 12 21 */ 22 23 /** 24 * @file oh_fileio.h 25 * @kit CoreFileKit 26 * 27 * @brief Provide fileio APIS. 28 * @library libohfileio.so 29 * @syscap SystemCapability.FileManagement.File.FileIO 30 * @since 12 31 */ 32 33 #ifndef FILE_MANAGEMENT_FILEIO_OH_FILEIO_H 34 #define FILE_MANAGEMENT_FILEIO_OH_FILEIO_H 35 36 #include "error_code.h" 37 38 #ifdef __cplusplus 39 extern "C" { 40 #endif 41 42 /** 43 * @brief Enumerates the file location. 44 * @since 12 45 */ 46 typedef enum FileIO_FileLocation { 47 /** 48 * @brief Indicates the file located on the local. 49 */ 50 LOCAL = 1, 51 /** 52 * @brief Indicates the file located on the cloud. 53 */ 54 CLOUD = 2, 55 /** 56 * @brief Indicates the file located on the local and cloud. 57 */ 58 LOCAL_AND_CLOUD = 3 59 } FileIO_FileLocation; 60 61 /** 62 * @brief Get the file location. 63 * 64 * @param uri Input a pointer to a uri. 65 * @param uriLength Input the length of the uri. 66 * @param location Output the result of file location. 67 * @return Return the status code of the execution. 68 * {@link PARAMETER_ERROR} 401 - Invalid input parameter, pointer is null. 69 * {@link E_NONET} 13900002 - No such file or directory. 70 * {@link E_NOMEM} 13900011 - Failed to apply for memory. 71 * @since 12 72 */ 73 FileManagement_ErrCode OH_FileIO_GetFileLocation(char *uri, int uriLength, 74 FileIO_FileLocation *location); 75 76 #ifdef __cplusplus 77 }; 78 #endif 79 80 #endif //FILE_MANAGEMENT_FILEIO_OH_FILEIO_H 81