новая схема (несколько скриптов)

This commit is contained in:
Oleg Korshul
2016-05-10 18:35:16 +03:00
committed by Alexander Trofimov
parent 65d37bb2d3
commit 1ae20da785
3 changed files with 102 additions and 35 deletions

View File

@ -117,13 +117,36 @@ static void GetScriptsPath(NSStringUtils::CStringBuilder& oBuilder)
}
}
std::wstring sPath = oNode.ReadValueString(L"DoctSdk");
if (!NSFile::CFileBinary::Exists(sPath) || NSFile::CFileBinary::Exists(sProcess + sPath))
sPath = sProcess + sPath;
XmlUtils::CXmlNode oNodeSdk = oNode.ReadNode(L"DoctSdk");
XmlUtils::CXmlNodes oNodes;
if (oNodeSdk.GetNodes(L"file", oNodes))
{
int nCount = oNodes.GetCount();
XmlUtils::CXmlNode _node;
for (int i = 0; i < nCount; ++i)
{
oNodes.GetAt(i, _node);
std::wstring sPath = _node.GetText();
oBuilder.WriteString(L"<sdk>");
oBuilder.WriteEncodeXmlString(CorrectHtmlPath(sPath));
oBuilder.WriteString(L"</sdk>");
if (!NSFile::CFileBinary::Exists(sPath) || NSFile::CFileBinary::Exists(sProcess + sPath))
sPath = sProcess + sPath;
oBuilder.WriteString(L"<sdk>");
oBuilder.WriteEncodeXmlString(CorrectHtmlPath(sPath));
oBuilder.WriteString(L"</sdk>");
}
}
else
{
std::wstring sPath = oNodeSdk.GetText();
if (!NSFile::CFileBinary::Exists(sPath) || NSFile::CFileBinary::Exists(sProcess + sPath))
sPath = sProcess + sPath;
oBuilder.WriteString(L"<sdk>");
oBuilder.WriteEncodeXmlString(CorrectHtmlPath(sPath));
oBuilder.WriteString(L"</sdk>");
}
}
int CHtmlFile::Convert(const std::vector<std::wstring>& arFiles, const std::wstring& sDstfolder, const std::wstring& sPathInternal)
@ -214,11 +237,31 @@ int CHtmlFile::Convert(const std::vector<std::wstring>& arFiles, const std::wstr
NULL, NULL, TRUE, CREATE_UNICODE_ENVIRONMENT, (LPVOID)pCommandLineEnv, NULL, &sturtupinfo, &processinfo);
#else
HANDLE ghJob = CreateJobObject(NULL, NULL);
if (ghJob)
{
JOBOBJECT_EXTENDED_LIMIT_INFORMATION jeli = { 0 };
// Configure all child processes associated with the job to terminate when the
jeli.BasicLimitInformation.LimitFlags = JOB_OBJECT_LIMIT_KILL_ON_JOB_CLOSE;
if ( 0 == SetInformationJobObject( ghJob, JobObjectExtendedLimitInformation, &jeli, sizeof(jeli)))
{
CloseHandle(ghJob);
ghJob = NULL;
}
}
PROCESS_INFORMATION processinfo;
ZeroMemory(&processinfo,sizeof(PROCESS_INFORMATION));
BOOL bResult = CreateProcessW(sInternal.c_str(), pCommandLine,
NULL, NULL, TRUE, NULL, NULL, NULL, &sturtupinfo, &processinfo);
if (bResult && ghJob)
{
AssignProcessToJobObject(ghJob, processinfo.hProcess);
}
#endif
::WaitForSingleObject(processinfo.hProcess, INFINITE);

View File

@ -24,7 +24,7 @@ CONFIG += c++11
TEMPLATE = app
############### destination path ###############
DESTINATION_SDK_PATH = $$PWD/../../SDK/lib
DESTINATION_SDK_PATH = $$PWD/../../build/lib
# WINDOWS
win32:contains(QMAKE_TARGET.arch, x86_64):{
@ -56,8 +56,8 @@ LIBS += -L$$DESTINATION_SDK_PATH -lgraphics
linux-g++ | linux-g++-64 | linux-g++-32 {
QMAKE_LFLAGS += -Wl,--rpath=./
LIBS += $$PWD/../../UnicodeConverter/icubuilds/linux64/usr/local/lib/libicuuc.so.55
LIBS += $$PWD/../../UnicodeConverter/icubuilds/linux64/usr/local/lib/libicudata.so.55
LIBS += $$PWD/../../build/bin/icu/linux_64/libicuuc.so.55
LIBS += $$PWD/../../build/bin/icu/linux_64/libicudata.so.55
message(linux)
}