-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMyShape.cpp
More file actions
45 lines (31 loc) · 743 Bytes
/
Copy pathMyShape.cpp
File metadata and controls
45 lines (31 loc) · 743 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
#include "MyShape.h"
#include <iostream>
Shape::Shape(const Shape& other) {
m_color = other.m_color;
}
Shape::~Shape() {
}
std::ostream& operator<<(std::ostream& out, const Shape& shape) {
shape.print_screen(out);
std::cout << " Area: " <<" " << shape.Area();
return out;
}
std::ofstream& operator<<(std::ofstream& out, const Shape& shape) {
shape.print_file(out);
return out;
}
bool Shape::operator==(const Shape& shape) const {
if (typeid(*this) != typeid(shape)) {
return false; }
else {
return sravnenie_figure(shape);
}
}
std::ifstream& operator>>(std::ifstream& in, Shape& shape) {
shape.read_file(in);
return in;
}
Shape& Shape:: operator=(const Shape& other) {
copy_figure(other);
return *this;
}