-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProxy.h
More file actions
39 lines (33 loc) · 1 KB
/
Proxy.h
File metadata and controls
39 lines (33 loc) · 1 KB
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
#pragma once
#include "AbstractFile.h"
class SymblicLink;
class Proxy: public AbstractFile
{
friend class SymbolicLink;
public:
// functions regarding files functionality
Proxy(AbstractFile* af);
Proxy(Proxy* pf);
virtual std::vector<char> read();
virtual int write(std::vector<char>); // re-writes file
virtual int append(std::vector<char>); // appends to current contents
virtual unsigned int getSize();
virtual std::string getName();
virtual ~Proxy();
// visitor pattern function
virtual void accept(AbstractFileVisitor*);
virtual Proxy* clone();
protected:
// composite pattern functions, should only be used by file system objects or command objects which should be friended
virtual int addChild(AbstractFile*);
virtual int removeChild(std::string name);
virtual void setParent(AbstractFile*);
virtual AbstractFile* getChild(std::string name);
virtual AbstractFile* getParent();
virtual int* getCount();
AbstractFile* file;
int* count;
private:
std::string name;
AbstractFile* parent;
};