new tree file format

This commit is contained in:
vrd
2023-02-21 22:35:45 +02:00
parent ee152edbad
commit 78408bd223
11 changed files with 286 additions and 77 deletions
+27 -23
View File
@@ -2,6 +2,7 @@
#include <iostream>
#include "tree.hpp"
#include "utils.hpp"
#include "parser.hpp"
/* using std::cin; */
@@ -10,27 +11,30 @@ int main(int argc, char* argv[])
{
init();
auto f = mapfile("example_tree.tft");
parseTftFile(f).display();
Tree test1("Dechkovi");
test1.loadFromFile();
/* test1.addPerson("Rumen", true, Nobody, Nobody, {1968, 8, 9}); */
/* test1.addPerson("Nadejda", false, Nobody, Nobody, {1972, 12, 15}); */
/* test1.addPerson("Rumen", M, Nobody, Nobody, {1968, 8, 9}); */
/* test1.addPerson("Nadejda", F, Nobody, Nobody, {1972, 12, 15}); */
/* test1.addRelation(0, Spouse, 1); */
/* test1.addPerson("Venelin", true, 0, 1, {1998, 6, 9}); */
/* test1.addPerson("Vasil", true, 0, 1, {2001, 1, 16}); */
/* test1.addPerson("Venelin", M, 0, 1, {1998, 6, 9}); */
/* test1.addPerson("Vasil", M, 0, 1, {2001, 1, 16}); */
/* test1.saveToFile(); */
Tree test2("Karamanovi");
test2.addPerson("Vasil Dimitrov", true, Nobody, Nobody, {1941, 5, 18});
test2.addPerson("Maria", false);
test2.addPerson("Vasil Dimitrov", M, Nobody, Nobody, {1941, 5, 18});
test2.addPerson("Maria", F);
test2.addRelation(0, Spouse, 1);
test2.addPerson("Dimitar", true, 0, 1);
test2.addPerson("Nadejda", false, 0, 1, {1972, 12, 15});
test2.addPerson("Branimira", false);
test2.addPerson("Dimitar", M, 0, 1);
test2.addPerson("Nadejda", F, 0, 1, {1972, 12, 15});
test2.addPerson("Branimira", F);
test2.addRelation(2, Spouse, 4);
test2.addPerson("Ioan", true, 2, 4);
test2.addPerson("Rumiana", false, 2, 4);
test2.addPerson("Ioan", M, 2, 4);
test2.addPerson("Rumiana", F, 2, 4);
test1.display();
test2.display();
@@ -38,25 +42,25 @@ int main(int argc, char* argv[])
(test2 + test1).display();
/* Tree firstTree("firstTree"); */
/* firstTree.addPerson("Адам", true, Nobody, Nobody, {0, 1, 6}); */
/* firstTree.addPerson("Ева", false, Nobody, Nobody, {0, 1, 6}); */
/* firstTree.addPerson("Адам", M, Nobody, Nobody, {0, 1, 6}); */
/* firstTree.addPerson("Ева", F, Nobody, Nobody, {0, 1, 6}); */
/* firstTree.addRelation(0, Spouse, 1); */
/* firstTree.addPerson("Кайн", true, 0, 1); */
/* firstTree.addPerson("Кайн", M, 0, 1); */
/* firstTree.addPerson("Авел", true, 0, 1); */
/* firstTree.addPerson("Авел", M, 0, 1); */
/* firstTree.addRelation(2, Sibling, 3); */
/* firstTree.addPerson("Сит", true, 0, 1, 230); */
/* firstTree.addPerson("Сит", M, 0, 1, 230); */
/* firstTree.addRelation(2, Sibling, 4); */
/* firstTree.addPerson("Енос", true, 4, Nobody, 435); */
/* firstTree.addPerson("Каинан", true, 5 , Nobody, 605); */
/* firstTree.addPerson("Малелеил", true, 6, Nobody, 605); */
/* firstTree.addPerson("Енос", M, 4, Nobody, 435); */
/* firstTree.addPerson("Каинан", M, 5 , Nobody, 605); */
/* firstTree.addPerson("Малелеил", M, 6, Nobody, 605); */
/* firstTree.addPerson("Енох", true, 3 , Nobody); */
/* firstTree.addPerson("Гаидад", true, 8 , Nobody); */
/* firstTree.addPerson("Малелеил", true, 9, Nobody); */
/* firstTree.addPerson("Енох", M, 3 , Nobody); */
/* firstTree.addPerson("Гаидад", M, 8 , Nobody); */
/* firstTree.addPerson("Малелеил", M, 9, Nobody); */
/* firstTree.print(); */
@@ -70,7 +74,7 @@ int main(int argc, char* argv[])
/* std::vector<Tree> trees; */
/* bool quit = false; */
/* bool quit = F; */
/* char input[128]; */
/* short i; //Number of the entered command */
/* const short numCom = 24; */