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 ReadBytesToToken() #71

Open
priverop opened this issue Nov 14, 2018 · 1 comment
Open

Implement ReadBytesToToken() #71

priverop opened this issue Nov 14, 2018 · 1 comment

Comments

@priverop
Copy link
Member

priverop commented Nov 14, 2018

It would be helpful to have a method in DataReader to read bytes until a token/byte is found. So we can avoid to do this on our programs:

long start = reader.Stream.Position;

while (reader.ReadInt32() != 0){}

long end = reader.Stream.Position - 4;

reader.Stream.Position = start;

It would be also good to have ReadStringToToken(), as it is implemented in TextReader.

@pleonex pleonex added IO good first issue Easy issues to start with the project and removed core labels Dec 11, 2018
@pleonex
Copy link
Member

pleonex commented Jul 27, 2020

DataReader.ReadStringToToken() was implemented in Yarhl 3.0 with #137.
My concern with this proposal is that we would need to add many methods, one per type of token (byte, short, int, long, signed, unsigned, ...).

@pleonex pleonex added needs design and removed good first issue Easy issues to start with the project labels Jul 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants