diff options
author | crupest <crupest@outlook.com> | 2020-12-30 15:37:39 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2020-12-30 15:37:39 +0800 |
commit | 10e880b508bcb81473aff034ab9497e0bebeb112 (patch) | |
tree | 5d618688ef09d7b5788d1f2c496e63d28a7e6ec6 /cpp-practicum/Record.hpp | |
parent | 2c0be3fba23ab11b6ee27ae6903ffdbc1a2a8230 (diff) | |
download | life-10e880b508bcb81473aff034ab9497e0bebeb112.tar.gz life-10e880b508bcb81473aff034ab9497e0bebeb112.tar.bz2 life-10e880b508bcb81473aff034ab9497e0bebeb112.zip |
...
Diffstat (limited to 'cpp-practicum/Record.hpp')
-rw-r--r-- | cpp-practicum/Record.hpp | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/cpp-practicum/Record.hpp b/cpp-practicum/Record.hpp new file mode 100644 index 0000000..e39e626 --- /dev/null +++ b/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_;
+};
|