aboutsummaryrefslogtreecommitdiff
path: root/works/life/cpp-practicum/Vendor.hpp
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2020-12-30 15:37:39 +0800
committercrupest <crupest@outlook.com>2020-12-30 15:37:39 +0800
commite0964bbc4f66e7d193abd249213c9cf762fd0294 (patch)
treeee4f5307fc555ef66a3752e20388dca8f386c2f1 /works/life/cpp-practicum/Vendor.hpp
parent7e9e803b33a9380d2ff3111c8d11f25f5d2b98ec (diff)
downloadcrupest-e0964bbc4f66e7d193abd249213c9cf762fd0294.tar.gz
crupest-e0964bbc4f66e7d193abd249213c9cf762fd0294.tar.bz2
crupest-e0964bbc4f66e7d193abd249213c9cf762fd0294.zip
import(life): ...
Diffstat (limited to 'works/life/cpp-practicum/Vendor.hpp')
-rw-r--r--works/life/cpp-practicum/Vendor.hpp45
1 files changed, 45 insertions, 0 deletions
diff --git a/works/life/cpp-practicum/Vendor.hpp b/works/life/cpp-practicum/Vendor.hpp
new file mode 100644
index 0000000..24c22ee
--- /dev/null
+++ b/works/life/cpp-practicum/Vendor.hpp
@@ -0,0 +1,45 @@
+#pragma once
+#include "Base.hpp"
+
+#include <QTextStream>
+#include <string>
+
+class Vendor final {
+public:
+ Vendor() = default;
+ Vendor(int id, std::u16string name, std::u16string type,
+ std::u16string address, std::u16string phone)
+ : id_(id), name_(std::move(name)), type_(std::move(type)),
+ address_(std::move(address)), phone_(std::move(phone)) {}
+
+ CRU_DEFAULT_COPY(Vendor)
+ CRU_DEFAULT_MOVE(Vendor)
+
+ ~Vendor() = default;
+
+public:
+ int GetId() const { return id_; }
+ void SetId(int id) { id_ = id; }
+
+ std::u16string GetName() const { return name_; }
+ void SetName(std::u16string name) { name_ = std::move(name); }
+
+ std::u16string GetType() const { return type_; }
+ void SetType(std::u16string type) { type_ = std::move(type); }
+
+ std::u16string GetAddress() const { return address_; }
+ void SetAddress(std::u16string address) { address_ = std::move(address); }
+
+ std::u16string GetPhone() const { return phone_; }
+ void SetPhone(std::u16string phone) { phone_ = std::move(phone); }
+
+private:
+ int id_;
+ std::u16string name_;
+ std::u16string type_;
+ std::u16string address_;
+ std::u16string phone_;
+};
+
+QTextStream &operator>>(QTextStream &left, Vendor &right);
+QTextStream &operator<<(QTextStream &left, const Vendor &right);