Remove virtual designation for FSNode::setFlags, since it's never needed.

This commit is contained in:
Stephen Anthony 2019-12-22 21:00:50 -03:30
parent 1223958d91
commit 2ec91dbe6b
3 changed files with 21 additions and 21 deletions

View File

@ -23,25 +23,6 @@
#include "FSNodePOSIX.hxx"
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void FilesystemNodePOSIX::setFlags()
{
struct stat st;
_isValid = (0 == stat(_path.c_str(), &st));
if(_isValid)
{
_isDirectory = S_ISDIR(st.st_mode);
_isFile = S_ISREG(st.st_mode);
// Add a trailing slash, if necessary
if (_isDirectory && _path.length() > 0 && _path[_path.length()-1] != '/')
_path += '/';
}
else
_isDirectory = _isFile = false;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FilesystemNodePOSIX::FilesystemNodePOSIX()
: _path(ROOT_DIR),
@ -82,6 +63,25 @@ FilesystemNodePOSIX::FilesystemNodePOSIX(const string& path, bool verify)
setFlags();
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void FilesystemNodePOSIX::setFlags()
{
struct stat st;
_isValid = (0 == stat(_path.c_str(), &st));
if(_isValid)
{
_isDirectory = S_ISDIR(st.st_mode);
_isFile = S_ISREG(st.st_mode);
// Add a trailing slash, if necessary
if (_isDirectory && _path.length() > 0 && _path[_path.length()-1] != '/')
_path += '/';
}
else
_isDirectory = _isFile = false;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
string FilesystemNodePOSIX::getShortPath() const
{

View File

@ -88,7 +88,7 @@ class FilesystemNodePOSIX : public AbstractFSNode
* Tests and sets the _isValid and _isDirectory/_isFile flags,
* using the stat() function.
*/
virtual void setFlags();
void setFlags();
/**
* Returns the last component of a given path.

View File

@ -86,7 +86,7 @@ class FilesystemNodeWINDOWS : public AbstractFSNode
* Tests and sets the _isValid and _isDirectory/_isFile flags,
* using the GetFileAttributes() function.
*/
virtual void setFlags();
void setFlags();
/**
* Adds a single FilesystemNodeWINDOWS to a given list.