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

Add a proper File class #287

Merged
merged 46 commits into from
Oct 8, 2024
Merged

Add a proper File class #287

merged 46 commits into from
Oct 8, 2024

Commits on Oct 5, 2024

  1. Add file class

    flo12356 authored and PatrickKa committed Oct 5, 2024
    Configuration menu
    Copy the full SHA
    d5dafc2 View commit details
    Browse the repository at this point in the history
  2. Restructure file class

    flo12356 authored and PatrickKa committed Oct 5, 2024
    Configuration menu
    Copy the full SHA
    8078a77 View commit details
    Browse the repository at this point in the history
  3. Refactor LfsWrapper a bit

    PatrickKa committed Oct 5, 2024
    Configuration menu
    Copy the full SHA
    78262a9 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    25e3c2f View commit details
    Browse the repository at this point in the history
  5. Add NewOutcome.test.cpp

    PatrickKa committed Oct 5, 2024
    Configuration menu
    Copy the full SHA
    a4cb6c0 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    128ce0f View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    9b6ec67 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    84934c9 View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    b0aef6e View commit details
    Browse the repository at this point in the history
  10. Turn lfs wrapper test into normal executable

    The TEST_CASE()s and other magic from Catch2 made it harder to debug.
    PatrickKa committed Oct 5, 2024
    Configuration menu
    Copy the full SHA
    77951c1 View commit details
    Browse the repository at this point in the history
  11. Fix move construction and assignment of File

    This requires addinge the members path_ and openFlags_.
    PatrickKa committed Oct 5, 2024
    Configuration menu
    Copy the full SHA
    0d47ee1 View commit details
    Browse the repository at this point in the history
  12. Add File.isOpen_

    PatrickKa committed Oct 5, 2024
    Configuration menu
    Copy the full SHA
    4fb6f2c View commit details
    Browse the repository at this point in the history
  13. Move template functions to ipp

    flo12356 authored and PatrickKa committed Oct 5, 2024
    Configuration menu
    Copy the full SHA
    32e288a View commit details
    Browse the repository at this point in the history
  14. Add LfsWrapper Unit tests

    flo12356 authored and PatrickKa committed Oct 5, 2024
    Configuration menu
    Copy the full SHA
    59762bd View commit details
    Browse the repository at this point in the history
  15. Add flag check befor read/write

    flo12356 authored and PatrickKa committed Oct 5, 2024
    Configuration menu
    Copy the full SHA
    c446e0c View commit details
    Browse the repository at this point in the history
  16. Disable warning on missing field initializers

    When using designated initializes to initialize a struct, it is
    perfectly valid not to specify all fields. The unspecified fields are
    initialized with default member initializers where provided, and empty
    list-initialization otherwise.
    PatrickKa committed Oct 5, 2024
    Configuration menu
    Copy the full SHA
    23acc96 View commit details
    Browse the repository at this point in the history
  17. Use statically allocated file buffer

    The normal lfs_file_open() uses malloc() to allocate the file buffer.
    Since we do not want to use the heap, we use lfs_file_opencfg() and
    provide a statically allocated buffer instead.
    PatrickKa committed Oct 5, 2024
    Configuration menu
    Copy the full SHA
    808318a View commit details
    Browse the repository at this point in the history
  18. Configuration menu
    Copy the full SHA
    d4aad23 View commit details
    Browse the repository at this point in the history
  19. Configuration menu
    Copy the full SHA
    5c4dae0 View commit details
    Browse the repository at this point in the history
  20. Configuration menu
    Copy the full SHA
    d8c14c3 View commit details
    Browse the repository at this point in the history
  21. Make flags in LfsWrapper unsigned

    Flag varibales are one of the few cases where unsigned types should be
    used because they do not represent a real quantity/number but just a
    bunch of states/bits.
    PatrickKa committed Oct 5, 2024
    Configuration menu
    Copy the full SHA
    c8636c0 View commit details
    Browse the repository at this point in the history
  22. Rename storage to memory

    PatrickKa committed Oct 5, 2024
    Configuration menu
    Copy the full SHA
    3c6069a View commit details
    Browse the repository at this point in the history
  23. WIP: Add move function

    flo12356 authored and PatrickKa committed Oct 5, 2024
    Configuration menu
    Copy the full SHA
    9222232 View commit details
    Browse the repository at this point in the history
  24. WIP: Replace move with swap

    flo12356 authored and PatrickKa committed Oct 5, 2024
    Configuration menu
    Copy the full SHA
    dcb7b4f View commit details
    Browse the repository at this point in the history
  25. Revert "WIP: Replace move with swap"

    This reverts commit 1d0bd2f.
    
    In this special case the Swap() function is an abomination, and the
    previous version with the Move() function is better.
    PatrickKa committed Oct 5, 2024
    Configuration menu
    Copy the full SHA
    5ef2acb View commit details
    Browse the repository at this point in the history
  26. Refactor fs::File

    - Rename `Move()` to `MoveConstructFrom()`
    - Make the class const-correct
    - Remove `std::cout` and `iostream`
    - Make cosmetic changes
    PatrickKa committed Oct 5, 2024
    Configuration menu
    Copy the full SHA
    b39d22d View commit details
    Browse the repository at this point in the history
  27. Fix rebase error

    flo12356 authored and PatrickKa committed Oct 5, 2024
    Configuration menu
    Copy the full SHA
    5d6f9a6 View commit details
    Browse the repository at this point in the history
  28. Configuration menu
    Copy the full SHA
    4b0b47b View commit details
    Browse the repository at this point in the history
  29. Configuration menu
    Copy the full SHA
    5235e71 View commit details
    Browse the repository at this point in the history
  30. Remove LfsWrapperExecutable and NewOutcome tests

    They were used to test stuff during development but are now obsolete.
    PatrickKa committed Oct 5, 2024
    Configuration menu
    Copy the full SHA
    1a22c2b View commit details
    Browse the repository at this point in the history
  31. Configuration menu
    Copy the full SHA
    7f3d2f8 View commit details
    Browse the repository at this point in the history
  32. Configuration menu
    Copy the full SHA
    fa05e0e View commit details
    Browse the repository at this point in the history
  33. Fix includes for LfsWrapper.ipp

    flo12356 authored and PatrickKa committed Oct 5, 2024
    Configuration menu
    Copy the full SHA
    faf9b4e View commit details
    Browse the repository at this point in the history
  34. Configuration menu
    Copy the full SHA
    49d2a2d View commit details
    Browse the repository at this point in the history
  35. Configuration menu
    Copy the full SHA
    486a054 View commit details
    Browse the repository at this point in the history
  36. Move USE_NO_RODOS define

    flo12356 authored and PatrickKa committed Oct 5, 2024
    Configuration menu
    Copy the full SHA
    d8fb579 View commit details
    Browse the repository at this point in the history
  37. Add lockfile for LfsWrapper

    flo12356 authored and PatrickKa committed Oct 5, 2024
    Configuration menu
    Copy the full SHA
    6e9c0cd View commit details
    Browse the repository at this point in the history
  38. Configuration menu
    Copy the full SHA
    bbb2326 View commit details
    Browse the repository at this point in the history
  39. Reduce max. path length to 30 characters

    The longest path should be "/programs/65536.zip.lock" which is only 25
    characters long, so we can save quite a bit of memory when we reduce the
    max path length from the default 256 to just 30.
    PatrickKa committed Oct 5, 2024
    Configuration menu
    Copy the full SHA
    8a698cc View commit details
    Browse the repository at this point in the history
  40. Refactor LfsWrapper.[ch]pp

    - Always pass paths as `Path` aka `etl::string` and use `c_str()` to
      ensure that the littlefs functions get null-terminated strings
    - Move member variables which are only used in `CreateLockFile()` to
      that function
    PatrickKa committed Oct 5, 2024
    Configuration menu
    Copy the full SHA
    c8c2e43 View commit details
    Browse the repository at this point in the history
  41. Get rid of USE_NO_RODOS and rework LfsWrapper.test.cpp

    Eventually, the `File` class will need semaphores and therefore require
    the main function from Rodos. I converted it now, because that allows me
    to get rid of this `USE_NO_RODOS` nonsense in `Outcome.hpp` too.
    PatrickKa committed Oct 5, 2024
    Configuration menu
    Copy the full SHA
    678be93 View commit details
    Browse the repository at this point in the history
  42. Configuration menu
    Copy the full SHA
    8fae95c View commit details
    Browse the repository at this point in the history

Commits on Oct 8, 2024

  1. Configuration menu
    Copy the full SHA
    1624f4b View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    b9fd968 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    79a7572 View commit details
    Browse the repository at this point in the history
  4. Add ErrorCode::fileLocked

    PatrickKa committed Oct 8, 2024
    Configuration menu
    Copy the full SHA
    d4e7a26 View commit details
    Browse the repository at this point in the history