• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 提供文件基础操作的能力。
22  * @since 12
23  */
24 
25 /**
26  * @file oh_fileio.h
27  *
28  * @brief fileio模块接口定义,使用fileio提供的native接口,进行文件基础操作。
29  * @library libohfileio.so
30  * @syscap SystemCapability.FileManagement.File.FileIO
31  * @since 12
32  */
33 
34 #include "error_code.h"
35 
36 #ifdef __cplusplus
37 extern "C" {
38 #endif
39 
40 /**
41  * @brief 文件存储位置枚举值。
42  * @since 12
43  */
44 typedef enum FileIO_FileLocation {
45     /**
46      * @brief 文件存储于本地。
47      */
48     LOCAL = 1,
49     /**
50      * @brief 文件存储于云侧。
51      */
52     CLOUD = 2,
53     /**
54      * @brief 文件存储于本地及云侧。
55      */
56     LOCAL_AND_CLOUD = 3
57 } FileIO_FileLocation;
58 
59 /**
60  * @brief 获取文件存储位置。
61  *
62  * @param uri 指向入参uri的指针。
63  * @param uriLength 入参uri字符串的长度。
64  * @param location 输出文件存储位置的指针。
65  * @return 返回FileManageMent模块错误码{@link FileManagement_ErrCode}。
66  * @since 12
67  */
68 FileManagement_ErrCode OH_FileIO_GetFileLocation(char *uri, int uriLength,
69     FileIO_FileLocation *location);
70 
71 #ifdef __cplusplus
72 };
73 #endif
74 
75 #endif // FILE_MANAGEMENT_FILEIO_OH_FILEIO_H