Improved build system
Added new entries to .gitignore Moved away from source directory as central spot for all source code
This commit is contained in:
24
CoreLib/Path.cpp
Normal file
24
CoreLib/Path.cpp
Normal file
@ -0,0 +1,24 @@
|
||||
//
|
||||
// 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();
|
||||
}
|
||||
Reference in New Issue
Block a user