Newer
Older

Debora
committed
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#include <iostream>
#include <string>
#include "reptilexotico.h"
#define CARACTER_SEPARADOR ';'
#include <fstream>
using namespace std;
/**
* @brief Sobrecarga do operador de extração para animal do tipo ReptilExotico
* @param input - strem de entrada
* repexo - Objeto do tipo ReptilExotico
*
*/
std::istream& operator>> (std::istream &input, ReptilExotico &repexo){
string aux;
getline (input,aux,CARACTER_SEPARADOR);
id = atoi(aux.c_str());
getline (input,aux,CARACTER_SEPARADOR);
repexo.nome = atoi(aux.c_str());
getline (input,aux,CARACTER_SEPARADOR);
repexo.classe = aux;
getline (input,aux,CARACTER_SEPARADOR);
repexo.cientifico = aux;
getline (input,aux,CARACTER_SEPARADOR);
repexo.sexo = aux;
getline (input,aux,CARACTER_SEPARADOR);
repexo.tamanho = atoi(aux.c_str());
getline (input,aux,CARACTER_SEPARADOR);
repexo.dieta = aux;
getline (input,aux,CARACTER_SEPARADOR);
repexo.batismo = aux ;
getline (input,aux,CARACTER_SEPARADOR);
repexo.veterinario->id = atoi(aux.c_str());
getline (input,aux,CARACTER_SEPARADOR);
repexo.tratador->id = atoi(aux.c_str());
getline (input,aux,CARACTER_SEPARADOR);
repexo.venenoso = aux;
getline (input,aux,CARACTER_SEPARADOR);
repexo.tipo_veneno = aux;
getline (input,aux,CARACTER_SEPARADOR);
repexo.ibama = aux;
getline (input,aux);
repexo.pais_origem = aux;
return input;
}
/**
* @brief Construtor cria um animal do tipo ReptilExotico, que toma Reptil e AnimalExotico como classe pai a herdar seus atributos
* @param identity - ID, clas - classe do animal, name - nome do animal, scientific - nome científico do animal,
* sex - sexo do animal, size - tamanho do animal, diet - dieta do animal,
* baptism - nome de batismo do animal, vet - veterinário associado ao animal,
* caretaker - tratador associado ao animal, isPoisonous - estado de ter veneno, poison_type - tipo de veneno
biernr - ibama, origin_country - pais de origem de animal
*/
ReptilExotico::ReptilExotico(int identity, string clas, string name, string scientific, char sex, float size,
string diet, string baptism, Veterinario* vet, Tratador* caretaker,
string isPoisonous, string poison_type, string biernr, string origin_country):
Reptil(identity, clas, name, scientific, sex, size, diet, baptism, vet, caretaker, isPoisonous, poison_type),
AnimalExotico(biernr, origin_country)
{}
ReptilExotico::~ReptilExotico(){
}
}