BarinkOS/CoreLib/Path.cpp
Nigel dea8ab7d71 Improved build system
Added new entries to .gitignore
Moved away from source directory as central spot for all source code
2023-02-20 00:29:06 +01:00

24 lines
357 B
C++

//
// Created by nigel on 19/02/23.
//
#include "Path.h"
Path::Path(String path)
: path(path)
{
}
StringView Path::getbasename()
{
unsigned int path_length = path.length();
int i = path_length;
while (path[i] != '/')
i--;
return {path,static_cast<unsigned int>(i +1), path_length};
}
char* Path::str() {
return path.str();
}