From f3d803addfb3d84d828786d2e6b0b8a34f2fc494 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Mon, 28 Aug 2017 18:54:48 -0700 Subject: [PATCH] Introduce Strings::is_empty() --- toolsrc/include/vcpkg_Strings.h | 3 +++ toolsrc/src/vcpkg_Strings.cpp | 3 +++ 2 files changed, 6 insertions(+) diff --git a/toolsrc/include/vcpkg_Strings.h b/toolsrc/include/vcpkg_Strings.h index 5dd42023294..5af7c6f7c46 100644 --- a/toolsrc/include/vcpkg_Strings.h +++ b/toolsrc/include/vcpkg_Strings.h @@ -39,6 +39,9 @@ namespace vcpkg::Strings static constexpr const CStringView EMPTY = ""; static constexpr const CWStringView WEMPTY = L""; + bool is_empty(const CStringView s); + bool is_empty(const CWStringView s); + template std::string format(const char* fmtstr, const Args&... args) { diff --git a/toolsrc/src/vcpkg_Strings.cpp b/toolsrc/src/vcpkg_Strings.cpp index 0c1c1f9f9ce..b5ea338def0 100644 --- a/toolsrc/src/vcpkg_Strings.cpp +++ b/toolsrc/src/vcpkg_Strings.cpp @@ -71,6 +71,9 @@ namespace vcpkg::Strings::details namespace vcpkg::Strings { + bool is_empty(const CStringView s) { return s == EMPTY; } + bool is_empty(const CWStringView s) { return s == WEMPTY; } + std::wstring to_utf16(const CStringView s) { std::wstring_convert, wchar_t> conversion;