Moved FileSystem stuff into seprate files and a FileSystem Folder
This commit is contained in:
63
Nuake/src/FileSystem/FileSystem.h
Normal file
63
Nuake/src/FileSystem/FileSystem.h
Normal file
@@ -0,0 +1,63 @@
|
||||
#pragma once
|
||||
#include "src/Core/Core.h"
|
||||
#include "String.h"
|
||||
|
||||
#include <string>
|
||||
#include <filesystem>
|
||||
#include <iostream>
|
||||
#include <fstream>
|
||||
|
||||
namespace filewatch
|
||||
{
|
||||
template<typename T>
|
||||
class FileWatch;
|
||||
}
|
||||
|
||||
namespace Nuake
|
||||
{
|
||||
class FileDialog
|
||||
{
|
||||
public:
|
||||
static std::string OpenFile(const char* filter);
|
||||
static std::string SaveFile(const char* filter);
|
||||
static std::string OpenFolder();
|
||||
};
|
||||
|
||||
class Directory;
|
||||
class File;
|
||||
|
||||
class FileSystem
|
||||
{
|
||||
public:
|
||||
static std::string Root;
|
||||
|
||||
static Ref<Directory> RootDirectory;
|
||||
static Ref<filewatch::FileWatch<std::string>> RootFileWatch;
|
||||
|
||||
static void SetRootDirectory(const std::string path);
|
||||
|
||||
static void Scan();
|
||||
static std::string AbsoluteToRelative(const std::string& path);
|
||||
static std::string RelativeToAbsolute(const std::string& path);
|
||||
static std::string GetParentPath(const std::string& fullPath);
|
||||
static Ref<Directory> GetFileTree();
|
||||
static Ref<File> GetFile(const std::string& path);
|
||||
static std::string GetFileNameFromPath(const std::string& path);
|
||||
static void ScanDirectory(Ref<Directory> directory);
|
||||
static void GetDirectories();
|
||||
|
||||
static bool MakeDirectory(const std::string& path, bool absolute = false);
|
||||
static bool DirectoryExists(const std::string& path, bool absolute = false);
|
||||
static bool FileExists(const std::string& path, bool absolute = false);
|
||||
|
||||
static std::string ReadFile(const std::string& path, bool absolute = false);
|
||||
|
||||
static std::ofstream fileWriter;
|
||||
static bool BeginWriteFile(const std::string path, bool absolute = false);
|
||||
static bool WriteLine(const std::string line);
|
||||
static void EndWriteFile();
|
||||
static uintmax_t DeleteFileFromPath(const std::string& path);
|
||||
static uintmax_t DeleteFolder(const std::string& path);
|
||||
static std::string GetConfigFolderPath();
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user