diff --git a/src/lib/file.hpp b/src/lib/file.hpp index 44b3de5..6c08359 100644 --- a/src/lib/file.hpp +++ b/src/lib/file.hpp @@ -45,6 +45,7 @@ class File { void close(); // only applicable to read and edit modes + // moves the cursor to the right of the read section ErrorOr readByte(); ErrorOr> read(uint64_t bytes); // @SodaFountain (or whoever ends up implementing this): @@ -57,20 +58,24 @@ class File { // only applicable to write, modify, append, and edit modes // in modify and edit modes, overwrite whatever is at the // cursor position if there is anything there + // moves the cursor to the right of the written section ErrorOrVoid writeByte(uint8_t byte); ErrorOrVoid write(std::vector data); ErrorOrVoid writeString(tiny_utf8::string string); // only applicable to modify and edit modes // insert at cursor position and move other contents to the right + // moves the cursor to the right of the inserted section ErrorOrVoid insertByte(uint8_t byte); ErrorOrVoid insert(std::vector data); ErrorOrVoid insertString(tiny_utf8::string string); // only applicable to edit mode // return the cut section, remove cut section from file - ErrorOr> cut(uint64_t start, uint64_t end); - ErrorOr cutString(uint64_t start, uint64_t end); + // moves the cursor to the right of where it happened + ErrorOr cutByte(); + ErrorOr> cut(uint64_t length); + ErrorOr cutString(uint64_t length); // modes: // r (read)