-
Notifications
You must be signed in to change notification settings - Fork 56
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
Unifying the filesystem interface (eg. no more check) #706
base: master
Are you sure you want to change the base?
Conversation
1b28ea7
to
496fa82
Compare
I'm not sure why the Files in components are virtual. They should not be. |
This mostly concerns components, no ? Because in this case nothing really force us to remove the |
If you rebase, the tests will pass |
496fa82
to
2d4ba96
Compare
Signed-off-by: FalseIlyu <[email protected]>
Signed-off-by: FalseIlyu <[email protected]>
Signed-off-by: FalseIlyu <[email protected]>
2d4ba96
to
a6b074b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clang-tidy made some suggestions
Signed-off-by: FalseIlyu <[email protected]>
285af47
to
63df367
Compare
The purpose of this PR is to remove the need of checking what type of filesystem to use before reading a file either at compile type (as we have currently to handle android) or at runtime (as proposed in #673).
It divides responsibility as follows :
As a first draft i moved
void ReadFile(std::istream& stream)
in all parsers from a private to a public method.Added a
std::unique_ptr<std::istream> GetData(const std::filesystem::path& path)
as the method to ask access to data from the filesystem.Replaced place where we had to choose between
Open(Locator::filesystem::value().ReadAll(path));
andOpen(path)
withReadFile(*Locator::filesystem::value().GetData(path));
Copied the membuf from the component into android and made it own a copy of the file data (mostly a lazy way to ensure the data was there while being read by the buffer) i also allowed it to be initialized by a vector of byte.
I propose this as draft as i wish to have comment about change that would be necessary or better to implement this (and if such a change is agreeable). Once/while implementation detail are discussed apps and parsers still need to be changed before this gets ready for merge (removing the possibility to read file from parsers and the implied changes it will need on apps).
This would replace #673 if merged before. I didn't look if it would be a pain to modify #674 to make it work with the changes brought here if it is merging #674 should take priority and this PR should be responsible to make it work (tbc i presume it means i will do it).
This PR has been tested by launching the game on an android emulator and windows (both x86_64).