Commit 05d65ba3 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@59082 954022d7-b5bf-4e40-9824-e11837661b57
parent cd6acd9f
#pragma once #pragma once
#include "Converter.h" #include "Converter.h"
#include "../../Common/DocxFormat/Source/SystemUtility/FileSystem/Directory.h"
typedef void (*load_from_resource)(void*, int, CString&); typedef void (*load_from_resource)(void*, int, CString&);
...@@ -58,14 +60,13 @@ namespace NSBinPptxRW ...@@ -58,14 +60,13 @@ namespace NSBinPptxRW
void Init(CString strFolder) void Init(CString strFolder)
{ {
m_strDstFolder = strFolder; m_strDstFolder = strFolder;
CDirectory::CreateDirectory(m_strDstFolder);
CDirectory::CreateDirectory(m_strDstFolder, _T("docProps"));
CString strPPT = m_strDstFolder + _T("\\ppt"); CString strPPT = m_strDstFolder + _T("\\ppt");
CDirectory::CreateDirectory(strPPT);
CDirectory::CreateDirectory(strPPT, _T("media")); FileSystem::Directory::CreateDirectory(m_strDstFolder);
FileSystem::Directory::CreateDirectory(m_strDstFolder, _T("docProps"));
FileSystem::Directory::CreateDirectory(strPPT);
FileSystem::Directory::CreateDirectory(strPPT, _T("media"));
m_oImageManager.Clear(); m_oImageManager.Clear();
m_oImageManager.SetDstMedia(m_strDstFolder + _T("\\ppt\\media")); m_oImageManager.SetDstMedia(m_strDstFolder + _T("\\ppt\\media"));
...@@ -83,7 +84,8 @@ namespace NSBinPptxRW ...@@ -83,7 +84,8 @@ namespace NSBinPptxRW
if (cur_pos == len || cur_pos == start_pos) if (cur_pos == len || cur_pos == start_pos)
return; return;
CString __str_ppty((LPSTR)(pBuffer + start_pos), cur_pos - start_pos);
CStringA __str_ppty((LPSTR)(pBuffer + start_pos), cur_pos - start_pos);
start_pos = cur_pos + 1; start_pos = cur_pos + 1;
cur_pos = start_pos; cur_pos = start_pos;
...@@ -93,7 +95,7 @@ namespace NSBinPptxRW ...@@ -93,7 +95,7 @@ namespace NSBinPptxRW
if (cur_pos == len || cur_pos == start_pos) if (cur_pos == len || cur_pos == start_pos)
return; return;
CString __str_version((LPSTR)(pBuffer + start_pos), cur_pos - start_pos); CStringA __str_version((LPSTR)(pBuffer + start_pos), cur_pos - start_pos);
start_pos = cur_pos + 1; start_pos = cur_pos + 1;
cur_pos = start_pos; cur_pos = start_pos;
...@@ -103,7 +105,7 @@ namespace NSBinPptxRW ...@@ -103,7 +105,7 @@ namespace NSBinPptxRW
if (cur_pos == len || cur_pos == start_pos) if (cur_pos == len || cur_pos == start_pos)
return; return;
CString __str_decode_len((LPSTR)(pBuffer + start_pos), cur_pos - start_pos); CStringA __str_decode_len((LPSTR)(pBuffer + start_pos), cur_pos - start_pos);
start_pos = cur_pos + 1; start_pos = cur_pos + 1;
pBuffer += start_pos; pBuffer += start_pos;
...@@ -260,8 +262,8 @@ namespace NSBinPptxRW ...@@ -260,8 +262,8 @@ namespace NSBinPptxRW
CString strFolder = m_strDstFolder + _T("\\ppt\\theme"); CString strFolder = m_strDstFolder + _T("\\ppt\\theme");
CString strFolderRels = strFolder + _T("\\_rels"); CString strFolderRels = strFolder + _T("\\_rels");
CDirectory::CreateDirectory(strFolder); FileSystem::Directory::CreateDirectory(strFolder);
CDirectory::CreateDirectory(strFolderRels); FileSystem::Directory::CreateDirectory(strFolderRels);
m_oReader.Seek(pPair->second); m_oReader.Seek(pPair->second);
m_oReader.Skip(4); m_oReader.Skip(4);
...@@ -300,8 +302,8 @@ namespace NSBinPptxRW ...@@ -300,8 +302,8 @@ namespace NSBinPptxRW
CString strFolder = m_strDstFolder + _T("\\ppt\\slideMasters"); CString strFolder = m_strDstFolder + _T("\\ppt\\slideMasters");
CString strFolderRels = strFolder + _T("\\_rels"); CString strFolderRels = strFolder + _T("\\_rels");
CDirectory::CreateDirectory(strFolder); FileSystem::Directory::CreateDirectory(strFolder);
CDirectory::CreateDirectory(strFolderRels); FileSystem::Directory::CreateDirectory(strFolderRels);
m_oReader.Seek(pPair->second); m_oReader.Seek(pPair->second);
m_oReader.Skip(4); m_oReader.Skip(4);
...@@ -352,8 +354,8 @@ namespace NSBinPptxRW ...@@ -352,8 +354,8 @@ namespace NSBinPptxRW
CString strFolder = m_strDstFolder + _T("\\ppt\\slideLayouts"); CString strFolder = m_strDstFolder + _T("\\ppt\\slideLayouts");
CString strFolderRels = strFolder + _T("\\_rels"); CString strFolderRels = strFolder + _T("\\_rels");
CDirectory::CreateDirectory(strFolder); FileSystem::Directory::CreateDirectory(strFolder);
CDirectory::CreateDirectory(strFolderRels); FileSystem::Directory::CreateDirectory(strFolderRels);
m_oReader.Seek(pPair->second); m_oReader.Seek(pPair->second);
m_oReader.Skip(4); m_oReader.Skip(4);
...@@ -387,12 +389,9 @@ namespace NSBinPptxRW ...@@ -387,12 +389,9 @@ namespace NSBinPptxRW
CString strFolder = m_strDstFolder + _T("\\ppt\\slides"); CString strFolder = m_strDstFolder + _T("\\ppt\\slides");
CString strFolderRels = strFolder + _T("\\_rels"); CString strFolderRels = strFolder + _T("\\_rels");
#ifdef WIN32 FileSystem::Directory::CreateDirectory (strFolder);
CDirectory::CreateDirectory(strFolder); FileSystem::Directory::CreateDirectory (strFolderRels);
CDirectory::CreateDirectory(strFolderRels);
#else
????
#endif
m_oReader.Seek(pPair->second); m_oReader.Seek(pPair->second);
m_oReader.Skip(4); m_oReader.Skip(4);
...@@ -410,7 +409,7 @@ namespace NSBinPptxRW ...@@ -410,7 +409,7 @@ namespace NSBinPptxRW
m_oReader.m_pRels->WriteSlideComments(nComment); m_oReader.m_pRels->WriteSlideComments(nComment);
if (1 == nComment) if (1 == nComment)
{ {
CDirectory::CreateDirectory(m_strDstFolder + _T("\\ppt\\comments")); FileSystem::Directory::CreateDirectory (m_strDstFolder + _T("\\ppt\\comments"));
} }
CString strCommentFile = _T(""); CString strCommentFile = _T("");
strCommentFile.Format(_T("\\ppt\\comments\\comment%d.xml"), nComment); strCommentFile.Format(_T("\\ppt\\comments\\comment%d.xml"), nComment);
...@@ -476,8 +475,8 @@ namespace NSBinPptxRW ...@@ -476,8 +475,8 @@ namespace NSBinPptxRW
CString strFolder = m_strDstFolder + _T("\\ppt\\notesSlides"); CString strFolder = m_strDstFolder + _T("\\ppt\\notesSlides");
CString strFolderRels = strFolder + _T("\\_rels"); CString strFolderRels = strFolder + _T("\\_rels");
CDirectory::CreateDirectory(strFolder); FileSystem::Directory::CreateDirectory (strFolder);
CDirectory::CreateDirectory(strFolderRels); FileSystem::Directory::CreateDirectory (strFolderRels);
LONG lCount = (LONG)m_arSlides.size(); LONG lCount = (LONG)m_arSlides.size();
for (LONG i = 0; i < lCount; ++i) for (LONG i = 0; i < lCount; ++i)
...@@ -591,7 +590,7 @@ namespace NSBinPptxRW ...@@ -591,7 +590,7 @@ namespace NSBinPptxRW
CString strFolder = m_strDstFolder + _T("\\ppt"); CString strFolder = m_strDstFolder + _T("\\ppt");
CString strFolderRels = strFolder + _T("\\_rels"); CString strFolderRels = strFolder + _T("\\_rels");
CDirectory::CreateDirectory(strFolderRels); FileSystem::Directory::CreateDirectory (strFolderRels);
m_oReader.Seek(pPair->second); m_oReader.Seek(pPair->second);
m_oPresentation.fromPPTY(&m_oReader); m_oPresentation.fromPPTY(&m_oReader);
...@@ -756,7 +755,7 @@ namespace NSBinPptxRW ...@@ -756,7 +755,7 @@ namespace NSBinPptxRW
<Relationship Id=\"rId2\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties\" Target=\"docProps/app.xml\"/>\ <Relationship Id=\"rId2\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties\" Target=\"docProps/app.xml\"/>\
</Relationships>"); </Relationships>");
CDirectory::CreateDirectory(m_strDstFolder + _T("\\_rels")); FileSystem::Directory::CreateDirectory (m_strDstFolder + _T("\\_rels"));
oFile.CreateFile(m_strDstFolder + _T("\\_rels\\.rels")); oFile.CreateFile(m_strDstFolder + _T("\\_rels\\.rels"));
oFile.WriteStringUTF8(strRELS); oFile.WriteStringUTF8(strRELS);
oFile.CloseFile(); oFile.CloseFile();
......
...@@ -32,6 +32,13 @@ namespace FileSystem { ...@@ -32,6 +32,13 @@ namespace FileSystem {
bool Directory::CreateDirectory(const String& path) { bool Directory::CreateDirectory(const String& path) {
return CreateDirectory(path.c_str()); return CreateDirectory(path.c_str());
} }
static bool CreateDirectory(String strFolderPathRoot, String strFolderName)
{
String strFolder = strFolderPathRoot;
strFolder =+ _T("/");
strFolder =+ strFolderName;
return CreateDirectory(strFolder);
}
bool Directory::CreateDirectories(LPCTSTR path) bool Directory::CreateDirectories(LPCTSTR path)
{ {
int codeResult = ERROR_SUCCESS; int codeResult = ERROR_SUCCESS;
......
...@@ -25,6 +25,7 @@ namespace FileSystem { ...@@ -25,6 +25,7 @@ namespace FileSystem {
static bool CreateDirectory(LPCTSTR path); static bool CreateDirectory(LPCTSTR path);
static bool CreateDirectory(const String& path); static bool CreateDirectory(const String& path);
static bool CreateDirectory(String strFolderPathRoot, String strFolderName);
static bool CreateDirectories(LPCTSTR path); static bool CreateDirectories(LPCTSTR path);
static StringArray GetFilesInDirectory(LPCTSTR path, const bool& andSubdirectories = false); static StringArray GetFilesInDirectory(LPCTSTR path, const bool& andSubdirectories = false);
......
...@@ -80,11 +80,15 @@ namespace FileSystem { ...@@ -80,11 +80,15 @@ namespace FileSystem {
bool Directory::CreateDirectory(const String& path) { bool Directory::CreateDirectory(const String& path) {
return CreateDirectory(path.c_str()); return CreateDirectory(path.c_str());
} }
bool CreateDirectory(String strFolderPathRoot, String strFolderName)
{
String strFolder = strFolderPathRoot;
strFolder =+ _T("/");
strFolder =+ strFolderName;
return CreateDirectory(strFolder);
}
bool Directory::CreateDirectories(LPCTSTR path) bool Directory::CreateDirectories(LPCTSTR path)
{ {
auto func = [] () { };
func(); // now call the function
std::wstring pathWstring; std::wstring pathWstring;
pathWstring = path; pathWstring = path;
std::string pathUtf8 = stringWstingToUtf8String (pathWstring); std::string pathUtf8 = stringWstingToUtf8String (pathWstring);
......
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