-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPacketTypes.h
More file actions
67 lines (56 loc) · 1.39 KB
/
PacketTypes.h
File metadata and controls
67 lines (56 loc) · 1.39 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
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 H_PACKETTYPES
#define H_PACKETTYPES
#include <vector>
#include <string>
#include "Packet.h"
class Engine;
//used to tell the listener or reader that this stream has been closed
class Packet_Closed : public Packet //1
{
public:
Packet_Closed(TCPStream* stream);
Packet_Closed();
~Packet_Closed();
};
//writes a file
class Packet_WriteFile : public Packet //2
{
private:
std::string path;
char* filedata;
unsigned int filedatalen;
public:
Packet_WriteFile(TCPStream* stream); //read from socket constructor
Packet_WriteFile(std::string path, char* data, unsigned int length); //going to be sent on socket constructor
~Packet_WriteFile();
char* toByteArray();
bool read();
void exicute(Engine* engine);
};
//delete file
class Packet_DeletePath : public Packet //3
{
private:
std::string path;
public:
Packet_DeletePath(TCPStream* stream);
Packet_DeletePath(std::string path);
~Packet_DeletePath();
char* toByteArray();
bool read();
void exicute(Engine* engine);
};
//delete directory
class Packet_DeleteDir : public Packet //4
{
private:
std::string path;
public:
Packet_DeleteDir(TCPStream* stream);
Packet_DeleteDir(std::string path);
~Packet_DeleteDir();
char* toByteArray();
bool read();
void exicute(Engine* engine);
};
#endif