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#include <htils/arena.h>
5#include <htils/basictypes.h>
6#include <htils/string.h>
7
9//
10//
11
30string *path_canonical(arena_t *arena, const string *path);
31
47string *path_basename(arena_t *arena, const string *path);
48
64string *path_dirname(arena_t *arena, const string *path);
65
81string *path_extension(arena_t *arena, const string *path);
82
99string *path_stem(arena_t *arena, const string *path);
100
101//
102//
103//
104
119string *path_join(arena_t *arena, const string *first, const string *second);
120
121//
122//
123//
124
147b32 make_dir(const string *path);
148
168b32 does_path_exist(const string *path);
169
192b32 path_remove(const string *path);
193
194#endif // !HTILS_PATH_H
u32 b32
Definition basictypes.h:38
b32 path_remove(const string *path)
Removes a file or directory at path.
Definition path.c:280
string * path_basename(arena_t *arena, const string *path)
Get the basename i.e the filename.extension / final dir of path.
Definition path.c:45
string * path_join(arena_t *arena, const string *first, const string *second)
Joins two paths together.
Definition path.c:175
b32 does_path_exist(const string *path)
Checks if a path exists.
Definition path.c:232
string * path_extension(arena_t *arena, const string *path)
Get the extension of path.
Definition path.c:104
string * path_canonical(arena_t *arena, const string *path)
Gets the absolute/canonical path of path.
Definition path.c:29
string * path_stem(arena_t *arena, const string *path)
Get the stem of path.
Definition path.c:136
b32 make_dir(const string *path)
Makes a directory.
Definition path.c:217
string * path_dirname(arena_t *arena, const string *path)
Get the dirname of a path.
Definition path.c:66
An arena.
Definition arena.h:26