diff options
feat(Week05): Add solutions
1 files changed, 27 insertions, 0 deletions
| -rw-r--r-- | Week05/Exercise02/Text.h | 27 |
diff --git a/Week05/Exercise02/Text.h b/Week05/Exercise02/Text.h new file mode 100644 index 0000000..a1366e0 --- /dev/null +++ b/Week05/Exercise02/Text.h @@ -0,0 +1,27 @@ +#ifndef _TEXT +#define _TEXT + +#include "String.h" + +class Text { + String* lines; + unsigned lineCount; + + void free(); + void copyFrom(const Text& other); + +public: + Text(); + ~Text(); + Text(const Text& other); + Text& operator=(const Text& other); + + Text(Text&& other); + Text& operator=(Text&& other); + + unsigned LineCount() const; + unsigned WordCount() const; + Text SubText(unsigned startLine, unsigned startCol, unsigned endLine, unsigned endCol) const; +}; + +#endif /* _TEXT */ |
