fix save and load
This commit is contained in:
@@ -44,7 +44,7 @@ public:
|
||||
|
||||
void rename(const char* newName);
|
||||
|
||||
person_id findId(const char*, short year=0, const unsigned char month=0, const unsigned char day=0) const;
|
||||
person_id findId(const char* name, bool=true) const;
|
||||
person_id findOldestAncestor(person_id id, bool sex = 0) const;//
|
||||
//oldest common ancestor ID, a person is considerd an ancestor of himself
|
||||
person_id findCommonAncestor(person_id firstId, person_id secondId) const;
|
||||
@@ -53,22 +53,22 @@ public:
|
||||
person_id findSpouse(person_id person) const;
|
||||
std::vector<person_id> findChildren(person_id person) const;
|
||||
|
||||
void saveTree()const;//
|
||||
bool loadTree();
|
||||
void saveToFile()const;//
|
||||
bool loadFromFile();
|
||||
|
||||
void addPerson(const char* name, bool isMale, person_id father=Nobody, person_id mother=Nobody, EventTime birth={}, EventTime death={});
|
||||
bool addRelation(const char* firstName, RelType, const char* secondName); //Adds a new relation or edits an old one. 0 - failure 1 - success
|
||||
bool addRelation(person_id firstId, RelType, person_id secondId, bool opposite=0); //0 - failure 1 - success
|
||||
|
||||
void removePerson(person_id id); //Removes a member and the last one takes his ID
|
||||
void removePerson(const char*, short year = 0, const unsigned char month = 0, const unsigned char day = 0);
|
||||
/* void removePerson(const char*, short year = 0, const unsigned char month = 0, const unsigned char day = 0); */
|
||||
void removeRelation(person_id firstId, person_id secondId);
|
||||
void removeRelation(const char* firstName, const char* secondName);
|
||||
|
||||
void display();
|
||||
|
||||
void print()const;
|
||||
void printRel(person_id id)const; //Prints out close relatives
|
||||
/* void printRel(person_id id)const; //Prints out close relatives */
|
||||
void printMember(person_id id)const;
|
||||
void printOldestAncestors(person_id id)const;//
|
||||
|
||||
@@ -89,7 +89,7 @@ private:
|
||||
void selectLeftSibSpouse(person_id person);
|
||||
void selectRightSib(person_id person);
|
||||
|
||||
std::string treeName = "Unnamed";
|
||||
std::string treeName;
|
||||
unsigned numPeople = 0;
|
||||
std::vector<Person> people; //The data for each member
|
||||
std::vector<std::vector<Relation>> relations; //The relatives of each member
|
||||
|
||||
Reference in New Issue
Block a user