picox  0.1
xfpath.h
[詳解]
1 
14 /*
15  * License: MIT license
16  * Copyright (c) <2016> <MaskedW [maskedw00@gmail.com]>
17  *
18  * Permission is hereby granted, free of charge, to any person
19  * obtaining a copy of this software and associated documentation
20  * files (the "Software"), to deal in the Software without
21  * restriction, including without limitation the rights to use, copy,
22  * modify, merge, publish, distribute, sublicense, and/or sell copies
23  * of the Software, and to permit persons to whom the Software is
24  * furnished to do so, subject to the following conditions:
25  *
26  * The above copyright notice and this permission notice shall be
27  * included in all copies or substantial portions of the Software.
28  *
29  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
30  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
31  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
32  * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
33  * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
34  * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
35  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
36  * SOFTWARE.
37  */
38 
39 #ifndef picox_filesystem_xfpath_h_
40 #define picox_filesystem_xfpath_h_
41 
42 
43 #include <picox/core/xcore.h>
44 
45 
46 #ifdef __cplusplus
47 extern "C" {
48 #endif /* __cplusplus */
49 
50 
82 char* xfpath_join(char* p1, const char* p2, size_t size);
83 
84 
101 char* xfpath_resolve_dot(char* path);
102 
103 
120 XError xfpath_resolve(char* dst, const char* cwd, const char* path, size_t size);
121 
122 
168 char* xfpath_top(const char* path, char** o_end);
169 
170 
214 char* xfpath_tail(const char* path, const char* end, char** o_end);
215 
216 
232 char* xfpath_name(const char* path, char** o_end);
233 
234 
263 char* xfpath_suffix(const char* path, char** o_end);
264 
265 
297 char* xfpath_stem(const char* path, char** o_end);
298 
299 
333 char* xfpath_parent(const char* path, const char* end, char** o_end);
334 
335 
350 char xfpath_drive(const char* path);
351 
352 
359 bool xfpath_is_root(const char* path);
360 
361 
367 bool xfpath_is_absolute(const char* path);
368 
369 
375 bool xfpath_is_relative(const char* path);
376 
377 
378 
384 #ifdef __cplusplus
385 }
386 #endif /* __cplusplus */
387 
388 
389 #endif /* picox_filesystem_xfpath_h_ */
char xfpath_drive(const char *path)
Definition: xfpath.c:299
XError
errnoの代替として使用する共通のエラーコードを表す列挙型です
Definition: xstddef.h:367
bool xfpath_is_root(const char *path)
Definition: xfpath.c:311
char * xfpath_parent(const char *path, const char *end, char **o_end)
パスの上位パスを返します
Definition: xfpath.c:271
XError xfpath_resolve(char *dst, const char *cwd, const char *path, size_t size)
パスを正規化します
Definition: xfpath.c:127
char * xfpath_top(const char *path, char **o_end)
パスの先頭要素を返します
Definition: xfpath.c:150
char * xfpath_stem(const char *path, char **o_end)
パスのファイル名から拡張子を除いた部分を返します
Definition: xfpath.c:244
char * xfpath_resolve_dot(char *path)
パス中に含まれる".."や"."を展開した結果を返します
Definition: xfpath.c:79
bool xfpath_is_absolute(const char *path)
Definition: xfpath.c:328
char * xfpath_tail(const char *path, const char *end, char **o_end)
パスの末尾要素を返します
Definition: xfpath.c:166
char * xfpath_name(const char *path, char **o_end)
パスのファイル名を返します
Definition: xfpath.c:208
char * xfpath_join(char *p1, const char *p2, size_t size)
sizeバイトの領域を持つパスp1とパスp2を連結して返します
Definition: xfpath.c:42
char * xfpath_suffix(const char *path, char **o_end)
パスのファイル名の拡張子を返します
Definition: xfpath.c:214
bool xfpath_is_relative(const char *path)
Definition: xfpath.c:341