mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-11 01:06:01 +03:00
4e65c4dae4
Makes CharacterMapFile::load_from_file and CharacterMap::load_from_file return ErrorOr instead of Optional. This makes them a little nicer to use and a little easier to read, as they seem to have been approximating this.
24 lines
428 B
C++
24 lines
428 B
C++
/*
|
||
* Copyright (c) 2020, Hüseyin Aslıtürk <asliturk@hotmail.com>
|
||
*
|
||
* SPDX-License-Identifier: BSD-2-Clause
|
||
*/
|
||
|
||
#pragma once
|
||
|
||
#include <AK/JsonObject.h>
|
||
#include <LibKeyboard/CharacterMapData.h>
|
||
|
||
namespace Keyboard {
|
||
|
||
class CharacterMapFile {
|
||
|
||
public:
|
||
static ErrorOr<CharacterMapData> load_from_file(const String& filename);
|
||
|
||
private:
|
||
static Vector<u32> read_map(const JsonObject& json, const String& name);
|
||
};
|
||
|
||
}
|