GitOS
Operating system exercise
Loading...
Searching...
No Matches
Path.hpp
Go to the documentation of this file.
1//
2// Created by Pawel Reich on 2/15/25.
3//
4
5#pragma once
6
7#ifdef __cplusplus
8extern "C" {
9#endif
10
11#define MAX_PATH 1024
12 struct path_part {
13 char* part;
14 struct path_part* next;
15 };
16 int pathparser_parse(struct path_part** path_root_out, const char* path, const char* current_dir_path);
17 int pathparser_get_drive_number(const char* path);
18 void pathparser_free(struct path_part* part);
19
20#ifdef __cplusplus
21}
22#endif
23
24#ifdef __cplusplus
25#include <stdint-gcc.h>
26class Path {
27
28public:
29 static path_part* parse(const char *path);
30 static path_part* parse(const char *path, Path *relative);
31
32 static bool valid(const char* path);
33
34 static constexpr uint32_t PART_MAX_LEN = 1024;
35};
36#endif
37
void pathparser_free(struct path_part *part)
Definition Path.cpp:69
int pathparser_parse(struct path_part **path_root_out, const char *path, const char *current_dir_path)
Definition Path.cpp:57
int pathparser_get_drive_number(const char *path)
Definition Path.cpp:65
Definition Path.hpp:12
char * part
Definition Path.hpp:13
struct path_part * next
Definition Path.hpp:14