-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathShowPersons.hpp
More file actions
24 lines (20 loc) · 796 Bytes
/
ShowPersons.hpp
File metadata and controls
24 lines (20 loc) · 796 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
#pragma once
#include "Command.hpp"
#include "ValidationData.hpp"
#include <memory>
#include <string>
class ShowPersons : public Command {
public:
ShowPersons();
ShowPersons(std::shared_ptr<ValidationData> validation);
ShowPersons(std::vector<std::shared_ptr<Person>>& person);
~ShowPersons() = default;
void operator()(std::vector<std::shared_ptr<Person>>& person) override;
private:
std::string generateSingleRecord(const std::string& singleRecord, int cellSize);
std::string generateSingleRecordLine(Person* singlePerson, size_t personIndex);
void printSeparateLine(int tableSize);
void generateAllRecord(std::vector<std::shared_ptr<Person>>& person);
std::shared_ptr<ValidationData>validation_;
std::vector<std::shared_ptr<Person>> persons_;
};