Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor|FileSys: Rewired mechanism for composing file paths
de::File1 no longer defines a virtual composeLumpPath(lumpIdx) method at file container level. This functionality has been merged with the path() method at contained file level and is now named composePath(). Todo: The absolute, fully-composed path stored in the path_ member of de::File1 is now largely redundant (only used by files with no container).
- Loading branch information
1 parent
fb7ab2d
commit e6d2de9
Showing
18 changed files
with
155 additions
and
153 deletions.
There are no files selected for viewing
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
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
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
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
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -61,7 +61,7 @@ bool File1::isContained() const | |
|
||
File1& File1::container() const | ||
{ | ||
if(!container_) throw NotContainedError("File1::container", QString("%s is not contained").arg(Str_Text(path()))); | ||
if(!container_) throw NotContainedError("File1::container", QString("%s is not contained").arg(Str_Text(composePath()))); | ||
return *container_; | ||
} | ||
|
||
|
@@ -70,9 +70,12 @@ de::FileHandle& File1::handle() | |
return *handle_; | ||
} | ||
|
||
ddstring_t const* File1::path() const | ||
AutoStr* File1::composePath(char delimiter) const | ||
{ | ||
return &path_; | ||
AutoStr* path = Str_Copy(AutoStr_NewStd(), &path_); | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
danij-deng
Author
Collaborator
|
||
if(delimiter != '/') | ||
throw de::Error("File1::composePath", "Non '/' delimiter not yet implemented"); | ||
return path; | ||
} | ||
|
||
uint File1::loadOrderIndex() const | ||
|
@@ -113,11 +116,6 @@ ddstring_t const* File1::name() const | |
return name_; | ||
} | ||
|
||
AutoStr* File1::composeLumpPath(int /*lumpIdx*/, char /*delimiter*/) | ||
{ | ||
return AutoStr_NewStd(); | ||
} | ||
|
||
size_t File1::readLump(int /*lumpIdx*/, uint8_t* /*buffer*/, bool /*tryCache*/) | ||
{ | ||
/// @todo writeme | ||
|
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
Oops, something went wrong.
I hope this doesn't cause a massive number of AutoStrs to be allocated... Note that it is ok to return a Str* as AutoStr* if ownership is not relinquished to the caller.