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

Reading files from a pointer #178

Open
Raffaello opened this issue Feb 6, 2022 · 1 comment
Open

Reading files from a pointer #178

Raffaello opened this issue Feb 6, 2022 · 1 comment
Labels
enhancement New feature or request file I/O file related

Comments

@Raffaello
Copy link
Owner

Raffaello commented Feb 6, 2022

At the moment is only possible to read a file type from a filename.

Audio files might be packed in file like WAD or similar.

To read from those needs to read them from an already positioned file pointer or having read it all in a memory buffer before decoding it.


It is required to add the read a file type within a file container, like a WAD/PAK or whatever using either a "parent file pointer" or a memory buffer and add these methods as a constructor.

It requires to refactor all files types with this functionality.

So to pass a file pointer already positioned at the starting point of the internal file to be read could be done using the parent class File.


As a library when integrating with some other File I/O ops, for example reading a WAD, it is not really efficient to read the WAD and create a File class pointer to pass to the method to be read, but the read it from memory buffer could be the right alternative.

This bring a consideration that other constructors could be implemented instead of using parent class File:
It could use FILE* or fstream types for eg.

@Raffaello Raffaello added enhancement New feature or request file I/O file related labels Feb 6, 2022
@Raffaello Raffaello changed the title reading files from memory pointer Reading files from a pointer Feb 6, 2022
@Raffaello
Copy link
Owner Author

just use a memory buffer where the file has been loaded into memory first..

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

No branches or pull requests

1 participant