mirror of
https://port.numenaute.org/aleajactaest/khanat-code-old.git
synced 2024-11-18 13:21:40 +00:00
Merge
This commit is contained in:
commit
148e734329
2 changed files with 13 additions and 13 deletions
|
@ -61,19 +61,19 @@ namespace STAT_GLOBALS
|
||||||
NLMISC::CSString getInputFilePath(const NLMISC::CSString& path)
|
NLMISC::CSString getInputFilePath(const NLMISC::CSString& path)
|
||||||
{
|
{
|
||||||
NLMISC::CSString pathRoot= NLMISC::CPath::standardizePath(InputFileDirectory.get());
|
NLMISC::CSString pathRoot= NLMISC::CPath::standardizePath(InputFileDirectory.get());
|
||||||
return (path.left((uint)pathRoot.size())==pathRoot)? path: pathRoot+path;
|
return path.left((uint)pathRoot.size()) == pathRoot ? path:pathRoot+path;
|
||||||
}
|
}
|
||||||
|
|
||||||
NLMISC::CSString getScriptFilePath(const NLMISC::CSString& path)
|
NLMISC::CSString getScriptFilePath(const NLMISC::CSString& path)
|
||||||
{
|
{
|
||||||
NLMISC::CSString pathRoot= NLMISC::CPath::standardizePath(ScriptDirectory.get());
|
NLMISC::CSString pathRoot= NLMISC::CPath::standardizePath(ScriptDirectory.get());
|
||||||
return (path.left((uint)pathRoot.size())==pathRoot)? path: pathRoot+path;
|
return path.left((uint)pathRoot.size()) == pathRoot ? path:pathRoot+path;
|
||||||
}
|
}
|
||||||
|
|
||||||
NLMISC::CSString getOutputFilePath(const NLMISC::CSString& path)
|
NLMISC::CSString getOutputFilePath(const NLMISC::CSString& path)
|
||||||
{
|
{
|
||||||
NLMISC::CSString pathRoot= NLMISC::CPath::standardizePath(OutputDirectory.get());
|
NLMISC::CSString pathRoot= NLMISC::CPath::standardizePath(OutputDirectory.get());
|
||||||
return (path.left((uint)pathRoot.size())==pathRoot)? path: pathRoot+path;
|
return path.left((uint)pathRoot.size()) == pathRoot ? path:pathRoot+path;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -86,7 +86,7 @@ void GenerateLZMA(const std::string sourceFile, const std::string &outputFile)
|
||||||
_spawnlp(_P_WAIT, "lzma.exe","lzma.exe", "e", sourceFile.c_str(), outputFile.c_str(), NULL);
|
_spawnlp(_P_WAIT, "lzma.exe","lzma.exe", "e", sourceFile.c_str(), outputFile.c_str(), NULL);
|
||||||
#else // NL_OS_WINDOWS
|
#else // NL_OS_WINDOWS
|
||||||
// new lzma only supports one file name on command line, so make a copy
|
// new lzma only supports one file name on command line, so make a copy
|
||||||
CFile::copyFile(sourceFile, outputFile);
|
CFile::copyFile(outputFile, sourceFile);
|
||||||
|
|
||||||
// new lzma syntax, -z = compress, -9 = best compression
|
// new lzma syntax, -z = compress, -9 = best compression
|
||||||
std::string cmd = NLMISC::toString("lzma -z -9 %s", outputFile.c_str());
|
std::string cmd = NLMISC::toString("lzma -z -9 %s", outputFile.c_str());
|
||||||
|
@ -102,7 +102,7 @@ void GenerateLZMA(const std::string sourceFile, const std::string &outputFile)
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// lzma always append a .lzma extension, so rename compressed file to wanted one
|
// lzma always append a .lzma extension, so rename compressed file to wanted one
|
||||||
CFile::moveFile(outputFile + ".lzma", outputFile);
|
CFile::moveFile(outputFile, outputFile + ".lzma");
|
||||||
}
|
}
|
||||||
#endif // NL_OS_WINDOWS
|
#endif // NL_OS_WINDOWS
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue