mirror of
https://github.com/kidfromjupiter/nearby.git
synced 2026-09-16 15:36:12 -04:00
Update wstring converter
PiperOrigin-RevId: 682112846
This commit is contained in:
committed by
Copybara-Service
parent
ab00092c6c
commit
25d4aca219
@@ -69,6 +69,7 @@
|
||||
#include "internal/platform/implementation/windows/preferences_manager.h"
|
||||
#include "internal/platform/implementation/windows/scheduled_executor.h"
|
||||
#include "internal/platform/implementation/windows/server_sync.h"
|
||||
#include "internal/platform/implementation/windows/string_utils.h"
|
||||
#include "internal/platform/implementation/windows/submittable_executor.h"
|
||||
#include "internal/platform/implementation/windows/timer.h"
|
||||
#include "internal/platform/implementation/windows/utils.h"
|
||||
@@ -114,28 +115,28 @@ std::string GetApplicationName(DWORD pid) {
|
||||
|
||||
std::string ImplementationPlatform::GetCustomSavePath(
|
||||
const std::string& parent_folder, const std::string& file_name) {
|
||||
auto parent = windows::string_to_wstring(parent_folder);
|
||||
auto file = windows::string_to_wstring(file_name);
|
||||
auto parent = windows::string_utils::StringToWideString(parent_folder);
|
||||
auto file = windows::string_utils::StringToWideString(file_name);
|
||||
|
||||
return windows::wstring_to_string(
|
||||
return windows::string_utils::WideStringToString(
|
||||
windows::FilePath::GetCustomSavePath(parent, file));
|
||||
}
|
||||
|
||||
std::string ImplementationPlatform::GetDownloadPath(
|
||||
const std::string& parent_folder, const std::string& file_name) {
|
||||
auto parent = windows::string_to_wstring(std::string(parent_folder));
|
||||
auto file = windows::string_to_wstring(std::string(file_name));
|
||||
auto parent = windows::string_utils::StringToWideString(parent_folder);
|
||||
auto file = windows::string_utils::StringToWideString(file_name);
|
||||
|
||||
return windows::wstring_to_string(
|
||||
return windows::string_utils::WideStringToString(
|
||||
windows::FilePath::GetDownloadPath(parent, file));
|
||||
}
|
||||
|
||||
std::string ImplementationPlatform::GetDownloadPath(
|
||||
const std::string& file_name) {
|
||||
std::wstring fake_parent_path;
|
||||
auto file = windows::string_to_wstring(std::string(file_name));
|
||||
auto file = windows::string_utils::StringToWideString(file_name);
|
||||
|
||||
return windows::wstring_to_string(
|
||||
return windows::string_utils::WideStringToString(
|
||||
windows::FilePath::GetDownloadPath(fake_parent_path, file));
|
||||
}
|
||||
|
||||
@@ -229,8 +230,8 @@ std::unique_ptr<OutputFile> ImplementationPlatform::CreateOutputFile(
|
||||
const std::string& file_path) {
|
||||
std::string path(file_path);
|
||||
|
||||
auto folder_path =
|
||||
windows::string_to_wstring(path.substr(0, path.find_last_of('/')));
|
||||
auto folder_path = windows::string_utils::StringToWideString(
|
||||
path.substr(0, path.find_last_of('/')));
|
||||
// Verifies that a path is a valid directory.
|
||||
// https://docs.microsoft.com/en-us/windows/win32/api/shlwapi/nf-shlwapi-pathisdirectoryw
|
||||
if (!PathIsDirectoryW(folder_path.data())) {
|
||||
|
||||
Reference in New Issue
Block a user