1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 06:07:34 +00:00

LibWeb: Generate ValueID-to-enum conversion functions

This commit is contained in:
Sam Atkins 2022-04-13 17:46:47 +01:00 committed by Andreas Kling
parent 823d67bfc1
commit 3f61f869c8
2 changed files with 49 additions and 3 deletions

View file

@ -49,6 +49,11 @@ String camel_casify(StringView dashy_name)
return builder.to_string();
}
String snake_casify(String const& dashy_name)
{
return dashy_name.replace("-", "_", true);
}
ErrorOr<JsonValue> read_entire_file_as_json(StringView filename)
{
auto file = TRY(Core::Stream::File::open(filename, Core::Stream::OpenMode::Read));