SGPath: rename validate() to updateAttrsIfNull()

This is to avoid confusion because the following commit will make
SGPath::validate(bool) replace the fgValidatePath() function from the
FlightGear repository.
This commit is contained in:
Florent Rougon
2022-08-22 12:58:11 +02:00
parent 8febf6b9f5
commit 1ef4a7eb9e
2 changed files with 8 additions and 8 deletions
+7 -7
View File
@@ -423,7 +423,7 @@ string SGPath::complete_lower_extension() const
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
void SGPath::validate() const void SGPath::updateAttrsIfNull() const
{ {
if (_cached && _cacheEnabled) { if (_cached && _cacheEnabled) {
return; return;
@@ -509,7 +509,7 @@ void SGPath::checkAccess() const
return; return;
} }
validate(); updateAttrsIfNull();
_rwCached = true; _rwCached = true;
} }
@@ -528,7 +528,7 @@ bool SGPath::exists() const
return _exists; return _exists;
} }
#endif #endif
validate(); updateAttrsIfNull();
return _exists; return _exists;
} }
@@ -548,13 +548,13 @@ bool SGPath::canWrite() const
bool SGPath::isDir() const bool SGPath::isDir() const
{ {
validate(); updateAttrsIfNull();
return _exists && _isDir; return _exists && _isDir;
} }
bool SGPath::isFile() const bool SGPath::isFile() const
{ {
validate(); updateAttrsIfNull();
return _exists && _isFile; return _exists && _isFile;
} }
@@ -746,13 +746,13 @@ bool SGPath::remove()
time_t SGPath::modTime() const time_t SGPath::modTime() const
{ {
validate(); updateAttrsIfNull();
return _modTime; return _modTime;
} }
size_t SGPath::sizeInBytes() const size_t SGPath::sizeInBytes() const
{ {
validate(); updateAttrsIfNull();
return _size; return _size;
} }
+1 -1
View File
@@ -345,7 +345,7 @@ private:
void fix(); void fix();
void validate() const; void updateAttrsIfNull() const;
void checkAccess() const; void checkAccess() const;
bool permissionsAllowsWrite() const; bool permissionsAllowsWrite() const;