aboutsummaryrefslogtreecommitdiff
path: root/works/life/cpp-practicum/Record.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/Record.hpp
parent7e9e803b33a9380d2ff3111c8d11f25f5d2b98ec (diff)
downloadcrupest-e0964bbc4f66e7d193abd249213c9cf762fd0294.tar.gz
crupest-e0964bbc4f66e7d193abd249213c9cf762fd0294.tar.bz2
crupest-e0964bbc4f66e7d193abd249213c9cf762fd0294.zip
import(life): ...
Diffstat (limited to 'works/life/cpp-practicum/Record.hpp')
-rw-r--r--works/life/cpp-practicum/Record.hpp36
1 files changed, 36 insertions, 0 deletions
diff --git a/works/life/cpp-practicum/Record.hpp b/works/life/cpp-practicum/Record.hpp
new file mode 100644
index 0000000..e39e626
--- /dev/null
+++ b/works/life/cpp-practicum/Record.hpp
@@ -0,0 +1,36 @@
+#pragma once
+#include "Base.hpp"
+
+#include "Book.hpp"
+#include "Vendor.hpp"
+
+#include <QFile>
+#include <optional>
+#include <vector>
+
+class Record final {
+public:
+ Record();
+
+ CRU_DEFAULT_COPY(Record);
+ CRU_DEFAULT_MOVE(Record);
+
+ ~Record() = default;
+
+public:
+ void WriteTo(QFile file);
+ void ReadFrom(QFile file);
+
+ const std::vector<Book> &GetBooks() const { return books_; }
+ const std::vector<Vendor> &GetVendors() const { return vendors_; }
+
+ // TODO: Implementation
+ std::optional<Book> FindBookByIsbn(std::u16string_view isbn);
+
+ // TODO: Implementation
+ void RemoveBookByIsbn(std::u16string_view isbn);
+
+private:
+ std::vector<Book> books_;
+ std::vector<Vendor> vendors_;
+};