mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-04-29 14:59:39 -04: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:
parent
ce7f41c01b
commit
78a0c238ec
6 changed files with 0 additions and 44 deletions
|
@ -1313,8 +1313,6 @@ static int CommandLineRPC(int argc, char *argv[])
|
|||
MAIN_FUNCTION
|
||||
{
|
||||
#ifdef WIN32
|
||||
common::WinCmdLineArgs winArgs;
|
||||
std::tie(argc, argv) = winArgs.get();
|
||||
common::WindowsScopedCodePage windows_terminal_output_code_page{CP_UTF8};
|
||||
#endif
|
||||
SetupEnvironment();
|
||||
|
|
|
@ -98,8 +98,6 @@ MAIN_FUNCTION
|
|||
{
|
||||
ArgsManager& args = gArgs;
|
||||
#ifdef WIN32
|
||||
common::WinCmdLineArgs winArgs;
|
||||
std::tie(argc, argv) = winArgs.get();
|
||||
common::WindowsScopedCodePage windows_terminal_output_code_page{CP_UTF8};
|
||||
#endif
|
||||
|
||||
|
|
|
@ -255,8 +255,6 @@ static bool AppInit(NodeContext& node)
|
|||
MAIN_FUNCTION
|
||||
{
|
||||
#ifdef WIN32
|
||||
common::WinCmdLineArgs winArgs;
|
||||
std::tie(argc, argv) = winArgs.get();
|
||||
common::WindowsScopedCodePage windows_terminal_output_code_page{CP_UTF8};
|
||||
#endif
|
||||
|
||||
|
|
|
@ -867,29 +867,6 @@ void ArgsManager::LogArgs() const
|
|||
|
||||
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);
|
||||
}
|
||||
|
||||
WindowsScopedCodePage::WindowsScopedCodePage(UINT new_console_outp_code_page)
|
||||
: m_original_code_page{GetConsoleOutputCP()}
|
||||
{
|
||||
|
|
|
@ -480,19 +480,6 @@ std::string HelpMessageOpt(const std::string& option, const std::string& message
|
|||
|
||||
namespace common {
|
||||
#ifdef WIN32
|
||||
class WinCmdLineArgs
|
||||
{
|
||||
public:
|
||||
WinCmdLineArgs();
|
||||
~WinCmdLineArgs();
|
||||
std::pair<int, char**> get();
|
||||
|
||||
private:
|
||||
int argc;
|
||||
char** argv;
|
||||
std::vector<std::string> args;
|
||||
};
|
||||
|
||||
/**
|
||||
* A RAII-style class for temporarily changing the terminal output code page during runtime.
|
||||
*/
|
||||
|
|
|
@ -479,8 +479,6 @@ static void SetupUIArgs(ArgsManager& argsman)
|
|||
int GuiMain(int argc, char* argv[])
|
||||
{
|
||||
#ifdef WIN32
|
||||
common::WinCmdLineArgs winArgs;
|
||||
std::tie(argc, argv) = winArgs.get();
|
||||
common::WindowsScopedCodePage windows_terminal_output_code_page{CP_UTF8};
|
||||
#endif
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue