Nigel
94a2de3847
- The algorithm will work once I am of better mind to deal with raw C strings - The resolution should look at each entry divided by '/'. if the entry is not there then we can quit early, however for now I am mostly concerned with getting the names of directory entries we would need to look for.
47 lines
653 B
C++
47 lines
653 B
C++
//
|
|
// Created by nigel on 19/02/23.
|
|
//
|
|
#pragma once
|
|
#include <stddef.h>
|
|
|
|
class String {
|
|
public:
|
|
String(char* characters);
|
|
String(String&) = default;
|
|
unsigned int length();
|
|
|
|
char* str ();
|
|
char operator[](size_t index) ;
|
|
const char operator[](size_t idx) const;
|
|
|
|
protected:
|
|
char* chars;
|
|
|
|
|
|
};
|
|
|
|
class StringView : String {
|
|
public:
|
|
StringView(String& string, unsigned int start, unsigned int end );
|
|
char* str ();
|
|
private:
|
|
unsigned int begin;
|
|
unsigned int end;
|
|
};
|
|
|
|
class Path{
|
|
public:
|
|
Path(String& path);
|
|
Path(char* path);
|
|
|
|
StringView getbasename();
|
|
|
|
char* str();
|
|
|
|
private:
|
|
String path;
|
|
|
|
};
|
|
|
|
|