Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Zolotarev <deathbaba@gmail.com>2011-10-31 01:45:39 +0400
committerAlex Zolotarev <alex@maps.me>2015-09-23 01:27:12 +0300
commit64ebd99c4c1e008587c794b86f1e47f8983face3 (patch)
tree5b3dad4e45d292728be6c8d5c944b82b34c0a1da /platform/platform_win.cpp
parentd08095cac1fa2d5b042941e8ddd5604325f7e6fb (diff)
[win] Fixed test aflet platform refactoring
Diffstat (limited to 'platform/platform_win.cpp')
-rw-r--r--platform/platform_win.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/platform/platform_win.cpp b/platform/platform_win.cpp
index b0013e7c95..4d454f22f2 100644
--- a/platform/platform_win.cpp
+++ b/platform/platform_win.cpp
@@ -1,11 +1,12 @@
#include "platform.hpp"
+#include "../base/logging.hpp"
+
#include "../coding/file_writer.hpp"
#include "../std/windows.hpp"
#include <shlobj.h>
-#include <sys/stat.h>
static bool GetUserWritableDir(string & outDir)
{
@@ -64,13 +65,13 @@ Platform::Platform()
{
FileWriter tmpfile(m_resourcesDir + "mapswithmetmptestfile");
tmpfile.Write("Hi from Alex!", 13);
- FileWriter::DeleteFileX(m_resourcesDir + "mapswithmetmptestfile");
m_writableDir = m_resourcesDir;
}
- catch (FileWriter::RootException const &)
+ catch (RootException const &)
{
CHECK(GetUserWritableDir(m_writableDir), ("Can't get writable directory"));
}
+ FileWriter::DeleteFileX(m_resourcesDir + "mapswithmetmptestfile");
LOG(LDEBUG, ("Resources Directory:", m_resourcesDir));
LOG(LDEBUG, ("Writable Directory:", m_writableDir));
@@ -82,8 +83,7 @@ Platform::~Platform()
bool Platform::IsFileExists(string const & file) const
{
- struct _stat s;
- return _stat(file.c_str(), &s) == 0;
+ return ::GetFileAttributesA(file.c_str()) != INVALID_FILE_ATTRIBUTES;
}
int Platform::CpuCores() const