From a6fb61db10a93801065d34d19fb6d7166511e58d Mon Sep 17 00:00:00 2001 From: Syndamia Date: Thu, 31 Mar 2022 09:37:42 +0300 Subject: Made naming and slight formatting adjustments --- .../Solutions Sem. 03/ex4/HexEditor.h | 29 ++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 Year 1/Object-oriented Programming/Solutions Sem. 03/ex4/HexEditor.h (limited to 'Year 1/Object-oriented Programming/Solutions Sem. 03/ex4/HexEditor.h') diff --git a/Year 1/Object-oriented Programming/Solutions Sem. 03/ex4/HexEditor.h b/Year 1/Object-oriented Programming/Solutions Sem. 03/ex4/HexEditor.h new file mode 100644 index 0000000..aa56041 --- /dev/null +++ b/Year 1/Object-oriented Programming/Solutions Sem. 03/ex4/HexEditor.h @@ -0,0 +1,29 @@ +#include +#include +#include +#pragma warning(disable:4996) + +#include "Bytex.h" + +class HexEditor { + Bytex* fileBuffer; + size_t count; + size_t length; + + char* originalFilePath; // There are no actual restrictions on path lengths in Linux + + char bytexToReadableChar(const Bytex& bytex) const; + void resizeBuffer(); + +public: + HexEditor(const char* filePath); + ~HexEditor(); + + void change(size_t index, const Bytex& bytex); + void add(const Bytex& bytex); + void remove(); + + void viewFile() const; + void save() const; + void saveAs(const char* filePath) const; +}; -- cgit v1.3.1-26-gb76a