4 /*** typedefs(not structures) and defined constants **********************************************/
6 #define VFS_PATH_URL_DELIMITER "://"
8 /*** enums ***************************************************************************************/
10 /*** structures declarations (and typedefs of structures)*****************************************/
13 struct vfs_url_struct
;
27 struct vfs_class
*class;
38 /*** global variables defined in .c file *********************************************************/
40 /*** declarations of public functions ************************************************************/
42 vfs_path_t
*vfs_path_new (void);
43 vfs_path_t
*vfs_path_clone (const vfs_path_t
* vpath
);
44 void vfs_path_remove_element_by_index (vfs_path_t
* vpath
, int element_index
);
45 void vfs_path_free (vfs_path_t
* path
);
46 int vfs_path_elements_count (const vfs_path_t
* path
);
48 char *vfs_path_to_str (const vfs_path_t
* path
);
49 char *vfs_path_to_str_elements_count (const vfs_path_t
* path
, int elements_count
);
50 vfs_path_t
*vfs_path_from_str (const char *path_str
);
52 vfs_path_element_t
*vfs_path_get_by_index (const vfs_path_t
* path
, int element_index
);
53 vfs_path_element_t
*vfs_path_element_clone (const vfs_path_element_t
* element
);
54 void vfs_path_element_free (vfs_path_element_t
* element
);
56 struct vfs_class
*vfs_prefix_to_class (const char *prefix
);
58 gboolean
vfs_path_element_need_cleanup_converter (const vfs_path_element_t
* element
);
60 char *vfs_path_serialize (const vfs_path_t
* vpath
, GError
** error
);
61 vfs_path_t
*vfs_path_deserialize (const char *data
, GError
** error
);
63 /*** inline functions ****************************************************************************/
65 static inline gboolean
66 vfs_path_element_valid (const vfs_path_element_t
* element
)
68 return (element
!= NULL
&& element
->class != NULL
);