aboutsummaryrefslogtreecommitdiff
path: root/week07/Exercise5.h
diff options
context:
space:
mode:
Diffstat (limited to 'week07/Exercise5.h')
-rw-r--r--week07/Exercise5.h26
1 files changed, 26 insertions, 0 deletions
diff --git a/week07/Exercise5.h b/week07/Exercise5.h
new file mode 100644
index 0000000..f588efa
--- /dev/null
+++ b/week07/Exercise5.h
@@ -0,0 +1,26 @@
+class TransportTicket {
+ unsigned id;
+ char* source;
+ char* destination;
+ float price;
+
+ void free();
+ void copyFrom(const TransportTicket& other);
+
+public:
+ TransportTicket(unsigned id, const char* source, const char* destination, float price);
+ void Print();
+
+ TransportTicket();
+ ~TransportTicket();
+ TransportTicket(const TransportTicket& other);
+ TransportTicket& operator=(const TransportTicket& other);
+ TransportTicket(TransportTicket&& other);
+ TransportTicket& operator=(TransportTicket&& other);
+
+ void SaveText(const char* fileName);
+ void LoadText(const char* fileName);
+
+ void SaveBinary(const char* fileName);
+ void LoadBinary(const char* fileName);
+};