From 8dd9b39fa54a91030cdd5fe71973f78f7e8089e0 Mon Sep 17 00:00:00 2001 From: Syndamia Date: Fri, 10 May 2024 11:33:50 +0300 Subject: [w12] Solved exercises 1 and 3 --- week12/Exercise1/TextDocument.h | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 week12/Exercise1/TextDocument.h (limited to 'week12/Exercise1/TextDocument.h') diff --git a/week12/Exercise1/TextDocument.h b/week12/Exercise1/TextDocument.h new file mode 100644 index 0000000..cda1a32 --- /dev/null +++ b/week12/Exercise1/TextDocument.h @@ -0,0 +1,20 @@ +#pragma once +#include + +class TextDocument { + char* text; + unsigned len; + + void free(); + void copyFrom(const TextDocument& other); + +public: + TextDocument(); + ~TextDocument(); + TextDocument(const TextDocument& other); + TextDocument& operator=(const TextDocument& other); + TextDocument(TextDocument&& other); + TextDocument& operator=(TextDocument&& other); + + friend std::ostream& operator<<(std::ostream& ostr, const TextDocument& other); +}; -- cgit v1.2.3