SystemCall run(block) can now exit the run if it returns false
[io/quag.git] / libs / basekit / source / UArray_path.h
blobef11e8aefafe9b0fce18717daf0f8c801908ff6f
1 /*
2 copyright: Steve Dekorte, 2006. All rights reserved.
3 license: See _BSDLicense.txt.
4 */
6 // internally, Io always uses a forward slash "/" for path separators,
7 // but on Windows, back slashes are also tolerated as path separators.
8 #if defined(DOS) || defined(ON_WINDOWS)
9 #define OS_PATH_SEPARATOR "\\"
10 #define IO_PATH_SEPARATORS "\\/"
11 #else
12 #define OS_PATH_SEPARATOR "/"
13 #define IO_PATH_SEPARATORS "/"
14 #endif
16 #define IO_PATH_SEPARATOR "/"
17 #define IO_PATH_SEPARATOR_DOT "."
20 #ifdef ON_WINDOWS
21 #define IS_PATH_SEPERATOR(ch) ((ch == '/') || (ch == '\\'))
22 #else
23 #define IS_PATH_SEPERATOR(ch) (ch == '/')
24 #endif
27 BASEKIT_API void UArray_appendPath_(UArray *self, const UArray *path);
29 // last component
31 BASEKIT_API void UArray_removeLastPathComponent(UArray *self);
32 BASEKIT_API void UArray_clipBeforeLastPathComponent(UArray *self);
33 BASEKIT_API long UArray_findLastPathComponent(const UArray *self);
34 BASEKIT_API UArray *UArray_lastPathComponent(const UArray *self);
36 // extension
38 BASEKIT_API long UArray_findPathExtension(UArray *self);
39 BASEKIT_API void UArray_removePathExtension(UArray *self);
40 BASEKIT_API UArray *UArray_pathExtension(UArray *self);
42 // fileName
44 BASEKIT_API UArray *UArray_fileName(UArray *self);
46 // to/from os path - always returns a copy
48 BASEKIT_API int UArray_OSPathSeparatorIsUnixSeparator(void);
49 BASEKIT_API UArray *UArray_asOSPath(UArray *self);
50 BASEKIT_API UArray *UArray_asUnixPath(UArray *self);