From 1ef4a7eb9e31a50ce435cf1023eb3351b60f8438 Mon Sep 17 00:00:00 2001 From: Florent Rougon Date: Mon, 22 Aug 2022 12:58:11 +0200 Subject: [PATCH] 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. --- simgear/misc/sg_path.cxx | 14 +++++++------- simgear/misc/sg_path.hxx | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/simgear/misc/sg_path.cxx b/simgear/misc/sg_path.cxx index 835c6aa1..1caa50e0 100644 --- a/simgear/misc/sg_path.cxx +++ b/simgear/misc/sg_path.cxx @@ -423,7 +423,7 @@ string SGPath::complete_lower_extension() const } //------------------------------------------------------------------------------ -void SGPath::validate() const +void SGPath::updateAttrsIfNull() const { if (_cached && _cacheEnabled) { return; @@ -509,7 +509,7 @@ void SGPath::checkAccess() const return; } - validate(); + updateAttrsIfNull(); _rwCached = true; } @@ -528,7 +528,7 @@ bool SGPath::exists() const return _exists; } #endif - validate(); + updateAttrsIfNull(); return _exists; } @@ -548,13 +548,13 @@ bool SGPath::canWrite() const bool SGPath::isDir() const { - validate(); + updateAttrsIfNull(); return _exists && _isDir; } bool SGPath::isFile() const { - validate(); + updateAttrsIfNull(); return _exists && _isFile; } @@ -746,13 +746,13 @@ bool SGPath::remove() time_t SGPath::modTime() const { - validate(); + updateAttrsIfNull(); return _modTime; } size_t SGPath::sizeInBytes() const { - validate(); + updateAttrsIfNull(); return _size; } diff --git a/simgear/misc/sg_path.hxx b/simgear/misc/sg_path.hxx index 2ebfa5b5..b4668c69 100644 --- a/simgear/misc/sg_path.hxx +++ b/simgear/misc/sg_path.hxx @@ -345,7 +345,7 @@ private: void fix(); - void validate() const; + void updateAttrsIfNull() const; void checkAccess() const; bool permissionsAllowsWrite() const;