1
0

Path fixes

This commit is contained in:
Scott E. Graves
2017-03-23 01:09:08 -05:00
parent d0b43261ed
commit 7d7ae6d886
5 changed files with 24 additions and 13 deletions

View File

@@ -1,16 +1,16 @@
@echo off
set ROOT=%~dp0%
pushd "%ROOT%"
set ROOT1=%~dp0%
pushd "%ROOT1%"
call build_common.cmd
set CMAKE=%ROOT%bin\cmake-3.7.2-win64-x64\bin\cmake
set CMAKE=%ROOT1%bin\cmake-3.7.2-win64-x64\bin\cmake
call 3rd_party\CEF\create.cmd Debug
mkdir build
mkdir build\debug
pushd build\debug
%CMAKE% -G "Visual Studio 14 2015 Win64" -DCMAKE_BUILD_TYPE=Debug -DSIADRIVE_INSTALL_FOLDER="%ROOT%dist\Debug" ..\..
%CMAKE% -G "Visual Studio 14 2015 Win64" -DCMAKE_BUILD_TYPE=Debug -DSIADRIVE_INSTALL_FOLDER="%ROOT1%dist\Debug" ..\..
%CMAKE% --build . --config Debug && %CMAKE% --build . --target install --config Debug
popd

View File

@@ -1,16 +1,16 @@
@echo off
set ROOT=%~dp0%
pushd "%ROOT%"
set ROOT1=%~dp0%
pushd "%ROOT1%"
call build_common.cmd
set CMAKE=%ROOT%bin\cmake-3.7.2-win64-x64\bin\cmake
set CMAKE=%ROOT1%bin\cmake-3.7.2-win64-x64\bin\cmake
call 3rd_party\CEF\create.cmd Release
mkdir build
mkdir build\release
pushd build\release
%CMAKE% -G "Visual Studio 14 2015 Win64" -DCMAKE_BUILD_TYPE=Release -DSIADRIVE_INSTALL_FOLDER="%ROOT%dist\Release" ..\..
%CMAKE% -G "Visual Studio 14 2015 Win64" -DCMAKE_BUILD_TYPE=Release -DSIADRIVE_INSTALL_FOLDER="%ROOT1%dist\Release" ..\..
%CMAKE% --build . --config Release && %CMAKE% --build . --config Release --target install
popd

View File

@@ -40,6 +40,7 @@ public:
bool MoveFile(const FilePath& filePath);
FilePath& RemoveFileName();
FilePath& MakeAbsolute();
FilePath& SkipRoot();
public:
FilePath& operator=(const FilePath& filePath);

View File

@@ -176,6 +176,17 @@ FilePath& FilePath::RemoveFileName()
#endif
}
FilePath& FilePath::SkipRoot()
{
#ifdef _WIN32
::PathSkipRoot(&_path[0]);
_path = _path.str().c_str();
return *this;
#else
a
#endif
}
FilePath& FilePath::operator=(const FilePath& filePath)
{
if (this != &filePath)

View File

@@ -221,7 +221,7 @@ private:
else // File (cache and/or Sia operation)
{
// Formulate Sia path and cache path
SString siaPath = CSiaApi::FormatToSiaPath(FilePath(FileName).RemoveFileName()); // Strip drive letter to get Sia path
SString siaPath = CSiaApi::FormatToSiaPath(FilePath(FileName).SkipRoot()); // Strip drive letter to get Sia path
if (siaPath.Length())
{
// If cache file already exists and is a directory, requested file operation isn't valid
@@ -393,19 +393,18 @@ private:
auto siaFileTree = _siaFileTree;
if (siaFileTree)
{
SString siaQuery = CSiaApi::FormatToSiaPath(FilePath(FileName).RemoveFileName());
SString siaQuery = CSiaApi::FormatToSiaPath(FilePath(FileName).SkipRoot());
FilePath cachePath;
FilePath cachePath = GetCacheLocation();;
FilePath rootPath = siaQuery;
if (FilePath::DirSep == FileName)
{
cachePath = GetCacheLocation();
siaQuery += L"/*.*";
}
else
{
cachePath.Append(&FileName[1]);
if (::GetFileAttributes(&cachePath[0]) & FILE_ATTRIBUTE_DIRECTORY)
if (cachePath.IsDirectory())
{
siaQuery += L"/*.*";
}