Commit 985d76f8 authored by Elen.Subbotina's avatar Elen.Subbotina Committed by Alexander Trofimov

коррекция под WIN32

git-svn-id: svn://fileserver/activex/AVS/Sources/TeamlabOffice/trunk/ServerComponents@59099 954022d7-b5bf-4e40-9824-e11837661b57
parent 314a6ce2
......@@ -63,10 +63,10 @@ namespace NSBinPptxRW
CString strPPT = m_strDstFolder + _T("\\ppt");
FileSystem::Directory::CreateDirectory(m_strDstFolder);
FileSystem::Directory::CreateDirectory(m_strDstFolder, _T("docProps"));
FileSystem::Directory::CreateDirectory(string2std_string(m_strDstFolder));
FileSystem::Directory::CreateDirectory(string2std_string(m_strDstFolder), _T("docProps"));
FileSystem::Directory::CreateDirectory(strPPT);
FileSystem::Directory::CreateDirectory(strPPT, _T("media"));
FileSystem::Directory::CreateDirectory(string2std_string(strPPT), _T("media"));
m_oImageManager.Clear();
m_oImageManager.SetDstMedia(m_strDstFolder + _T("\\ppt\\media"));
......@@ -105,7 +105,8 @@ namespace NSBinPptxRW
if (cur_pos == len || cur_pos == start_pos)
return;
CStringA __str_decode_len((LPSTR)(pBuffer + start_pos), cur_pos - start_pos);
CStringA __str_decode_len_ansi((LPSTR)(pBuffer + start_pos), cur_pos - start_pos);
CString __str_decode_len = __str_decode_len_ansi;
start_pos = cur_pos + 1;
pBuffer += start_pos;
......
#include "Directory.h"
//#include <shlobj.h>
#include <sys/stat.h>
#include <shlobj.h>
namespace FileSystem {
LPCTSTR Directory::GetCurrentDirectory() {
namespace FileSystem
{
LPCTSTR Directory::GetCurrentDirectory()
{
static const int bufferSize = MAX_PATH;
LPTSTR directory = new TCHAR[bufferSize];
......@@ -16,7 +18,8 @@ namespace FileSystem {
return directory;
}
String Directory::GetCurrentDirectoryS() {
String Directory::GetCurrentDirectoryS()
{
LPCTSTR directory = GetCurrentDirectory();
if (directory == NULL)
return String();
......@@ -24,13 +27,15 @@ namespace FileSystem {
return String(directory);
}
bool Directory::CreateDirectory(LPCTSTR path) {
bool Directory::CreateDirectory(LPCTSTR path)
{
bool directoryCreated = false;
if (::CreateDirectory(path, NULL) == TRUE)
directoryCreated = true;
return directoryCreated;
}
bool Directory::CreateDirectory(const String& path) {
bool Directory::CreateDirectory(const String& path)
{
return CreateDirectory(path.c_str());
}
bool Directory::CreateDirectory(String strFolderPathRoot, String strFolderName)
......@@ -113,33 +118,5 @@ namespace FileSystem {
return filesCount;
}
static CString GetFolderPath(CString strFolderPath)
{
int n1 = strFolderPath.rfind(_T("\\"));
if (n1 < 0 )
return _T("");
return strFolderPath.substr(0,n1);
}
static CString GetLongPathNameW(const CString fileName)
{
return fileName;
//todo
}
static CString GetTempPath()
{
CString tempPath = P_tmpdir;
return tempPath;
}
static bool PathIsDirectory(CString pathName)
{
struct stat s;
if (stat(pathName, &s) == 0)
{
if (s.st_mode & S_IFDR)return true;
else return false;
}
return false;
}
}
......@@ -65,7 +65,8 @@ namespace FileSystem {
return stringUtf8ToWString (sDir);
}
bool Directory::CreateDirectory(LPCTSTR path) {
bool Directory::CreateDirectory_(LPCTSTR path)
{
bool directoryCreated = false;
std::wstring wsPath = path;
......@@ -77,10 +78,11 @@ namespace FileSystem {
return directoryCreated;
}
bool Directory::CreateDirectory(const String& path) {
bool Directory::CreateDirectory_(const String& path)
{
return CreateDirectory(path.c_str());
}
bool CreateDirectory(String strFolderPathRoot, String strFolderName)
bool CreateDirectory_(String strFolderPathRoot, String strFolderName)
{
String strFolder = strFolderPathRoot;
strFolder =+ _T("/");
......@@ -178,4 +180,34 @@ namespace FileSystem {
return files.size();
}
static CString GetFolderPath(CString strFolderPath)
{
int n1 = strFolderPath.rfind(_T("\\"));
if (n1 < 0 )
return _T("");
return strFolderPath.substr(0,n1);
}
static CString GetLongPathNameW(const CString fileName)
{
return fileName;
//todo
}
static CString GetTempPath()
{
CString tempPath = P_tmpdir;
return tempPath;
}
static bool PathIsDirectory(CString pathName)
{
struct stat s;
if (stat(pathName, &s) == 0)
{
if (s.st_mode & S_IFDR)return true;
else return false;
}
return false;
}
}
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