|
|
|
@ -4,6 +4,7 @@
|
|
|
|
|
#include "log.h"
|
|
|
|
|
#include "string_util.h"
|
|
|
|
|
#include <algorithm>
|
|
|
|
|
#include <cstdlib>
|
|
|
|
|
#include <cstring>
|
|
|
|
|
|
|
|
|
|
#ifdef __APPLE__
|
|
|
|
@ -313,6 +314,33 @@ std::string_view GetFileTitleFromPath(const char* path)
|
|
|
|
|
return std::string_view(path);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
std::vector<std::string> GetRootDirectoryList()
|
|
|
|
|
{
|
|
|
|
|
std::vector<std::string> results;
|
|
|
|
|
|
|
|
|
|
#ifdef WIN32
|
|
|
|
|
char buf[256];
|
|
|
|
|
if (GetLogicalDriveStringsA(sizeof(buf), buf) != 0)
|
|
|
|
|
{
|
|
|
|
|
const char* ptr = buf;
|
|
|
|
|
while (*ptr != '\0')
|
|
|
|
|
{
|
|
|
|
|
const std::size_t len = std::strlen(ptr);
|
|
|
|
|
results.emplace_back(ptr, len);
|
|
|
|
|
ptr += len + 1u;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
#else
|
|
|
|
|
const char* home_path = std::getenv("HOME");
|
|
|
|
|
if (home_path)
|
|
|
|
|
results.push_back(home_path);
|
|
|
|
|
|
|
|
|
|
results.push_back("/");
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
return results;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void BuildPathRelativeToFile(char* Destination, u32 cbDestination, const char* CurrentFileName, const char* NewFileName,
|
|
|
|
|
bool OSPath /* = true */, bool Canonicalize /* = true */)
|
|
|
|
|
{
|
|
|
|
|