ccls/src/platform_win.cc

45 lines
952 B
C++
Raw Normal View History

2017-03-19 22:06:22 +00:00
#if defined(_WIN32)
#include "platform.h"
2017-03-25 20:27:28 +00:00
#include "utils.h"
2017-09-22 01:14:57 +00:00
#include <Windows.h>
#include <direct.h>
2017-03-25 20:27:28 +00:00
#include <fcntl.h>
#include <io.h>
#include <sys/stat.h>
2017-09-22 01:14:57 +00:00
#include <sys/types.h>
2017-03-29 06:33:38 +00:00
#include <algorithm>
2017-03-19 22:06:22 +00:00
#include <cassert>
#include <string>
2017-03-28 05:27:06 +00:00
std::string NormalizePath(const std::string& path) {
DWORD retval = 0;
TCHAR buffer[MAX_PATH] = TEXT("");
2017-09-22 01:14:57 +00:00
TCHAR** lpp_part = {NULL};
2017-03-28 05:27:06 +00:00
retval = GetFullPathName(path.c_str(), MAX_PATH, buffer, lpp_part);
// fail, return original
if (retval == 0)
return path;
2017-03-29 06:33:38 +00:00
std::string result = buffer;
std::replace(result.begin(), result.end(), '\\', '/');
2017-09-22 01:14:57 +00:00
// std::transform(result.begin(), result.end(), result.begin(), ::tolower);
2017-03-29 06:33:38 +00:00
return result;
}
2017-08-17 18:02:47 +00:00
void FreeUnusedMemory() {}
// TODO Wait for debugger to attach
2018-01-11 02:43:01 +00:00
void TraceMe() {}
std::string GetExternalCommandOutput(const std::vector<std::string>& command,
std::string_view input) {
return "";
}
2017-03-19 22:06:22 +00:00
#endif