1
1
Fork 0
mirror of https://github.com/QB64-Phoenix-Edition/QB64pe.git synced 2024-09-19 02:44:44 +00:00
QB64-PE/internal/c/libqb/include/filepath.h
2023-12-10 11:15:41 +05:30

24 lines
865 B
C++

#ifndef INCLUDE_LIBQB_FILEPATH_H
#define INCLUDE_LIBQB_FILEPATH_H
#include <string>
struct qbs;
// Takes a path + filename, and returns just the filename portion
// Returns either NULL or empty string if it has none.
const char *filepath_get_filename(const char *path);
// Takes a filename and returns just the extension at the end
// Returns either NULL or empty string if it has none.
const char *filepath_get_extension(const char *fliename);
// Returns true if the path is to a file that matches the provided extension
bool filepath_has_extension(const char *path, const char *extension);
// The following overloaded functions changes the path separators in path based on the OS (path is modified)
const char *filepath_fix_directory(char *path);
const char *filepath_fix_directory(qbs *path);
const char *filepath_fix_directory(std::string &path);
#endif