GitOS
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{
10#endif
11
12#define MAX_PATH 1024
13 struct path_part
14 {
15 char* part;
16 struct path_part* next;
17 };
18 int pathparser_parse(struct path_part** path_root_out, const char* path, const char* current_dir_path);
19 int pathparser_get_drive_number(const char* path);
20 void pathparser_free(struct path_part* part);
21
22#ifdef __cplusplus
23}
24#endif
25
26#ifdef __cplusplus
27#include <stdint-gcc.h>
28class Path
29{
30 public:
31 static path_part* parse(const char* path);
32 static path_part* parse(const char* path, Path* relative);
33
34 static bool valid(const char* path);
35
36 static constexpr uint32_t PART_MAX_LEN = 1024;
37};
38#endif
void pathparser_free(struct path_part *part)
Definition Path.cpp:79
int pathparser_parse(struct path_part **path_root_out, const char *path, const char *current_dir_path)
Definition Path.cpp:64
int pathparser_get_drive_number(const char *path)
Definition Path.cpp:74
Definition Path.hpp:14
char * part
Definition Path.hpp:15
struct path_part * next
Definition Path.hpp:16