This repository has been archived by the owner on Jan 25, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 999
File Abstraction #2210
Open
SirNate0
wants to merge
13
commits into
urho3d:master
Choose a base branch
from
SirNate0:file-abstraction
base: master
Could not load branches
Branch not found: {{ refName }}
Could not load tags
Nothing to show
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
File Abstraction #2210
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
I'm working on getting it compiling now. I think I'll change PhysicalFile to SystemFile as well.
…entation. A few minor log comments added to clarify failures and help with debugging.
I created an example project here (same basic format as the examples, based on the code from one of them) that creates new file source and file classes to read and write gzipped files. |
thesquib
reviewed
Jan 11, 2018
/// Destruct. | ||
virtual ~FileSource() override { } | ||
|
||
/// Check if a file exists within the package file. This should be case-insensitive on Windows and case-sensitive on other platforms. |
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.
Comments still refer to Package File instead of File Source
weitjong
force-pushed
the
master
branch
4 times, most recently
from
January 17, 2018 16:24
c7346fe
to
b46c83f
Compare
weitjong
force-pushed
the
master
branch
2 times, most recently
from
December 1, 2018 08:48
6a26075
to
9c7ea24
Compare
Marking this stale since there has been no activity for 30 days. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Inspired by #2198, I went ahead and abstracted the packed and unpacked behavior of the File class into two separate classes, and created an abstract base for PackageFile to allow the creation of different kinds of these FileSources (say for a different method of compression or encryption). Presently, I think it is in working order (it hasn't been thoroughly tested, but I checked that some of the samples ran as well as the Editor and NinjaSnowWar), and it only minimally breaks the API. I'm planning on maybe making an example other file source for gzipped files or something, but that hasn't yet been done.
Notable changes required include:
File
as it is now an abstract class -- must use aSystemFile
instead (assuming this is for reading/writing to the file system, which is the usual use for constructing a File directly).FileSource
based, notPackageFile
based (e.g.GetPackageFiles()
presently just returns the vector of FileSources.IsPackaged()
was removed from the File class.