diff options
| author | Alexander Karatarakis <alkarata@microsoft.com> | 2017-08-28 18:54:48 -0700 |
|---|---|---|
| committer | Alexander Karatarakis <alkarata@microsoft.com> | 2017-08-28 19:54:01 -0700 |
| commit | f3d803addfb3d84d828786d2e6b0b8a34f2fc494 (patch) | |
| tree | ad0dd1761993230746cc6e1c3aada8a1b0f9fd02 /toolsrc | |
| parent | 7d46adb47ca332a072ffb382e4a533aa68a17062 (diff) | |
| download | vcpkg-f3d803addfb3d84d828786d2e6b0b8a34f2fc494.tar.gz vcpkg-f3d803addfb3d84d828786d2e6b0b8a34f2fc494.zip | |
Introduce Strings::is_empty()
Diffstat (limited to 'toolsrc')
| -rw-r--r-- | toolsrc/include/vcpkg_Strings.h | 3 | ||||
| -rw-r--r-- | toolsrc/src/vcpkg_Strings.cpp | 3 |
2 files changed, 6 insertions, 0 deletions
diff --git a/toolsrc/include/vcpkg_Strings.h b/toolsrc/include/vcpkg_Strings.h index 5dd420232..5af7c6f7c 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<class... Args> std::string format(const char* fmtstr, const Args&... args) { diff --git a/toolsrc/src/vcpkg_Strings.cpp b/toolsrc/src/vcpkg_Strings.cpp index 0c1c1f9f9..b5ea338de 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<std::codecvt_utf8_utf16<wchar_t>, wchar_t> conversion; |
