-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCliInterface.h
41 lines (32 loc) · 1.09 KB
/
CliInterface.h
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
//
// Created by john on 6/7/18.
//
#ifndef TIN_INTERFACE_H
#define TIN_INTERFACE_H
#include <stdio.h>
#include <stdlib.h>
#include <iostream>
#include <unistd.h>
#include <errno.h>
#include <cstring>
#include <string>
#include <netdb.h>
#include <sys/types.h>
#include <netinet/in.h>
#include <sys/socket.h>
#include <arpa/inet.h>
class CliInterface {
public:
void startInterface();
int discover(); //shows other hosts
std::string ls(std::string hash); // shows files in the filesystem based on given hash
int lsh(); // shows all hashes
void create(); // starts interactive communication with the user
void cd(std::string path); //open a folder based on given path in create mode
std::string mkdir(std::string name); //makes new folder in create mode
void touch(std::string name); //makes new text file in create mode
void publish(); //publishes changes in create mode
void search(std::string hash); //starts broadcast in order to find given hash in ipfs
void download(std::string hash); // starts downloading based on given hash
};
#endif //TIN_INTERFACE_H