-
Notifications
You must be signed in to change notification settings - Fork 0
/
fuse-7z.hpp
67 lines (55 loc) · 1.23 KB
/
fuse-7z.hpp
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
60
61
62
63
64
65
66
67
#ifndef FUSE_7ZIP_H
#define FUSE_7ZIP_H
#include <stdint.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <ctime>
#include <cstring>
#include <cstdlib>
#include <vector>
#include <string>
#include <list>
#include <sstream>
#include <iostream>
#ifdef _LFS_LARGEFILE
typedef off64_t offset_t;
#else
typedef off_t offset_t;
#endif
class Node;
class Fuse7z;
class BigBuffer;
extern class Logger {
public:
std::stringstream ss;
Logger();
~Logger();
void logger(std::string const & text);
void err(std::string const & text);
template<typename T>
inline Logger & operator<<(T const & data) {
ss << data;
return *this;
}
static Logger &endl(Logger &f);
typedef Logger& (*LoggerManipulator)(Logger&);
Logger& operator<<(LoggerManipulator manip)
{
return manip(*this);
}
} logger;
class Fuse7z {
private:
public:
std::string const archive_fn;
std::string const cwd;
Node * root_node;
public:
Fuse7z(std::string const & filename, std::string const & cwd);
virtual ~Fuse7z();
virtual void open(char const * path, Node * n) = 0;
virtual void close(char const * path, Node * n) = 0;
virtual int read(char const * path, Node * node, char * buf, size_t size, off_t offset) = 0;
};
#endif // FUSE_7ZIP_H