mirror of https://github.com/stella-emu/stella.git
Remove virtual designation for FSNode::setFlags, since it's never needed.
This commit is contained in:
parent
1223958d91
commit
2ec91dbe6b
|
@ -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
|
||||
{
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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.
|
||||
|
|
Loading…
Reference in New Issue