2021-02-20 18:13:51 +01:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <string>
|
2021-05-02 17:25:03 +02:00
|
|
|
#include <vector>
|
2021-02-20 18:13:51 +01:00
|
|
|
|
|
|
|
namespace VUtils {
|
|
|
|
class FileHandler {
|
|
|
|
public:
|
|
|
|
static bool fileExists(const std::string& fileName);
|
|
|
|
static bool isDirectory(const std::string& fileName);
|
|
|
|
static std::string readFile(const std::string& fileName);
|
|
|
|
static bool writeFile(const std::string& fileName, const std::string& content);
|
|
|
|
static int getFileID(const std::string& fileName);
|
|
|
|
static void closeFD(int fd);
|
|
|
|
static std::string getExtension(const std::string& fileName);
|
|
|
|
static long getFileSize(int fd);
|
|
|
|
static std::string getFileName(const std::basic_string<char>& name);
|
|
|
|
static bool createDirectoryIfNotExist(const std::basic_string<char>& fileName);
|
|
|
|
static char * getHomeDirectory();
|
|
|
|
static std::string getFromHomeDir(const std::basic_string<char>& path);
|
2021-05-02 17:25:03 +02:00
|
|
|
static std::vector<std::string> readDir(const std::basic_string<char>& path);
|
2021-02-20 18:13:51 +01:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|