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

Implement std::io traits for IStream/ISequentialStream #2923

Open
tim-weis opened this issue Mar 8, 2024 · 2 comments
Open

Implement std::io traits for IStream/ISequentialStream #2923

tim-weis opened this issue Mar 8, 2024 · 2 comments
Labels
enhancement New feature or request

Comments

@tim-weis
Copy link
Contributor

tim-weis commented Mar 8, 2024

Suggestion

The Read/Write/Seek traits in std::io form a battle-tested[citation needed] abstraction over (de-)serializing implementations, that roughly map to these COM interfaces:

It would be convenient to have those implemented (I can supply a draft PR for discussion if desired).

Ignoring the maintenance burden, the only issue I see is how to deal with the impedance mismatch between the representation of sizes/offsets: std::io chooses [i|u]size (i.e., pointer precision), whereas the COM interfaces are based on [U]LARGE_INTEGER (64-bit quantities).

This could be addressed

@tim-weis tim-weis added the enhancement New feature or request label Mar 8, 2024
@kennykerr
Copy link
Collaborator

Is this related to #1952?

@tim-weis
Copy link
Contributor Author

tim-weis commented Mar 9, 2024

Is this related to #1952?

Both issues have the same goal, so yes, they are related. Thanks for digging that up!

A few differences:

  • This issue is asking for Read/Write/Seek as opposed to just Read
  • IStream/ISequentialStream have a synchronous interface with the WinRT types offering an async interface only

If you're still planning on providing those std::io traits I would expect that implementing them for the COM interfaces is easier.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants