CDVD: Rewrite ISO parser

This commit is contained in:
Stenzek
2023-07-09 17:41:21 +10:00
committed by Connor McLaughlin
parent 51aeaeb508
commit db1e1bcc1f
23 changed files with 660 additions and 1066 deletions

View File

@@ -15,6 +15,7 @@
#pragma once
#include "Pcsx2Types.h"
#include <algorithm>
#include <charconv>
#include <cstdarg>
#include <cstddef>
@@ -340,4 +341,15 @@ namespace StringUtil
/// Converts unsigned 128-bit data to string.
std::string U128ToString(const u128& u);
std::string& AppendU128ToString(const u128& u, std::string& s);
template <typename ContainerType>
static inline bool ContainsSubString(const ContainerType& haystack, const std::string_view& needle)
{
using ValueType = typename ContainerType::value_type;
if (needle.empty())
return std::empty(haystack);
return std::search(std::begin(haystack), std::end(haystack), reinterpret_cast<const ValueType*>(needle.data()),
reinterpret_cast<const ValueType*>(needle.data() + needle.length())) != std::end(haystack);
}
} // namespace StringUtil