Commit 00010d15 authored by Ivan.Shulga's avatar Ivan.Shulga Committed by Alexander Trofimov

linux build

git-svn-id: svn://fileserver/activex/AVS/Sources/TeamlabOffice/trunk/ServerComponents@58490 954022d7-b5bf-4e40-9824-e11837661b57
parent 405a155e
......@@ -52,7 +52,7 @@ SOURCES += docxformatlib.cpp \
../Source/DocxFormat/FileFactory.cpp \
../Source/DocxFormat/IFileContainer.cpp \
../Source/SystemUtility/FileSystem/DirectoryPosix.cpp \
../Source/SystemUtility/FileSystem/File.cpp \
../Source/SystemUtility/FileSystem/FilePosix.cpp \
../Source/SystemUtility/SystemUtility.cpp \
../Source/Utility/codecvt.cpp \
../Source/Utility/DateTime.cpp \
......
......@@ -2,7 +2,6 @@
namespace FileSystem {
bool File::Exists(LPCTSTR path) {
#ifdef _WIN32
WIN32_FIND_DATA findData;
ZeroMemory(&findData, sizeof(findData));
......@@ -14,16 +13,12 @@ namespace FileSystem {
FindClose(handle);
return fileExists;
#else
std::wstring path_wstring;
std::wstring path_string;
return (-1 == access (fname, F_OK));
#endif
}
bool File::Exists(const String& path) {
return Exists(path.c_str());
}
// wtf?
void File::Create(LPCTSTR path) {
CreateFile(path, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
}
......
#pragma once
#include "Settings.h"
#ifdef _WIN32
#include <windows.h>
#else
#include "../../Base/ASCString.h"
#endif
namespace FileSystem {
class File {
......@@ -12,4 +17,4 @@ namespace FileSystem {
static void Create(LPCTSTR path);
static void Create(const String& path);
};
}
\ No newline at end of file
}
#include "File.h"
#include <unistd.h>
namespace FileSystem {
bool File::Exists(LPCTSTR path) {
std::wstring path_wstring;
path_wstring = path;
std::string path_string = stringWstingToUtf8String(path_wstring);
return (-1 == access (path_string.c_str(), F_OK));
}
bool File::Exists(const String& path) {
return Exists(path.c_str());
}
// wtf? same behavior has win32 version of code
void File::Create(LPCTSTR path) {
std::wstring path_wstring;
path_wstring = path;
std::string path_string = stringWstingToUtf8String(path_wstring);
FILE * pFile = fopen (path_string.c_str(), "wb");
}
void File::Create(const String& path) {
Create(path.c_str());
}
}
#include "SystemUtility.h"
#ifdef _WIN32
#include <windows.h>
#else
#include "../Base/ASCString.h"
#endif
#include "FileSystem/FileSystem.h"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment