-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
49 lines (31 loc) · 812 Bytes
/
Copy pathmain.cpp
File metadata and controls
49 lines (31 loc) · 812 Bytes
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
#include <iostream>
#include <vector>
#include <string>
#include "datatxt.h"
int main() {
DataTXT bd("data.txt");
std::vector<std::string> dados = {"name", "age", "job"}, lista;
bd.setParameter(dados);
bd.add({"Robert","40","Teacher"});
bd.add({"Rock","35","Musician"});
bd.add({"Steave","20","Driver"});
bd.add({"Pocketnaro","60","Prisoner"});
lista = bd.list();
for(auto i: lista){
std::cout<<i<<std::endl;
}
std::cout<<"\n"<<std::endl;
bd.remove({"Steave","20","Driver"});
lista = bd.list();
for(auto i: lista){
std::cout<<i<<std::endl;
}
std::cout<<"\n"<<std::endl;
bd.update({"Pocketnaro","60","Prisoner"},{"Squead","75","President"});
lista = bd.list();
for(auto i: lista){
std::cout<<i<<std::endl;
}
std::cout<<"\n"<<std::endl;
return 0;
}