1
Fork 0
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:
Conrad Pankoff 2019-06-04 20:54:27 +10:00 committed by Andreas Kling
parent 042895317d
commit 738f9de9a9
5 changed files with 59 additions and 3 deletions

19
Kernel/KParams.h Normal file
View 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;
};