1 /*
2  * Copyright (c) 2023-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 CLOUD_FILE_DAEMON_FILE_OPERATIONS_CLOUD_H
16 #define CLOUD_FILE_DAEMON_FILE_OPERATIONS_CLOUD_H
17 
18 #include "file_operations_base.h"
19 
20 namespace OHOS {
21 namespace FileManagement {
22 namespace CloudDisk {
23 class FileOperationsCloud final : public FileOperationsBase {
24 public:
25     void Lookup(fuse_req_t req, fuse_ino_t parent, const char *name) override;
26     void Access(fuse_req_t req, fuse_ino_t ino, int mask) override;
27     void GetAttr(fuse_req_t req, fuse_ino_t ino, struct fuse_file_info *fi) override;
28     void Open(fuse_req_t req, fuse_ino_t ino, struct fuse_file_info *fi) override;
29     void MkDir(fuse_req_t req, fuse_ino_t parent, const char *name, mode_t mode) override;
30     void RmDir(fuse_req_t req, fuse_ino_t parent, const char *name) override;
31     void Unlink(fuse_req_t req, fuse_ino_t parent, const char *name) override;
32     void Release(fuse_req_t req, fuse_ino_t ino, struct fuse_file_info *fi) override;
33     void MkNod(fuse_req_t req, fuse_ino_t parent, const char *name,
34                mode_t mode, dev_t rdev) override;
35     void Create(fuse_req_t req, fuse_ino_t parent, const char *name,
36                 mode_t mode, struct fuse_file_info *fi) override;
37     void ReadDir(fuse_req_t req, fuse_ino_t ino, size_t size, off_t off,
38                  struct fuse_file_info *fi) override;
39     void SetXattr(fuse_req_t req, fuse_ino_t ino, const char *name,
40                   const char *value, size_t size, int flags) override;
41     void GetXattr(fuse_req_t req, fuse_ino_t ino, const char *name,
42                   size_t size) override;
43     void Rename(fuse_req_t req, fuse_ino_t parent, const char *name,
44                 fuse_ino_t newParent, const char *newName, unsigned int flags) override;
45     void Read(fuse_req_t req, fuse_ino_t ino, size_t size,
46               off_t offset, struct fuse_file_info *fi) override;
47     void WriteBuf(fuse_req_t req, fuse_ino_t ino, struct fuse_bufvec *bufv,
48                   off_t off, struct fuse_file_info *fi) override;
49     void SetAttr(fuse_req_t req, fuse_ino_t ino, struct stat *attr,
50                  int valid, struct fuse_file_info *fi) override;
51     void Lseek(fuse_req_t req, fuse_ino_t ino, off_t off, int whence,
52                struct fuse_file_info *fi) override;
53 };
54 } // namespace CloudDisk
55 } // namespace FileManagement
56 } // namespace OHOS
57 #endif // CLOUD_FILE_DAEMON_FILE_OPERATIONS_CLOUD_H
58