-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathEdgesList.h
52 lines (41 loc) · 1.25 KB
/
EdgesList.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
42
43
44
45
46
47
48
49
50
51
52
/**
Класс списка.
*/
#pragma once
#include <fstream>
#include <sstream>
#include "Constants.h"
#include "Edge.h"
using namespace std;
class EdgesList
{
public:
EdgesList();
~EdgesList();
unsigned int getSize();
Edge* getElement(string temp);
Edge* getElement(size_t index);
void pushStart(string edgeName, string system, string country, double height);
//void pushMiddle(string edgeName, string system, string country, double height);
void pushEnd(string edgeName, string system, string country, double height);
//void edit(string temp, string edgeName, string system, string country, double height);
void remove(string edge);
void cleanList(bool cleanFile, string fileName);
//bool printEdge(string edgeName);
void sort(string fileName, size_t mode, bool ascending);
void definePosition(Edge* elementArg, size_t mode);
void reverse();
void printCountry(string country);
void printList();
bool writeToFile(string fileName);
bool readFromFile(string fileName);
private:
string delimiter = "(<=@@=>)";
Constants constants;
ifstream fileIn;
ofstream fileOut;
string inOutBuff; // Будем считать это разновидностью буфера.
Edge* head, * tail;
size_t mSize;
void pushEndInner(Edge* elementArg);
};