Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(file_system): Allow single entry to string function #337

Merged
merged 1 commit into from
Oct 21, 2024

Conversation

finger563
Copy link
Contributor

Description

  • add espp::FileSystem::file_entry_string(std::filesystem::path &path, const ListConfig &config, const std::string &prefix="") method for external use
  • refactor espp::FileSystem::list_directory(...) to use espp::FileSystem::file_entry_string(...) function
  • Add file system PC test to ensure host-side / non ESP_PLATFORM code paths work just as well

Motivation and Context

  • Enables wider use-cases for the file system API
  • Allows simpler testing of file system changes on a host PC using the library

How has this been tested?

  • Building and running the file_system/example on a QtPy ESP32S3
  • Building the x-plat library, building the new pc/tests/file_system.cpp test and running it on MacOS

Screenshots (if appropriate, e.g. schematic, board, console logs, lab pictures):

QtPy

CleanShot 2024-10-21 at 16 49 06

MacOS

CleanShot 2024-10-21 at 16 50 24
CleanShot 2024-10-21 at 16 50 35

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation Update
  • Hardware (schematic, board, system design) change
  • Software change

Checklist:

  • My change requires a change to the documentation.
  • I have added / updated the documentation related to this change via either README or WIKI

Software

  • I have added tests to cover my changes.
  • I have updated the .github/workflows/build.yml file to add my new test to the automated cloud build github action.
  • All new and existing tests passed.
  • My code follows the code style of this project.

* add `espp::FileSystem::file_entry_string(std::filesystem::path &path, const ListConfig &config, const std::string &prefix="")` method for external use
* refactor `espp::FileSystem::list_directory(...)` to use `espp::FileSystem::file_entry_string(...)` function
* Add file system PC test to ensure host-side / non ESP_PLATFORM code paths work just as well
@finger563 finger563 self-assigned this Oct 21, 2024
@finger563 finger563 added enhancement New feature or request file system labels Oct 21, 2024
Copy link

✅Static analysis result - no issues found! ✅

@finger563 finger563 merged commit f1cbaf3 into main Oct 21, 2024
69 checks passed
@finger563 finger563 deleted the feat/file-system-list-cleanup branch October 21, 2024 21:58
SquaredPotato pushed a commit to smartknob-ha/espp that referenced this pull request Jan 27, 2025
* add `espp::FileSystem::file_entry_string(std::filesystem::path &path, const ListConfig &config, const std::string &prefix="")` method for external use
* refactor `espp::FileSystem::list_directory(...)` to use `espp::FileSystem::file_entry_string(...)` function
* Add file system PC test to ensure host-side / non ESP_PLATFORM code paths work just as well
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request file system
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant