azure-osconfig icon indicating copy to clipboard operation
azure-osconfig copied to clipboard

[experimental] Add InputStream wrapper for improved guarding of file read operations.

Open robertwoj-microsoft opened this issue 5 months ago • 1 comments

Description

Introduce a wrapper class for std::ifstream. Goals:

  • Add file read limits - currently the limit is soft and allows the last line to exceed the lmiit
  • Add Result<> wrappers where applicable for improved error handling
  • Add iterator and range classes to support range-based loops.
  • Mockable filenames

planned to add if necessary:

  • byte-by-byte read iterator and range
  • full-file read (wrap in a function returning Result)

Checklist

  • [x] I have read the contribution guidelines.
  • [x] I added unit-tests to validate my changes. All unit tests are passing.
  • [x] I have merged the latest dev branch prior to this PR submission.
  • [x] I ran pre-commit on my changes prior to this PR submission.
  • [x] I submitted this PR against the dev branch.

robertwoj-microsoft avatar Nov 14 '25 12:11 robertwoj-microsoft

Test Results

 64 files   64 suites   58m 15s ⏱️   8 tests   8 ✅  0 💤 0 ❌ 256 runs  234 ✅ 22 💤 0 ❌

Results for commit 5d7fd1ce.

:recycle: This comment has been updated with latest results.

github-actions[bot] avatar Nov 14 '25 12:11 github-actions[bot]