Problem: As our kernel grows we need more complex datastructures and functions these would come from the standard C/C++ library with normal programs. The kernel is a freestanding programme and has no access to standard libraries. Solution: We build a mini version of the standard C/C++ library which will contain the datastructures and functions we want. This library can then be statically linked into our kernel binary. Making it a statically linked library also gives more structure to the project. Keeping these random functions and datastructures in the kernel just clutters the kernel source code with less relevant source code.
23 lines
232 B
C++
23 lines
232 B
C++
//
|
|
// Created by nigel on 19/02/23.
|
|
//
|
|
#pragma once
|
|
#include <stddef.h>
|
|
#include "StringView.h"
|
|
|
|
|
|
class Path{
|
|
public:
|
|
explicit Path(String path);
|
|
|
|
StringView getbasename();
|
|
|
|
char* str();
|
|
|
|
private:
|
|
String path;
|
|
|
|
};
|
|
|
|
|