diff options
Diffstat (limited to 'week12/Exercise1/TextDocument.h')
| -rw-r--r-- | week12/Exercise1/TextDocument.h | 20 |
1 files changed, 20 insertions, 0 deletions
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 <iostream> + +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); +}; |
