diff --git a/src/win32/FSNodeWin32.cxx b/src/win32/FSNodeWin32.cxx index 5d91d8450..09f9d0874 100644 --- a/src/win32/FSNodeWin32.cxx +++ b/src/win32/FSNodeWin32.cxx @@ -20,6 +20,44 @@ // Copyright (C) 2002-2004 The ScummVM project //============================================================================ +#include +#include + +#ifdef ARRAYSIZE + #undef ARRAYSIZE +#endif +#ifdef _WIN32_WCE + #include + // winnt.h defines ARRAYSIZE, but we want our own one... + #undef ARRAYSIZE + #undef GetCurrentDirectory +#endif + +#include +#include +#ifndef _WIN32_WCE + #include + // winnt.h defines ARRAYSIZE, but we want our own one... + #undef ARRAYSIZE +#endif + +// F_OK, R_OK and W_OK are not defined under MSVC, so we define them here +// For more information on the modes used by MSVC, check: +// http://msdn2.microsoft.com/en-us/library/1w06ktdy(VS.80).aspx +#ifndef F_OK + #define F_OK 0 +#endif + +#ifndef R_OK + #define R_OK 4 +#endif + +#ifndef W_OK + #define W_OK 2 +#endif + +#include "FSNodeWin32.hxx" + /** * Returns the last component of a given path. * @@ -45,6 +83,24 @@ const char* lastPathComponent(const string& str) return cur + 1; } +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +bool FilesystemNodeWin32::exists() const +{ + return _access(_path.c_str(), F_OK) == 0; +} + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +bool FilesystemNodeWin32::isReadable() const +{ + return _access(_path.c_str(), R_OK) == 0; +} + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +bool FilesystemNodeWin32::isWritable() const +{ + return _access(_path.c_str(), W_OK) == 0; +} + // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - void FilesystemNodeWin32::setFlags() { @@ -279,9 +335,3 @@ AbstractFSNode* FilesystemNodeWin32::getParent() const return p; } - -// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -AbstractFSNode* AbstractFSNode::makeFileNodePath(const string& path) -{ - return new FilesystemNodeWin32(path); -} diff --git a/src/win32/FSNodeWin32.hxx b/src/win32/FSNodeWin32.hxx index af3f636cf..2c1d83c32 100644 --- a/src/win32/FSNodeWin32.hxx +++ b/src/win32/FSNodeWin32.hxx @@ -23,44 +23,8 @@ #ifndef FS_NODE_WIN32_HXX #define FS_NODE_WIN32_HXX -#include -#include - -#ifdef ARRAYSIZE - #undef ARRAYSIZE -#endif -#ifdef _WIN32_WCE - #include - // winnt.h defines ARRAYSIZE, but we want our own one... - #undef ARRAYSIZE - #undef GetCurrentDirectory -#endif - -#include -#include -#include -#ifndef _WIN32_WCE - #include - // winnt.h defines ARRAYSIZE, but we want our own one... - #undef ARRAYSIZE -#endif #include -// F_OK, R_OK and W_OK are not defined under MSVC, so we define them here -// For more information on the modes used by MSVC, check: -// http://msdn2.microsoft.com/en-us/library/1w06ktdy(VS.80).aspx -#ifndef F_OK - #define F_OK 0 -#endif - -#ifndef R_OK - #define R_OK 4 -#endif - -#ifndef W_OK - #define W_OK 2 -#endif - #include "FSNode.hxx" #include "HomeFinder.hxx" @@ -98,14 +62,14 @@ class FilesystemNodeWin32 : public AbstractFSNode */ FilesystemNodeWin32(const string& path); - bool exists() const { return _access(_path.c_str(), F_OK) == 0; } + bool exists() const; const string& getName() const { return _displayName; } const string& getPath() const { return _path; } string getShortPath() const; bool isDirectory() const { return _isDirectory; } bool isFile() const { return _isFile; } - bool isReadable() const { return _access(_path.c_str(), R_OK) == 0; } - bool isWritable() const { return _access(_path.c_str(), W_OK) == 0; } + bool isReadable() const; + bool isWritable() const; bool isAbsolute() const; bool makeDir(); bool rename(const string& newfile); diff --git a/src/win32/Stella.vcxproj b/src/win32/Stella.vcxproj index 5abe7d78a..2f13da4e7 100644 --- a/src/win32/Stella.vcxproj +++ b/src/win32/Stella.vcxproj @@ -223,6 +223,7 @@ SDLmain.lib + @@ -294,7 +295,6 @@ SDLmain.lib - @@ -423,6 +423,8 @@ SDLmain.lib + + @@ -449,6 +451,7 @@ SDLmain.lib + diff --git a/src/win32/Stella.vcxproj.filters b/src/win32/Stella.vcxproj.filters index 842c330c9..b18ee5071 100644 --- a/src/win32/Stella.vcxproj.filters +++ b/src/win32/Stella.vcxproj.filters @@ -213,9 +213,6 @@ Source Files\emucore - - Source Files\emucore - Source Files\emucore @@ -627,6 +624,9 @@ Source Files\emucore + + Source Files + @@ -1247,6 +1247,15 @@ Header Files\emucore + + Header Files + + + Header Files + + + Header Files +