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

Feature request: offsets for games #13

Open
arnsholt opened this issue Apr 23, 2019 · 0 comments
Open

Feature request: offsets for games #13

arnsholt opened this issue Apr 23, 2019 · 0 comments

Comments

@arnsholt
Copy link
Contributor

In a project I'm using pgn_reader it'd be very useful if I could get the byte offset where the PGN of a game starts, so that I can seek on the handle to a large PGN file and read only that game.

I've had a peek at the code, and as far as I can make out implementing this requires two changes:

  • Changing or extending the Visitor trait, either adding an offset parameter to begin_game() or adding a new callback which is called between begin_game() and begin_headers()
  • Adding a member to BufferedReader keeping track of the current position in the file. From the design of the code, I think the only place the variable needs to be updated is in consume().

Does this sound like a reasonable feature? If so, I'd be happy to pitch in and submit a pull request implementing it.

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

No branches or pull requests

1 participant