feat: Implement dirent API for Windows using WinAPI

This commit introduces a complete implementation of the POSIX
dirent API for Windows, enabling C/C++ code to interact with
directories in a platform-independent manner. The implementation
leverages the Windows API for core functionality.

The following functions are implemented:

- opendir: Opens a directory stream.
- readdir: Reads a directory entry.
- closedir: Closes a directory stream.
- rewinddir: Resets a directory stream to the beginning.
- telldir: Gets the current position of a directory stream.
- seekdir: Sets the position of a directory stream.

Key Features:
- Supports UTF-8 encoded filenames.
- Handles extended-length paths using the \\?\ prefix.
- Uses std::unique_ptr for internal memory management.
- Provides comprehensive error handling via errno.

Limitations:
- telldir and seekdir have limited functionality due to the
  underlying Windows API. seekdir is O(N) for non-zero
  positive positions.
- Thread safety is not yet implemented.

This implementation provides a robust and portable way to work
with directories on Windows, bridging the gap between POSIX
and Windows file system APIs.

This will make sure that qemu will properly handle utf-8 when using
dirent.

Change-Id: I9462e32b1ee7f6133a698d7200eed74ea2b82a37
GitOrigin-RevId: 97208f534483e2f68b832bda47887b8b6addd955
5 files changed
tree: e90e2227f93e83df788c35d15006ec4ff2f3bdd1
  1. base/
  2. build-config/
  3. CMake/
  4. host-common/
  5. snapshot/
  6. third-party/
  7. windows/
  8. .clang-format
  9. .gitignore
  10. Android.bp
  11. BUILD.bazel
  12. CMakeLists.txt
  13. LICENSE
  14. README.md
  15. rebuild.sh
README.md

AEMU library

This is an utility library for common functions used in the Android Emulator. External projects (gfxstream, QEMU) may use to perform C++ functions.