mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 20:07:35 +00:00
Kernel: Add KParams class for accessing kernel cmdline parameters (#188)
This commit is contained in:
parent
042895317d
commit
738f9de9a9
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