Commit 5280a785 authored by Elen.Subbotina's avatar Elen.Subbotina Committed by Alexander Trofimov

отключен SvmFile, так как он win only, переписывается

git-svn-id: svn://fileserver/activex/AVS/Sources/TeamlabOffice/trunk/ServerComponents@62682 954022d7-b5bf-4e40-9824-e11837661b57
parent 5cce624d
...@@ -51,7 +51,8 @@ public: ...@@ -51,7 +51,8 @@ public:
} }
static CString CreateTempDir() static CString CreateTempDir()
{ {
return FileSystem::Directory::CreateDirectoryWithUniqueName(FileSystem::Directory::GetTempPath()); CString tmpDirectory = FileSystem::Directory::GetTempPath();
return FileSystem::Directory::CreateDirectoryWithUniqueName(tmpDirectory);
} }
static CString PrepareToXML( const CString & sInput) static CString PrepareToXML( const CString & sInput)
{ {
......
...@@ -276,4 +276,16 @@ namespace FileSystem ...@@ -276,4 +276,16 @@ namespace FileSystem
return pcTemplate; return pcTemplate;
} }
#endif #endif
bool Directory::IsExist(const std::wstring& strFileName)
{
FILE* pFile = _wfopen(strFileName.c_str(), L"rb");
if (NULL != pFile)
{
fclose(pFile);
return true;
}
else
return false;
}
} }
...@@ -47,24 +47,6 @@ namespace FileSystem { ...@@ -47,24 +47,6 @@ namespace FileSystem {
static void DeleteDirectory(std::wstring& path, bool deleteRoot = true); static void DeleteDirectory(std::wstring& path, bool deleteRoot = true);
#endif #endif
static bool IsExist(const std::wstring& strFileName) static bool IsExist(const std::wstring& strFileName);
{
#if defined(_WIN32) || defined(_WIN32_WCE) || defined(_WIN64)
FILE* pFile = _wfopen(strFileName.c_str(), L"rb");
#else
BYTE* pUtf8 = NULL;
LONG lLen = 0;
CUtf8Converter::GetUtf8StringFromUnicode(strFileName.c_str(), strFileName.length(), pUtf8, lLen, false);
FILE* pFile = fopen((char*)pUtf8, "rb");
delete [] pUtf8;
#endif
if (NULL != pFile)
{
fclose(pFile);
return true;
}
else
return false;
}
}; };
} }
...@@ -127,7 +127,7 @@ namespace FileSystem { ...@@ -127,7 +127,7 @@ namespace FileSystem {
strFolder += strFolderName; strFolder += strFolderName;
return CreateDirectory(strFolder); return CreateDirectory(strFolder);
} }
CString Directory::CreateDirectoryWithUniqueName (CString strFolderPathRoot) CString Directory::CreateDirectoryWithUniqueName (CString & strFolderPathRoot)
{ {
std::string pcTemplate = stringWstingToUtf8String (strFolderPathRoot) + "/ascXXXXXX"; std::string pcTemplate = stringWstingToUtf8String (strFolderPathRoot) + "/ascXXXXXX";
char *pcRes = mkdtemp(const_cast <char *> (pcTemplate.c_str())); char *pcRes = mkdtemp(const_cast <char *> (pcTemplate.c_str()));
...@@ -255,4 +255,21 @@ namespace FileSystem { ...@@ -255,4 +255,21 @@ namespace FileSystem {
return false; return false;
} }
bool Directory::IsExist(const std::wstring& strFileName)
{
BYTE* pUtf8 = NULL;
LONG lLen = 0;
NSFile::CUtf8Converter::GetUtf8StringFromUnicode(strFileName.c_str(), strFileName.length(), pUtf8, lLen, false);
FILE* pFile = fopen((char*)pUtf8, "rb");
delete [] pUtf8;
if (NULL != pFile)
{
fclose(pFile);
return true;
}
else
return false;
}
} }
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
#include "Jp2/J2kFile.h" #include "Jp2/J2kFile.h"
#include "JBig2/source/JBig2File.h" #include "JBig2/source/JBig2File.h"
#include "SvmFile/source/SvmFile.h" #include "SvmFile/Source/SvmFile.h"
bool CBgraFrame::OpenFile(const std::wstring& strFileName, unsigned int nFileType) bool CBgraFrame::OpenFile(const std::wstring& strFileName, unsigned int nFileType)
{ {
...@@ -13,11 +13,11 @@ bool CBgraFrame::OpenFile(const std::wstring& strFileName, unsigned int nFileTyp ...@@ -13,11 +13,11 @@ bool CBgraFrame::OpenFile(const std::wstring& strFileName, unsigned int nFileTyp
Jpeg2000::CJ2kFile oJ2; Jpeg2000::CJ2kFile oJ2;
return oJ2.Open(this, strFileName, std::wstring(L"")); return oJ2.Open(this, strFileName, std::wstring(L""));
} }
if (22/*CXIMAGE_FORMAT_SVM*/ == nFileType) // if (22/*CXIMAGE_FORMAT_SVM*/ == nFileType)
{ // {
SvmFile::CSvmFile oSvm; // SvmFile::CSvmFile oSvm;
return oSvm.Open(this, strFileName); // return oSvm.Open(this, strFileName);
} // }
else else
{ {
NSFile::CFileBinary oFile; NSFile::CFileBinary oFile;
......
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