summaryrefslogtreecommitdiff
path: root/libfusepp/fuseapp.h
blob: 1c94f13667a795c0324cbc714d39092c23cd6710 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#ifndef FUSEAPP_H
#define FUSEAPP_H

#define FUSE_USE_VERSION 26
#include <fuse.h>
#include <exception>

class FuseAppBase {
	public:
		FuseAppBase();
		virtual ~FuseAppBase() = 0;
		virtual void * init (struct fuse_conn_info * info);
		virtual int opt_parse(void *, const char * arg, int key, struct fuse_args *);
		virtual int access(const char *, int);
		virtual int chmod(const char *, mode_t);
		virtual int chown(const char *, uid_t, gid_t);
		virtual int create(const char *, mode_t, struct fuse_file_info *);
		virtual int fgetattr(const char *, struct stat *, struct fuse_file_info *);
		virtual int flush(const char *, struct fuse_file_info *);
		virtual int fsync(const char *, int, struct fuse_file_info *);
		virtual int fsyncdir(const char *, int, struct fuse_file_info *);
		virtual int ftruncate(const char *, off_t, struct fuse_file_info *);
		virtual int getattr(const char *, struct stat *);
		virtual int getxattr(const char *, const char *, char *, size_t);
		virtual int link(const char *, const char *);
		virtual int listxattr(const char *, char *, size_t);
		virtual int mkdir(const char *, mode_t);
		virtual int mknod(const char *, mode_t, dev_t);
		virtual int open(const char *, struct fuse_file_info *);
		virtual int opendir(const char *, struct fuse_file_info *);
		virtual int read(const char *, char *, size_t, off_t, struct fuse_file_info *);
		virtual int readdir(const char *, void *, fuse_fill_dir_t, off_t, struct fuse_file_info *);
		virtual int readlink(const char *, char *, size_t);
		virtual int release(const char *, struct fuse_file_info *);
		virtual int releasedir(const char *, struct fuse_file_info *);
		virtual int removexattr(const char *, const char *);
		virtual int rename(const char *, const char *);
		virtual int rmdir(const char *);
		virtual int setxattr(const char *, const char *, const char *, size_t, int);
		virtual int statfs(const char *, struct statvfs *);
		virtual int symlink(const char *, const char *);
		virtual int truncate(const char *, off_t);
		virtual int unlink(const char *);
		virtual int write(const char *, const char *, size_t, off_t, struct fuse_file_info *);
		virtual int lock(const char *, struct fuse_file_info *, int cmd, struct flock *);
		virtual int utimens(const char *, const struct timespec tv[2]);
		virtual int bmap(const char *, size_t blocksize, uint64_t *idx);
		virtual int ioctl(const char *, int cmd, void *arg, struct fuse_file_info *, unsigned int flags, void * data);
		virtual int poll(const char *, struct fuse_file_info *, struct fuse_pollhandle *, unsigned *);
		virtual int write_buf (const char *, struct fuse_bufvec *buf, off_t off, struct fuse_file_info *);
		virtual int read_buf (const char *, struct fuse_bufvec **bufp, size_t size, off_t off, struct fuse_file_info *);
		virtual int flock (const char *, struct fuse_file_info *, int op);
		virtual int onError(const std::exception & err) throw();

		static int run(int &, char ** &, FuseAppBase *);
};

#endif