mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-28 21:26:22 +00:00
Kernel: Add KParams class for accessing kernel cmdline parameters (#188)
This commit is contained in:
parent
042895317d
commit
738f9de9a9
Notes:
sideshowbarker
2024-07-19 13:44:52 +09:00
Author: https://github.com/deoxxa
Commit: 738f9de9a9
Pull-request: https://github.com/SerenityOS/serenity/pull/188
Reviewed-by: https://github.com/awesomekling
5 changed files with 59 additions and 3 deletions
19
Kernel/KParams.h
Normal file
19
Kernel/KParams.h
Normal file
|
@ -0,0 +1,19 @@
|
|||
#pragma once
|
||||
|
||||
#include <AK/AKString.h>
|
||||
#include <AK/HashMap.h>
|
||||
|
||||
class KParams {
|
||||
AK_MAKE_ETERNAL
|
||||
public:
|
||||
static KParams& the();
|
||||
|
||||
KParams(const String& cmdline);
|
||||
|
||||
const String& cmdline() const { return m_cmdline; }
|
||||
String get(const String& key) const;
|
||||
bool has(const String& key) const;
|
||||
private:
|
||||
String m_cmdline;
|
||||
HashMap<String, String> m_params;
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue