diff options
| author | Alexander Karatarakis <alkarata@microsoft.com> | 2016-09-29 19:28:00 -0700 |
|---|---|---|
| committer | Alexander Karatarakis <alkarata@microsoft.com> | 2016-09-29 19:28:00 -0700 |
| commit | 8ed88af8c9cf2ed2e6fd573b2cd5dc2b41b55625 (patch) | |
| tree | 24ac9076f262e58f835a4a0f4bebaa02a336b512 /toolsrc/src | |
| parent | a4ab4fd24150e0c1341aa05192b6cc9c12c57c49 (diff) | |
| download | vcpkg-8ed88af8c9cf2ed2e6fd573b2cd5dc2b41b55625.tar.gz vcpkg-8ed88af8c9cf2ed2e6fd573b2cd5dc2b41b55625.zip | |
Rename wchar_t overload of Strings::format() to wformat()
Diffstat (limited to 'toolsrc/src')
| -rw-r--r-- | toolsrc/src/commands_create.cpp | 14 | ||||
| -rw-r--r-- | toolsrc/src/commands_edit.cpp | 2 | ||||
| -rw-r--r-- | toolsrc/src/commands_installation.cpp | 24 | ||||
| -rw-r--r-- | toolsrc/src/commands_integration.cpp | 4 | ||||
| -rw-r--r-- | toolsrc/src/metrics.cpp | 2 | ||||
| -rw-r--r-- | toolsrc/src/post_build_lint.cpp | 6 | ||||
| -rw-r--r-- | toolsrc/src/vcpkg_Environment.cpp | 22 | ||||
| -rw-r--r-- | toolsrc/src/vcpkg_System.cpp | 4 |
8 files changed, 39 insertions, 39 deletions
diff --git a/toolsrc/src/commands_create.cpp b/toolsrc/src/commands_create.cpp index 2712d3e6a..85b98d667 100644 --- a/toolsrc/src/commands_create.cpp +++ b/toolsrc/src/commands_create.cpp @@ -28,15 +28,15 @@ namespace vcpkg Checks::check_exit(!Files::has_invalid_chars_for_filesystem(zip_file_name), R"(Filename cannot contain invalid chars %s, but was %s)", Files::FILESYSTEM_INVALID_CHARACTERS, zip_file_name); - custom_filename = Strings::format(LR"( -DFILENAME="%s" )", Strings::utf8_to_utf16(zip_file_name)); + custom_filename = Strings::wformat(LR"( -DFILENAME="%s" )", Strings::utf8_to_utf16(zip_file_name)); } - const std::wstring cmdline = Strings::format(LR"(cmake -DCMD=CREATE -DPORT=%s -DTARGET_TRIPLET=%s -DURL=%s%s-P "%s")", - Strings::utf8_to_utf16(spec->name), - Strings::utf8_to_utf16(spec->target_triplet.value), - Strings::utf8_to_utf16(args.command_arguments.at(1)), - custom_filename, - paths.ports_cmake.generic_wstring()); + const std::wstring cmdline = Strings::wformat(LR"(cmake -DCMD=CREATE -DPORT=%s -DTARGET_TRIPLET=%s -DURL=%s%s-P "%s")", + Strings::utf8_to_utf16(spec->name), + Strings::utf8_to_utf16(spec->target_triplet.value), + Strings::utf8_to_utf16(args.command_arguments.at(1)), + custom_filename, + paths.ports_cmake.generic_wstring()); exit(System::cmd_execute(cmdline)); } diff --git a/toolsrc/src/commands_edit.cpp b/toolsrc/src/commands_edit.cpp index 71ae8b2c8..fe02bfa26 100644 --- a/toolsrc/src/commands_edit.cpp +++ b/toolsrc/src/commands_edit.cpp @@ -15,7 +15,7 @@ namespace vcpkg env_EDITOR = LR"(C:\Program Files (x86)\Microsoft VS Code\Code.exe)"; auto portpath = paths.ports / spec.name; - std::wstring cmdLine = Strings::format(LR"("%s" "%s" "%s")", env_EDITOR, portpath.native(), (portpath / "portfile.cmake").native()); + std::wstring cmdLine = Strings::wformat(LR"("%s" "%s" "%s")", env_EDITOR, portpath.native(), (portpath / "portfile.cmake").native()); exit(System::cmd_execute(cmdLine)); } } diff --git a/toolsrc/src/commands_installation.cpp b/toolsrc/src/commands_installation.cpp index e94791efa..2890184fb 100644 --- a/toolsrc/src/commands_installation.cpp +++ b/toolsrc/src/commands_installation.cpp @@ -22,12 +22,12 @@ namespace vcpkg static void build_internal(const package_spec& spec, const vcpkg_paths& paths, const fs::path& port_dir) { const fs::path ports_cmake_script_path = paths.ports_cmake; - const std::wstring command = Strings::format(LR"("%%VS140COMNTOOLS%%..\..\VC\vcvarsall.bat" %s && cmake -DCMD=BUILD -DPORT=%s -DTARGET_TRIPLET=%s "-DCURRENT_PORT_DIR=%s/." -P "%s")", - Strings::utf8_to_utf16(spec.target_triplet.architecture()), - Strings::utf8_to_utf16(spec.name), - Strings::utf8_to_utf16(spec.target_triplet.value), - port_dir.generic_wstring(), - ports_cmake_script_path.generic_wstring()); + const std::wstring command = Strings::wformat(LR"("%%VS140COMNTOOLS%%..\..\VC\vcvarsall.bat" %s && cmake -DCMD=BUILD -DPORT=%s -DTARGET_TRIPLET=%s "-DCURRENT_PORT_DIR=%s/." -P "%s")", + Strings::utf8_to_utf16(spec.target_triplet.architecture()), + Strings::utf8_to_utf16(spec.name), + Strings::utf8_to_utf16(spec.target_triplet.value), + port_dir.generic_wstring(), + ports_cmake_script_path.generic_wstring()); System::Stopwatch timer; timer.start(); @@ -39,12 +39,12 @@ namespace vcpkg { System::println(System::color::error, "Error: building package %s failed", to_string(spec)); System::println("Please ensure sure you're using the latest portfiles with `vcpkg update`, then\n" - "submit an issue at https://github.com/Microsoft/vcpkg/issues including:\n" - " Package: %s\n" - " Vcpkg version: %s\n" - "\n" - "Additionally, attach any relevant sections from the log files above." - , to_string(spec), version()); + "submit an issue at https://github.com/Microsoft/vcpkg/issues including:\n" + " Package: %s\n" + " Vcpkg version: %s\n" + "\n" + "Additionally, attach any relevant sections from the log files above." + , to_string(spec), version()); TrackProperty("error", "build failed"); TrackProperty("build_error", to_string(spec)); exit(EXIT_FAILURE); diff --git a/toolsrc/src/commands_integration.cpp b/toolsrc/src/commands_integration.cpp index aa10e210b..743a57a70 100644 --- a/toolsrc/src/commands_integration.cpp +++ b/toolsrc/src/commands_integration.cpp @@ -238,7 +238,7 @@ namespace vcpkg exit(EXIT_SUCCESS); } - const std::wstring cmd_line = Strings::format(LR"(DEL "%s")", get_appdata_targets_path().native()); + const std::wstring cmd_line = Strings::wformat(LR"(DEL "%s")", get_appdata_targets_path().native()); const int exit_code = System::cmd_execute(cmd_line); if (exit_code) { @@ -269,7 +269,7 @@ namespace vcpkg std::ofstream(nuspec_file_path) << create_nuspec_file(paths.root, nuget_id, nupkg_version); // Using all forward slashes for the command line - const std::wstring cmd_line = Strings::format(LR"(nuget.exe pack -OutputDirectory "%s" "%s" > nul)", buildsystems_dir.native(), nuspec_file_path.native()); + const std::wstring cmd_line = Strings::wformat(LR"(nuget.exe pack -OutputDirectory "%s" "%s" > nul)", buildsystems_dir.native(), nuspec_file_path.native()); const int exit_code = System::cmd_execute(cmd_line); diff --git a/toolsrc/src/metrics.cpp b/toolsrc/src/metrics.cpp index 610c71ed1..ada065fd6 100644 --- a/toolsrc/src/metrics.cpp +++ b/toolsrc/src/metrics.cpp @@ -419,7 +419,7 @@ true const fs::path vcpkg_metrics_txt_path = temp_folder_path / ("vcpkg" + GenerateRandomUUID() + ".txt"); std::ofstream(vcpkg_metrics_txt_path) << payload; - const std::wstring cmdLine = Strings::format(L"start %s %s", temp_folder_path_exe.native(), vcpkg_metrics_txt_path.native()); + const std::wstring cmdLine = Strings::wformat(L"start %s %s", temp_folder_path_exe.native(), vcpkg_metrics_txt_path.native()); System::cmd_execute(cmdLine); } } diff --git a/toolsrc/src/post_build_lint.cpp b/toolsrc/src/post_build_lint.cpp index 15e30ed4f..8bd9838c6 100644 --- a/toolsrc/src/post_build_lint.cpp +++ b/toolsrc/src/post_build_lint.cpp @@ -219,7 +219,7 @@ namespace vcpkg std::vector<fs::path> dlls_with_no_exports; for (const fs::path& dll : dlls) { - const std::wstring cmd_line = Strings::format(LR"("%s" /exports "%s")", DUMPBIN_EXE.native(), dll.native()); + const std::wstring cmd_line = Strings::wformat(LR"("%s" /exports "%s")", DUMPBIN_EXE.native(), dll.native()); System::exit_code_and_output ec_data = System::cmd_execute_and_capture_output(cmd_line); Checks::check_exit(ec_data.exit_code == 0, "Running command:\n %s\n failed", Strings::utf16_to_utf8(cmd_line)); @@ -250,7 +250,7 @@ namespace vcpkg std::vector<fs::path> dlls_with_improper_uwp_bit; for (const fs::path& dll : dlls) { - const std::wstring cmd_line = Strings::format(LR"("%s" /headers "%s")", DUMPBIN_EXE.native(), dll.native()); + const std::wstring cmd_line = Strings::wformat(LR"("%s" /headers "%s")", DUMPBIN_EXE.native(), dll.native()); System::exit_code_and_output ec_data = System::cmd_execute_and_capture_output(cmd_line); Checks::check_exit(ec_data.exit_code == 0, "Running command:\n %s\n failed", Strings::utf16_to_utf8(cmd_line)); @@ -282,7 +282,7 @@ namespace vcpkg std::vector<file_and_arch> binaries_with_invalid_architecture; for (const fs::path& f : files) { - const std::wstring cmd_line = Strings::format(LR"("%s" /headers "%s" | findstr machine)", DUMPBIN_EXE.native(), f.native()); + const std::wstring cmd_line = Strings::wformat(LR"("%s" /headers "%s" | findstr machine)", DUMPBIN_EXE.native(), f.native()); System::exit_code_and_output ec_data = System::cmd_execute_and_capture_output(cmd_line); Checks::check_exit(ec_data.exit_code == 0, "Running command:\n %s\n failed", Strings::utf16_to_utf8(cmd_line)); diff --git a/toolsrc/src/vcpkg_Environment.cpp b/toolsrc/src/vcpkg_Environment.cpp index f70f2b893..d98b0f220 100644 --- a/toolsrc/src/vcpkg_Environment.cpp +++ b/toolsrc/src/vcpkg_Environment.cpp @@ -48,11 +48,11 @@ namespace vcpkg {namespace Environment void ensure_git_on_path(const vcpkg_paths& paths) { const fs::path downloaded_git = paths.downloads / "PortableGit" / "cmd"; - const std::wstring path_buf = Strings::format(L"%s;%s;%s;%s", - downloaded_git.native(), - System::wdupenv_str(L"PATH"), - default_git_installation_dir.native(), - default_git_installation_dir_x86.native()); + const std::wstring path_buf = Strings::wformat(L"%s;%s;%s;%s", + downloaded_git.native(), + System::wdupenv_str(L"PATH"), + default_git_installation_dir.native(), + default_git_installation_dir_x86.native()); _wputenv_s(L"PATH", path_buf.c_str()); static constexpr std::array<int, 3> git_version = {2,0,0}; @@ -63,11 +63,11 @@ namespace vcpkg {namespace Environment void ensure_cmake_on_path(const vcpkg_paths& paths) { const fs::path downloaded_cmake = paths.downloads / "cmake-3.5.2-win32-x86" / "bin"; - const std::wstring path_buf = Strings::format(L"%s;%s;%s;%s", - downloaded_cmake.native(), - System::wdupenv_str(L"PATH"), - default_cmake_installation_dir.native(), - default_cmake_installation_dir_x86.native()); + const std::wstring path_buf = Strings::wformat(L"%s;%s;%s;%s", + downloaded_cmake.native(), + System::wdupenv_str(L"PATH"), + default_cmake_installation_dir.native(), + default_cmake_installation_dir_x86.native()); _wputenv_s(L"PATH", path_buf.c_str()); static constexpr std::array<int, 3> cmake_version = {3,5,0}; @@ -77,7 +77,7 @@ namespace vcpkg {namespace Environment void ensure_nuget_on_path(const vcpkg_paths& paths) { - const std::wstring path_buf = Strings::format(L"%s;%s", paths.downloads.native(), System::wdupenv_str(L"PATH")); + const std::wstring path_buf = Strings::wformat(L"%s;%s", paths.downloads.native(), System::wdupenv_str(L"PATH")); _wputenv_s(L"PATH", path_buf.c_str()); static constexpr std::array<int, 3> nuget_version = {1,0,0}; diff --git a/toolsrc/src/vcpkg_System.cpp b/toolsrc/src/vcpkg_System.cpp index 71b4087d2..4dc37857d 100644 --- a/toolsrc/src/vcpkg_System.cpp +++ b/toolsrc/src/vcpkg_System.cpp @@ -19,14 +19,14 @@ namespace vcpkg {namespace System int cmd_execute(const wchar_t* cmd_line) { // Basically we are wrapping it in quotes - const std::wstring& actual_cmd_line = Strings::format(LR"###("%s")###", cmd_line); + const std::wstring& actual_cmd_line = Strings::wformat(LR"###("%s")###", cmd_line); int exit_code = _wsystem(actual_cmd_line.c_str()); return exit_code; } exit_code_and_output cmd_execute_and_capture_output(const wchar_t* cmd_line) { - const std::wstring& actual_cmd_line = Strings::format(LR"###("%s")###", cmd_line); + const std::wstring& actual_cmd_line = Strings::wformat(LR"###("%s")###", cmd_line); std::string output; char buf[1024]; |
