2020-02-04 07:50:34 +00:00
|
|
|
#pragma once
|
2020-07-06 17:31:40 +00:00
|
|
|
#ifndef MANGOHUD_FILE_UTILS_H
|
|
|
|
#define MANGOHUD_FILE_UTILS_H
|
|
|
|
|
2020-02-04 07:50:34 +00:00
|
|
|
#include <string>
|
|
|
|
#include <vector>
|
|
|
|
|
|
|
|
enum LS_FLAGS
|
|
|
|
{
|
|
|
|
LS_ALL = 0x00,
|
|
|
|
LS_DIRS = 0x01,
|
|
|
|
LS_FILES = 0x02,
|
|
|
|
};
|
|
|
|
|
|
|
|
std::string read_line(const std::string& filename);
|
|
|
|
bool find_folder(const char* root, const char* prefix, std::string& dest);
|
|
|
|
bool find_folder(const std::string& root, const std::string& prefix, std::string& dest);
|
|
|
|
std::vector<std::string> ls(const char* root, const char* prefix = nullptr, LS_FLAGS flags = LS_DIRS);
|
|
|
|
bool file_exists(const std::string& path);
|
|
|
|
bool dir_exists(const std::string& path);
|
2020-06-19 13:15:49 +00:00
|
|
|
std::string read_symlink(const char * link);
|
2021-08-12 10:53:28 +00:00
|
|
|
std::string read_symlink(const std::string&& link);
|
|
|
|
std::string get_basename(const std::string&& path); //prefix so it doesn't conflict libgen
|
2020-02-12 20:59:00 +00:00
|
|
|
std::string get_exe_path();
|
2020-12-13 11:30:42 +00:00
|
|
|
std::string get_wine_exe_name(bool keep_ext = false);
|
2020-02-15 11:04:05 +00:00
|
|
|
std::string get_home_dir();
|
|
|
|
std::string get_data_dir();
|
|
|
|
std::string get_config_dir();
|
2020-07-06 17:31:40 +00:00
|
|
|
|
|
|
|
#endif //MANGOHUD_FILE_UTILS_H
|