htils 1
A small set of utilities for C programming.
Loading...
Searching...
No Matches
path.h
Go to the documentation of this file.
1#ifndef HTILS_PATH_H
2#define HTILS_PATH_H
3
4/***********************************/
5
6#include <htils/arena.h>
7#include <htils/basictypes.h>
8#include <htils/string.h>
9
10/***********************************/
11
30string *path_canonical(arena_t *arena, const string *path);
31
32//
33//
34//
35
52string *path_basename(arena_t *arena, const string *path);
53
54//
55//
56//
57
73string *path_dirname(arena_t *arena, const string *path);
74
75//
76//
77//
78
94string *path_extension(arena_t *arena, const string *path);
95
96//
97//
98//
99
116string *path_stem(arena_t *arena, const string *path);
117
118//
119//
120//
121
136string *path_join(arena_t *arena, const string *first, const string *second);
137
138//
139//
140//
141
164b32 make_dir(const string *path);
165
166//
167//
168//
169
193b32 does_path_exist(const string *path);
194
195//
196//
197//
198
222b32 path_remove(const string *path);
223
224#endif // !HTILS_PATH_H
struct arena arena_t
An atomic arena.
u32 b32
Definition basictypes.h:43
b32 path_remove(const string *path)
Removes a file or directory at path.
Definition path.c:264
string * path_basename(arena_t *arena, const string *path)
Gets the final component of path: the file name, or the last directory.
Definition path.c:66
string * path_join(arena_t *arena, const string *first, const string *second)
Joins two paths together.
Definition path.c:194
b32 does_path_exist(const string *path)
Checks if a path exists.
Definition path.c:248
string * path_extension(arena_t *arena, const string *path)
Get the extension of path.
Definition path.c:125
string * path_canonical(arena_t *arena, const string *path)
Gets the absolute/canonical path of path.
Definition path.c:42
string * path_stem(arena_t *arena, const string *path)
Get the stem of path.
Definition path.c:158
b32 make_dir(const string *path)
Makes a directory.
Definition path.c:232
string * path_dirname(arena_t *arena, const string *path)
Get the dirname of a path.
Definition path.c:87
An atomic arena.
Definition arena.h:45