2014-03-16 09:01:35 -07:00
|
|
|
#ifndef EDI_PATH_H_
|
|
|
|
# define EDI_PATH_H_
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @file
|
|
|
|
* @brief These routines are used for Edi path handling.
|
|
|
|
*/
|
|
|
|
|
|
|
|
typedef struct _Edi_Path_Options
|
|
|
|
{
|
|
|
|
const char *path;
|
|
|
|
const char *type;
|
|
|
|
int line, character;
|
2017-06-08 18:31:45 -07:00
|
|
|
Eina_Bool background;
|
2014-03-16 09:01:35 -07:00
|
|
|
} Edi_Path_Options;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Path options
|
|
|
|
* @defgroup Options
|
|
|
|
*
|
|
|
|
* @{
|
|
|
|
*
|
|
|
|
* Manipulation of various path options.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Create an options based on parsing a string input.
|
|
|
|
* String will be of the format <path>[:<line>[:<character>]]
|
|
|
|
*
|
|
|
|
* @param input The string formatted to have a path with optional line and character parameters
|
|
|
|
* If only one of line or character is provided it's assumed to be the line number.
|
|
|
|
*
|
|
|
|
* @return A newly allocated options struct.
|
|
|
|
*
|
|
|
|
* @ingroup Options
|
|
|
|
*/
|
|
|
|
EAPI Edi_Path_Options *edi_path_options_create(const char *input);
|
|
|
|
|
2015-07-17 10:30:25 -07:00
|
|
|
/**
|
|
|
|
* Append a file to the end of a given path.
|
|
|
|
*
|
|
|
|
* @param path The base path to append to
|
|
|
|
* @param file The file portion to add to the path
|
|
|
|
*
|
|
|
|
* @return a newly allocated string that merges the items to a path using the
|
|
|
|
* correct separator for the current platform.
|
|
|
|
*/
|
2017-01-02 13:19:55 -08:00
|
|
|
EAPI char *edi_path_append(const char *path, const char *file);
|
2015-07-17 10:30:25 -07:00
|
|
|
|
2017-02-19 08:22:53 -08:00
|
|
|
/**
|
|
|
|
* Find if a requested file exists within the specified directory.
|
|
|
|
*
|
|
|
|
* @param dir The directory relative to which we should check.
|
|
|
|
* @param file The filename to check for existance.
|
|
|
|
*
|
|
|
|
* @return whether or not the requested file exists within the specified directory.
|
|
|
|
*
|
|
|
|
* @ingroup Main
|
|
|
|
*/
|
|
|
|
EAPI Eina_Bool edi_path_relative_exists(const char *dir, const char *file);
|
|
|
|
|
2014-03-16 09:01:35 -07:00
|
|
|
/**
|
|
|
|
* @}
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif /* EDI_PATH_H_ */
|