Update ZIP logic to include and detect directory entries. Fixes 289.

This commit is contained in:
J-D-K
2025-09-08 12:51:15 -04:00
parent 1095971895
commit 8b72f08dcc
7 changed files with 48 additions and 26 deletions

View File

@@ -41,6 +41,9 @@ namespace fs
/// @brief Reads from the currently open file to the buffer passed.
ssize_t read(void *buffer, size_t bufferSize);
/// @brief Returns if the entry is just a directory.
bool is_directory() const noexcept;
/// @brief Returns the name of the current file.
const char *get_filename() const noexcept;

View File

@@ -28,6 +28,10 @@ namespace fs
/// @brief Manual call for closing the zipFile.
void close();
/// @brief Creates a new dummy directory entry in the ZIP.
/// @param Path Path of the directory. Will be appended with a trailing slash if needed.
void add_directory(std::string_view path);
/// @brief Opens a new file with filename as the path.
bool open_new_file(std::string_view filename, bool trimPath = false, size_t trimPlaces = 0);