mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-03-19 20:20:00 +01:00
Remove no longer necessary WinCmdLineArgs class
This change removes one use case of `std::wstring_convert`, which is deprecated in C++17 and removed in C++26. Other uses remain for now.
This commit is contained in:
@@ -19,8 +19,6 @@
|
||||
#include <util/string.h>
|
||||
|
||||
#ifdef WIN32
|
||||
#include <codecvt>
|
||||
#include <shellapi.h>
|
||||
#include <shlobj.h>
|
||||
#endif
|
||||
|
||||
@@ -879,30 +877,3 @@ void ArgsManager::LogArgs() const
|
||||
}
|
||||
logArgsPrefix("Command-line arg:", "", m_settings.command_line_options);
|
||||
}
|
||||
|
||||
namespace common {
|
||||
#ifdef WIN32
|
||||
WinCmdLineArgs::WinCmdLineArgs()
|
||||
{
|
||||
wchar_t** wargv = CommandLineToArgvW(GetCommandLineW(), &argc);
|
||||
std::wstring_convert<std::codecvt_utf8_utf16<wchar_t>, wchar_t> utf8_cvt;
|
||||
argv = new char*[argc];
|
||||
args.resize(argc);
|
||||
for (int i = 0; i < argc; i++) {
|
||||
args[i] = utf8_cvt.to_bytes(wargv[i]);
|
||||
argv[i] = &*args[i].begin();
|
||||
}
|
||||
LocalFree(wargv);
|
||||
}
|
||||
|
||||
WinCmdLineArgs::~WinCmdLineArgs()
|
||||
{
|
||||
delete[] argv;
|
||||
}
|
||||
|
||||
std::pair<int, char**> WinCmdLineArgs::get()
|
||||
{
|
||||
return std::make_pair(argc, argv);
|
||||
}
|
||||
#endif
|
||||
} // namespace common
|
||||
|
||||
Reference in New Issue
Block a user