diff options
Made naming and slight formatting adjustments
1 files changed, 29 insertions, 0 deletions
| -rw-r--r-- | Year 1/Object-oriented Programming/Solutions Sem. 03/ex4/HexEditor.h | 29 |
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 <iostream> +#include <fstream> +#include <cstring> +#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; +}; |
