mirror of
https://github.com/Relintai/pandemonium_engine.git
synced 2024-12-23 04:16:50 +01:00
Fix get_path()
is not working when files are opend with open_compressed
And also fixed `get_absolute_path()` in the same way (cherry picked from commit ea11ffc88c22dea2b71d7863808cd65f64f9eded)
This commit is contained in:
parent
29fda5543b
commit
7d4baaed2b
@ -190,6 +190,22 @@ bool FileAccessCompressed::is_open() const {
|
||||
return f != nullptr;
|
||||
}
|
||||
|
||||
String FileAccessCompressed::get_path() const {
|
||||
if (f) {
|
||||
return f->get_path();
|
||||
} else {
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
String FileAccessCompressed::get_path_absolute() const {
|
||||
if (f) {
|
||||
return f->get_path_absolute();
|
||||
} else {
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
void FileAccessCompressed::seek(uint64_t p_position) {
|
||||
ERR_FAIL_COND_MSG(!f, "File must be opened before use.");
|
||||
|
||||
|
@ -71,6 +71,9 @@ public:
|
||||
virtual void close(); ///< close a file
|
||||
virtual bool is_open() const; ///< true when file is open
|
||||
|
||||
virtual String get_path() const; /// returns the path for the current open file
|
||||
virtual String get_path_absolute() const; /// returns the absolute path for the current open file
|
||||
|
||||
virtual void seek(uint64_t p_position); ///< seek to a given position
|
||||
virtual void seek_end(int64_t p_position = 0); ///< seek from the end of file
|
||||
virtual uint64_t get_position() const; ///< get position in the file
|
||||
|
Loading…
Reference in New Issue
Block a user