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