mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-03 14:45:12 -04:00
Removed the difference of the separator for Linux and Windows.
Removed extra "/" of the filename (e.g. "E://") of the hashed file when sharing a whole drive. Recompile of the gui needed. git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@4200 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
00c1bfcf54
commit
72d9f352e3
12 changed files with 66 additions and 65 deletions
|
@ -14,7 +14,7 @@ FolderIterator::FolderIterator(const std::string& folderName)
|
|||
return;
|
||||
}
|
||||
|
||||
utf16Name += L"\\*.*";
|
||||
utf16Name += L"/*.*";
|
||||
|
||||
handle = FindFirstFileW(utf16Name.c_str(), &fileInfo);
|
||||
validity = handle != INVALID_HANDLE_VALUE;
|
||||
|
|
|
@ -743,6 +743,28 @@ FILE *RsDirUtil::rs_fopen(const char* filename, const char* mode)
|
|||
#endif
|
||||
}
|
||||
|
||||
std::string RsDirUtil::convertPathToUnix(std::string path)
|
||||
{
|
||||
for (unsigned int i = 0; i < path.length(); i++)
|
||||
{
|
||||
if (path[i] == '\\')
|
||||
path[i] = '/';
|
||||
}
|
||||
return path;
|
||||
}
|
||||
|
||||
std::string RsDirUtil::makePath(const std::string &path1, const std::string &path2)
|
||||
{
|
||||
std::string path = path1;
|
||||
|
||||
if (path.empty() == false && *path.rbegin() != '/') {
|
||||
path += "/";
|
||||
}
|
||||
path += path2;
|
||||
|
||||
return path;
|
||||
}
|
||||
|
||||
#if 0 // NOT ENABLED YET!
|
||||
/************************* WIDE STRING ***************************/
|
||||
/************************* WIDE STRING ***************************/
|
||||
|
|
|
@ -92,6 +92,9 @@ bool getWideFileHash(std::wstring filepath,
|
|||
std::string &hash, uint64_t &size);
|
||||
|
||||
FILE *rs_fopen(const char* filename, const char* mode);
|
||||
|
||||
std::string convertPathToUnix(std::string path);
|
||||
std::string makePath(const std::string &path1, const std::string &path2);
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue