mirror of
https://github.com/microsoft/vcpkg.git
synced 2025-01-18 12:53:02 +08:00
Use Strings::EMPTY
This commit is contained in:
parent
03c4c7f8c4
commit
28e581599e
@ -187,7 +187,7 @@ namespace vcpkg
|
|||||||
{
|
{
|
||||||
return Util::fmap(depends, [&](const std::string& depend_string) -> Dependency {
|
return Util::fmap(depends, [&](const std::string& depend_string) -> Dependency {
|
||||||
auto pos = depend_string.find(' ');
|
auto pos = depend_string.find(' ');
|
||||||
if (pos == std::string::npos) return Dependency::parse_dependency(depend_string, "");
|
if (pos == std::string::npos) return Dependency::parse_dependency(depend_string, Strings::EMPTY);
|
||||||
// expect of the form "\w+ \[\w+\]"
|
// expect of the form "\w+ \[\w+\]"
|
||||||
Dependency dep;
|
Dependency dep;
|
||||||
|
|
||||||
@ -195,7 +195,7 @@ namespace vcpkg
|
|||||||
if (depend_string.c_str()[pos + 1] != '(' || depend_string[depend_string.size() - 1] != ')')
|
if (depend_string.c_str()[pos + 1] != '(' || depend_string[depend_string.size() - 1] != ')')
|
||||||
{
|
{
|
||||||
// Error, but for now just slurp the entire string.
|
// Error, but for now just slurp the entire string.
|
||||||
return Dependency::parse_dependency(depend_string, "");
|
return Dependency::parse_dependency(depend_string, Strings::EMPTY);
|
||||||
}
|
}
|
||||||
dep.qualifier = depend_string.substr(pos + 2, depend_string.size() - pos - 3);
|
dep.qualifier = depend_string.substr(pos + 2, depend_string.size() - pos - 3);
|
||||||
return dep;
|
return dep;
|
||||||
|
@ -222,17 +222,17 @@ namespace vcpkg
|
|||||||
|
|
||||||
void VcpkgCmdArguments::check_max_arg_count(const size_t expected_arg_count) const
|
void VcpkgCmdArguments::check_max_arg_count(const size_t expected_arg_count) const
|
||||||
{
|
{
|
||||||
return check_max_arg_count(expected_arg_count, "");
|
return check_max_arg_count(expected_arg_count, Strings::EMPTY);
|
||||||
}
|
}
|
||||||
|
|
||||||
void VcpkgCmdArguments::check_min_arg_count(const size_t expected_arg_count) const
|
void VcpkgCmdArguments::check_min_arg_count(const size_t expected_arg_count) const
|
||||||
{
|
{
|
||||||
return check_min_arg_count(expected_arg_count, "");
|
return check_min_arg_count(expected_arg_count, Strings::EMPTY);
|
||||||
}
|
}
|
||||||
|
|
||||||
void VcpkgCmdArguments::check_exact_arg_count(const size_t expected_arg_count) const
|
void VcpkgCmdArguments::check_exact_arg_count(const size_t expected_arg_count) const
|
||||||
{
|
{
|
||||||
return check_exact_arg_count(expected_arg_count, "");
|
return check_exact_arg_count(expected_arg_count, Strings::EMPTY);
|
||||||
}
|
}
|
||||||
|
|
||||||
void VcpkgCmdArguments::check_max_arg_count(const size_t expected_arg_count, const std::string& example_text) const
|
void VcpkgCmdArguments::check_max_arg_count(const size_t expected_arg_count, const std::string& example_text) const
|
||||||
|
@ -133,7 +133,7 @@ namespace vcpkg
|
|||||||
fs::path get_nuget_path(const fs::path& downloads_folder, const fs::path& scripts_folder)
|
fs::path get_nuget_path(const fs::path& downloads_folder, const fs::path& scripts_folder)
|
||||||
{
|
{
|
||||||
static constexpr std::array<int, 3> expected_version = {4, 1, 0};
|
static constexpr std::array<int, 3> expected_version = {4, 1, 0};
|
||||||
static const std::wstring version_check_arguments = L"";
|
static const std::wstring version_check_arguments = Strings::WEMPTY;
|
||||||
|
|
||||||
const fs::path downloaded_copy = downloads_folder / "nuget-4.1.0" / "nuget.exe";
|
const fs::path downloaded_copy = downloads_folder / "nuget-4.1.0" / "nuget.exe";
|
||||||
const std::vector<fs::path> from_path = find_from_PATH(L"nuget");
|
const std::vector<fs::path> from_path = find_from_PATH(L"nuget");
|
||||||
|
@ -30,8 +30,8 @@ namespace vcpkg::Build
|
|||||||
|
|
||||||
CWStringView to_vcvarsall_target(const std::string& cmake_system_name)
|
CWStringView to_vcvarsall_target(const std::string& cmake_system_name)
|
||||||
{
|
{
|
||||||
if (cmake_system_name == "") return L"";
|
if (cmake_system_name == Strings::EMPTY) return Strings::WEMPTY;
|
||||||
if (cmake_system_name == "Windows") return L"";
|
if (cmake_system_name == "Windows") return Strings::WEMPTY;
|
||||||
if (cmake_system_name == "WindowsStore") return L"store";
|
if (cmake_system_name == "WindowsStore") return L"store";
|
||||||
|
|
||||||
Checks::exit_with_message(VCPKG_LINE_INFO, "Unsupported vcvarsall target %s", cmake_system_name);
|
Checks::exit_with_message(VCPKG_LINE_INFO, "Unsupported vcvarsall target %s", cmake_system_name);
|
||||||
@ -61,7 +61,7 @@ namespace vcpkg::Build
|
|||||||
const wchar_t* tonull = L" >nul";
|
const wchar_t* tonull = L" >nul";
|
||||||
if (GlobalState::debugging)
|
if (GlobalState::debugging)
|
||||||
{
|
{
|
||||||
tonull = L"";
|
tonull = Strings::WEMPTY;
|
||||||
}
|
}
|
||||||
|
|
||||||
const auto arch = to_vcvarsall_toolchain(pre_build_info.target_architecture, toolset);
|
const auto arch = to_vcvarsall_toolchain(pre_build_info.target_architecture, toolset);
|
||||||
@ -359,7 +359,7 @@ namespace vcpkg::Build
|
|||||||
|
|
||||||
const bool variable_with_no_value = s.size() == 1;
|
const bool variable_with_no_value = s.size() == 1;
|
||||||
const std::string variable_name = s.at(0);
|
const std::string variable_name = s.at(0);
|
||||||
const std::string variable_value = variable_with_no_value ? "" : s.at(1);
|
const std::string variable_value = variable_with_no_value ? Strings::EMPTY : s.at(1);
|
||||||
|
|
||||||
if (variable_name == "VCPKG_TARGET_ARCHITECTURE")
|
if (variable_name == "VCPKG_TARGET_ARCHITECTURE")
|
||||||
{
|
{
|
||||||
|
@ -62,7 +62,7 @@ namespace vcpkg::Checks
|
|||||||
{
|
{
|
||||||
if (!expression)
|
if (!expression)
|
||||||
{
|
{
|
||||||
exit_with_message(line_info, "");
|
exit_with_message(line_info, Strings::EMPTY);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -30,7 +30,7 @@ namespace vcpkg::Parse
|
|||||||
}
|
}
|
||||||
std::string ParagraphParser::optional_field(const std::string& fieldname)
|
std::string ParagraphParser::optional_field(const std::string& fieldname)
|
||||||
{
|
{
|
||||||
return remove_field(&fields, fieldname).value_or("");
|
return remove_field(&fields, fieldname).value_or(Strings::EMPTY);
|
||||||
}
|
}
|
||||||
std::unique_ptr<ParseControlErrorInfo> ParagraphParser::error_info(const std::string& name) const
|
std::unique_ptr<ParseControlErrorInfo> ParagraphParser::error_info(const std::string& name) const
|
||||||
{
|
{
|
||||||
|
@ -133,7 +133,7 @@ namespace vcpkg::Strings
|
|||||||
trim(&s);
|
trim(&s);
|
||||||
}
|
}
|
||||||
|
|
||||||
Util::erase_remove_if(*strings, [](const std::string& s) { return s == ""; });
|
Util::erase_remove_if(*strings, [](const std::string& s) { return Strings::is_empty(s); });
|
||||||
}
|
}
|
||||||
|
|
||||||
std::vector<std::string> split(const std::string& s, const std::string& delimiter)
|
std::vector<std::string> split(const std::string& s, const std::string& delimiter)
|
||||||
|
@ -189,7 +189,7 @@ namespace vcpkg
|
|||||||
|
|
||||||
for (const std::unique_ptr<StatusParagraph>& pgh : status_db)
|
for (const std::unique_ptr<StatusParagraph>& pgh : status_db)
|
||||||
{
|
{
|
||||||
if (pgh->state != InstallState::INSTALLED || pgh->package.feature != "")
|
if (pgh->state != InstallState::INSTALLED || !Strings::is_empty(pgh->package.feature))
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user