mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 12:07:45 +00:00
AK+Everywhere: Rename String to DeprecatedString
We have a new, improved string type coming up in AK (OOM aware, no null state), and while it's going to use UTF-8, the name UTF8String is a mouthful - so let's free up the String name by renaming the existing class. Making the old one have an annoying name will hopefully also help with quick adoption :^)
This commit is contained in:
parent
f74251606d
commit
6e19ab2bbc
2006 changed files with 11635 additions and 11636 deletions
|
@ -30,13 +30,13 @@ struct Context {
|
|||
};
|
||||
|
||||
struct ValidationError : public Error {
|
||||
ValidationError(String error)
|
||||
ValidationError(DeprecatedString error)
|
||||
: Error(Error::from_string_view(error))
|
||||
, error_string(move(error))
|
||||
{
|
||||
}
|
||||
|
||||
String error_string;
|
||||
DeprecatedString error_string;
|
||||
};
|
||||
|
||||
class Validator {
|
||||
|
@ -255,27 +255,27 @@ private:
|
|||
}
|
||||
|
||||
struct Errors {
|
||||
static ValidationError invalid(StringView name) { return String::formatted("Invalid {}", name); }
|
||||
static ValidationError invalid(StringView name) { return DeprecatedString::formatted("Invalid {}", name); }
|
||||
|
||||
template<typename Expected, typename Given>
|
||||
static ValidationError invalid(StringView name, Expected expected, Given given, SourceLocation location = SourceLocation::current())
|
||||
{
|
||||
if constexpr (WASM_VALIDATOR_DEBUG)
|
||||
return String::formatted("Invalid {} in {}, expected {} but got {}", name, find_instruction_name(location), expected, given);
|
||||
return DeprecatedString::formatted("Invalid {} in {}, expected {} but got {}", name, find_instruction_name(location), expected, given);
|
||||
else
|
||||
return String::formatted("Invalid {}, expected {} but got {}", name, expected, given);
|
||||
return DeprecatedString::formatted("Invalid {}, expected {} but got {}", name, expected, given);
|
||||
}
|
||||
|
||||
template<typename... Args>
|
||||
static ValidationError non_conforming_types(StringView name, Args... args)
|
||||
{
|
||||
return String::formatted("Non-conforming types for {}: {}", name, Vector { args... });
|
||||
return DeprecatedString::formatted("Non-conforming types for {}: {}", name, Vector { args... });
|
||||
}
|
||||
|
||||
static ValidationError duplicate_export_name(StringView name) { return String::formatted("Duplicate exported name '{}'", name); }
|
||||
static ValidationError duplicate_export_name(StringView name) { return DeprecatedString::formatted("Duplicate exported name '{}'", name); }
|
||||
|
||||
template<typename T, typename U, typename V>
|
||||
static ValidationError out_of_bounds(StringView name, V value, T min, U max) { return String::formatted("Value {} for {} is out of bounds ({},{})", value, name, min, max); }
|
||||
static ValidationError out_of_bounds(StringView name, V value, T min, U max) { return DeprecatedString::formatted("Value {} for {} is out of bounds ({},{})", value, name, min, max); }
|
||||
|
||||
template<typename... Expected>
|
||||
static ValidationError invalid_stack_state(Stack const& stack, Tuple<Expected...> expected, SourceLocation location = SourceLocation::current())
|
||||
|
@ -310,7 +310,7 @@ private:
|
|||
}
|
||||
|
||||
private:
|
||||
static String find_instruction_name(SourceLocation const&);
|
||||
static DeprecatedString find_instruction_name(SourceLocation const&);
|
||||
};
|
||||
|
||||
enum class ChildScopeKind {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue